LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to save the GRUB loader to the Linux boot partition? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-save-the-grub-loader-to-the-linux-boot-partition-645136/)

bettyhills 05-27-2008 01:43 PM

How to save the GRUB loader to the Linux boot partition?
 
How to save the GRUB loader to the Linux boot partition?

I am backing up my Dell AMD64 Dual Boot WinXP Home/UbuntuGG PC using Acronis True Image 9.0 to an external drive. The instructions caution that later restoring will overwrite the MBR with an Acronis boot code, thus destroying the GRUB startup sequence.

Can anyone tell me how to save the GRUB loader to the Linux root (boot) or boot partition record?

pixellany 05-27-2008 03:06 PM

Using dd, you can save a copy of the GRUB code to a file or to a zone of the raw disk. Be aware, however, that GRUB gets "hard-coded" to point to the location of its files in /boot/grub. If this relationship changes, then the relocated code will not work.

To copy the MBR portion of GRUB to a file:
(assumes SCSI/SATA drives, GRUB on first drive.)
dd if=/dev/sda of=/path/to/grubfile bs=446 count=1

"/path/to/grubfile" could be--eg--/home/username/grubfile

To copy to the boot sector of a partition (#2):
dd if=/dev/sda of=/dev/sda1 bs=446 count=1

See the booting link below for more info.


All times are GMT -5. The time now is 08:25 PM.