GithubHelp home page GithubHelp logo

information-security / gpt-surgeon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from steelpangolin/gpt-surgeon

0.0 0.0 0.0 5 KB

Command-line tool for repairing corruption of HFS+ partition labels on GPT-partitioned drives.

Home Page: https://bat-country.us/#gpt-surgeon

License: MIT License

Python 100.00%

gpt-surgeon's Introduction

GPT Surgeon

Command-line tool for repairing corruption of HFS+ partition labels on GPT-partitioned drives.

I originally noticed this corruption on an external HD in a Mac OS X/Windows Vista dual-boot setup using MacDrive 7 for HFS+ access, but some GPT Surgeon users have reported the same issue with Apple's Boot Camp drivers.

Generally this manifests as the Apple Disk Utility error "invalid BS_jmpBoot in boot block: 000000" after you've booted Windows, accessed the drive, and then booted Mac OS X. The data hasn't been lost, but the partition type GUID is wrong, and so Mac OS X can't recognize the filesystem.

See the below blog posts and their comments for more info:

Requirements

Requires Python 2.5 or higher. Not tested with Python 3.

GPT Surgeon relies on direct access to device files, so you'll need to run it as root on Mac OS X, Linux, FreeBSD, etc. My instructions assume Mac OS X. It won't work as is on Windows.

Using GPT Surgeon

You'll need to know the path to the affected disk. You can use the info button in Apple's Disk Utility, or diskutil list in the Terminal. For an external disk, this will usually be /dev/disk1 or higher; if your boot disk is encrypted with FileVault, it may be /dev/disk2 or higher.

Show GPT entries for a disk:

sudo ./gpt_surgeon.py list </dev/diskN>

Change the type of the selected partition on the selected disk to HFS+:

sudo ./gpt_surgeon.py repair </dev/diskN> <partition number>

The partition numbers start at 0, as in the output of the list command.

I've also made a walkthrough video:

walkthrough video

Submitting bug reports

If you run into problems with GPT Surgeon and your disk, please install disktype (which you can get from Homebrew or MacPorts), and include a disktype report for the affected disk with your Github issue:

sudo disktype </dev/diskN> > disktype_report.txt

gpt-surgeon's People

Contributors

steelpangolin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.