2012-01-17

Create USB boot disc under Linux

Well if you, like me, managed to destroy your boot sector, the following steps can be a solution; creating a bootable usb disk containing containing the contents of you grub installation.

*) Insert the usb-disk you want to erase/make bootable. Unmount the disk.
$ sudo umount /media/
*) Identify the name of your disk. It should be something like /dev/sdx1
$ ls /dev/sd*
*) Create file system on the drive you identified as your usb-disk
$ mkfs.vfat /dev/sdx1
*) create a folder, mount the disk on that folder, install grub and copy the boot files
$ sudo mkdir boot_disk
$ sudo mount /dev/sdx1 boot_disk
$ sudo grub-install --no-floppy --root-directory=boot_disk /dev/sdc
$ sudo cp -rf /boot/* boot_disk/boot/

Restart and boot. If it fails, your'e doomed.

No comments:

Post a Comment