How to Backup GRUB
Looking for a GUI based tool to backup and restore GRUB to / from another hard drive, or CD, or USB stick. I have a few Linux distros on one hard drive.
Thank you Dan |
I'm not aware of any tool like that. Usually, you just reinstall grub. There isn't much to it. You might back up the /boot/grub directory to external media. There could be some use to that.
|
See this tutorial for how to reinstall grub2 to the master bot recordd (MBR) from the Ubuntu live CD:
https://help.ubuntu.com/community/Gr...ing%20GRUB%202 The first method there titled simplest should work just fine. Read the entire tutorial to learn just about everything you would ever want to know about grub2. |
Thank you for this. My concern remains, what it seems that is referred to at the link your provided is for the boot info for a particular a particular Linux install. I have several installs on one hard drive, so I've set things such that the boot info is in the MBR of the hard drive, not in a particular Linux install. Thus I presume that backing up from inside a particular Linux install will not backup the MBR for all installs.
If you have any ideas on this, please do post again. Thanks again Dan |
When you install grub it should list all the distros, but may not in some cases. The best thing is to make a copy of your grub.cfg file.
|
Quote:
A conventional arrangement is to have a single /boot file system for GRUB. It contains files the GRUB stages beyond 1 and the GRUB configuration, including "the boot info". For convenience the /boot file system can be mounted by all the installs, allowing you to read/modify it when they are running but it does not have to be this way -- just as long the file system used by GRUB is a "non-exotic" file system type (from GRUB's perspective). The difficulty about backing up GRUB is that stage 1, in the MBR, needs to know the block address of the file for the next stage. If that file is restored by a file-level restore, it is unlikely to be put in the same place, that is at the same block address on the HDD. In theory (not tested), one way to do this, assuming a separate /boot file system at the start of the drive, is a block level copy of the HDD from the beginning to the end of the /boot file file system using dd. Normally dd cannot be used to backup mounted file systems because they may be changing while they are copied and an inconsistent image would be recorded. In the case of the /boot file system this should (TM) not apply because it is only changed during kernel installs and GRUB customisation. Such a block-level copy would also copy the partition table; if the partition table was changed between the copy and the restore then it would point to some wrong locations. In practice the chances of this happening could be mitigated (not eliminated!) by an automated backup run frequently or by sysadmin discipline to run the backup immediately after changing the partitions. |
This is a reply to "catkin". Many thanks for your well thought out reply. I do not know which version of GRUB I have, its what ever comes with Ubuntu 10.10. If this is GRUB2, then my question still remains on how to back up the complete GRUB, for the two distributions that I have on the one hard drive.
Thank you Dan |
Ubuntu 10.10 uses grub2.
You may want to have a look at Super Grub2 Disk: http://www.bootproblems.com/super-grub2-disk/ This is a live CD that can detect and repair and reinstall grub2 for any operating system. |
All times are GMT -5. The time now is 10:45 AM. |