Tuesday, January 4, 2011

"grub-install" How to.

1. How to create GRUB boot floppy with a filesystem ?

# mke2fs /dev/fd0
# mount -t ext2 /dev/fd0 /mnt
# grub-install --root-directory=/mnt fd0
# umount /mnt

2. How to install GRUB in USB pendrive ?

Some BIOSes have a bug of exposing the first partition of a USB drive as a floppy instead of exposing the USB drive as a hard disk (they call it “USB-FDD” boot). In such cases, you need to install like this:

# losetup /dev/loop0 /dev/sdb1
# mount /dev/loop0 /mnt/usb
# grub-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0

3. How to install GRUB if you have saparate /boot partition on any Hard disk ? # grub-install --root-directory=/boot /dev/hda OR, in grub menu to install GRU on available hardisk, root (hd0,0) setup (hd0)



grub-install accepts the following options: ‘--help’ Print a summary of the command-line options and exit. ‘--version’ :Print the version number of GRUB and exit. ‘--root-directory=dir’ :Install GRUB images under the directory dir instead of the root directory. This option is useful when you want to install GRUB into a separate partition or a removable disk. Here is an example in which you have a separate boot partition which is mounted on ‘/boot’: grub-install --root-directory=/boot hd0 ‘--recheck’ :Recheck the device map, even if ‘/boot/grub/device.map’ already exists. You should use this option whenever you add/remove a disk into/from your computer.

1 comment:

  1. Hi,

    This is nice blog
    This USB Floppy Emulator is the one which increases the reliability of your equipment. It allows you to save your files and programs in a safely way. it also reduces faults and down times in your process. For more information, please visit our Web site at http://www.floppytousb.net/

    ReplyDelete