# # /boot/grub/GRUB-Install-Boot.sh # # # Original File # ------------- # http://linux-boot.net/Loaders/Examples/GRUB-Install-Boot.sh # http://linux-boot.net/Loaders/linux-2.4.27.usb.config # # # Manually Install grub onto MemStick # ----------------------------------- # # Grub naming convention # ---------------------- # hd0 == /dev/hda ( eg. hard disk ) # hd1 == /dev/hdc ( eg. cdrom ) # hd2 == /dev/sda ( eg. usb memory stick ) # # # 27-Sep-04 amo Date-of-Birth # 13-Sep-05 amo Added copy latest grub files # # # # # http://networking.earthweb.com/netos/article.php/10951_3340051_3 # # http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html # # # Copy the latest grub files to the USB-Stick # ------------------------------------------- # mount /dev/sda1 /mnt/sda1 # cp /boot/grub/stage1 /boot/grub/stage2 /mnt/sda1/boot/grub # cp -p /boot/grub/fat_stage1_5 /boot/grub/e2fs_stage1_5 /mnt/sda1/boot/grub # cp -p /boot/grub/menu.lst /mnt/sda1/boot/grub # # # Execute the grub commands # ------------------------- # # grub> find /boot/grub/stage1 # # grub> root (hd2,0) # Filesystem type is ext2fs, partition type 0x83 # # grub> kernel /boot/vmlinuz-2.4.27usb root=/dev/sda1 # [Linux-bzImage, setup=0x1400, size=0x15a8c6] # # # # mbr of disk # # grub> setup (hd2) # # # # -- or -- # # # boot sector of the partition # # grub> setup (hd0,0) # # grub> setup (hd2) # Checking if "/boot/grub/stage1" exists... yes # Checking if "/boot/grub/stage2" exists... yes # Checking if "/boot/grub/e2fs_stage1_5" exists... yes # Running "embed /boot/grub/e2fs_stage1_5 (hd2)"... 16 sectors are embedded. succeeded # Running "install /boot/grub/stage1 (hd2) (hd2)1+16 p (hd2,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded # Done. # # # grub> install (hd0,1)/boot/grub/stage1 d (hd0) (hd0,1)/boot/grub/stage2 p (hd0,1)/boot/grub/menu.lst # # grub> boot # grub> reboot # # grub> quit # # # grub --batch <