[plug] Restoring an entire linux filesystem from backup and making it bootable

Haydon Knight nodyah at gmail.com
Fri Aug 1 18:42:26 WST 2008


Hi,

Well thank you soooo much I have now got the partition booting!  :-)

If I recall correctly, I did something like: I booted off the live CD,
mounted /dev/sda2 as /mnt/ubuntu, then:

sudo -i
cp -r /mnt/ubuntu/boot /mnt/ubuntu/boot.old
rm -rf /mnt/ubuntu/boot/grub
grub-install --root-directory=/mnt/ubuntu /dev/sda2
grub
grub> find /boot/grub/stage1
grub> root (hd0,1)
grub> setup (hd0)
grub> quit
cp /mnt/ubuntu/boot.old/grub/menu.lst /mnt/ubuntu/boot/grub/menu.lst
/sbin/blkid /dev/sda2

Then I edited menu.lst and /etc/fstab to use the UUID (which I have
found out is a unique identifier associated with each partition)
printed out by blkid.  This ID indeed had changed when the partition
was formatted.  I also was able to delete all the old ubuntu kernel
options given by grub at the same time.

Rebooting and ubuntu seems to be working just the same as before!
Windows XP still isn't booting.  This partition doesn't have anything
of value on it.  I still don't know why this happened, and will just
format it unless anyone knows a simple fix.  Presumably it is some
bootloader problem.

Thanks again

Haydon Knight


On Thu, Jul 31, 2008 at 6:27 PM, Mike Holland <michael.holland at gmail.com> wrote:
> When you restore a Linux install, on the same or different machine, by just
> copying all the files, there are a few extra steps:
>
> - reinstall GRUB.
>   # grub-install--root-directory=/mnt/XXXXX  /dev/sdX
> - edit /boot/grub/menu.lst to have the correct devices and/or UUIDs
> - edit /etc/fstab likewise.
>
> You can do all this from a live CD.
> Anything I forgot?
> You can avoid the second two by keeping the partiton numbers the same,
> and either avoiding UUIDs, or imaging the whole partition.
>
> Mike
>
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://www.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au
>



More information about the plug mailing list