Skip to content

Instantly share code, notes, and snippets.

@likethesky
Created August 31, 2012 21:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save likethesky/3559639 to your computer and use it in GitHub Desktop.
Save likethesky/3559639 to your computer and use it in GitHub Desktop.
Rebuild MBR partition on USB key

Adapted from: http://perpetual-notion.blogspot.com/2011/08/unetbootin-on-mac-os-x.html

  1. Do the following from Mac OS X terminal window:

fdisk -e /dev/[your disk name here]

e.g., fdisk -e /dev/disk5, then do the following from inside 'fdisk':

f 1

write

exit

If asked, after 'write' above, respond 'y' to reboot--it won't actually reboot.

Then, download from http://www.syslinux.org ( http://www.syslinux.org/wiki/index.php/Download )

Grab the latest release, I downloaded http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-4.05.tar.gz

Double-click it, in Terminal, navigate to ~/Downloads/syslinux-4.05/mbr (or equivalent)

Then (in the above directory, which should have mbr.bin in it), execute:

dd conv=notrunc bs=440 count=1 if=mbr.bin of=/dev/disk[your disk name here]

e.g., dd conv=notrunc bs=440 count=1 if=mbr.bin of=/dev/disk5

Alternatively, you could probably also do (not tested):

dd conv=notrunc bs=440 count=1 if=~/Downloads/syslinux-4.05/mbr/mbr.bin of=/dev/disk5

@Buhos-Dev
Copy link

terminal says: dd: /dev/disk3: Resource busy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment