Grub 2 and moved sytem (rant and question)
Tom H
tomh0665 at gmail.com
Fri Nov 19 03:41:17 UTC 2010
On Thu, Nov 18, 2010 at 1:11 PM, Thierry de Coulon <tcoulon at decoulon.ch> wrote:
> Following the fact that it's quite difficult to get a scanner to work with 64
> bit Linux when it (unfortunately) requires a closed source 32bit driver, I've
> decided to migrate my installation to a larger partition (on the same
> computer).
>
> I've done it as I usually do, by copying the installation from one partition
> to another, in this case / went from sda6 to sda1 and /home from sda7 to sda2
> (using cp -r -v --preserve --no-dereference). No problem.
>
> I then edited /etc/fstab on the new root. Normaly, I would have
> edited /boot/grub/menu.lst but... we now have grub 2.
>
> First try: no luck. Grub fails with: Alert! /dev/disk/by-uuid/<some long and
> impossible to understand stuipd uuid>
>
> ************Rant 1****************************
> they say they must use uuid's because "if partition order changes one can not
> boot anymore". Well, when does partition order change without the user doing
> it? And it's easy to correct with /dev/sdx, not with uuid! And if you clone
> your disk _nothing_ works at all because _all_ uuid's change! Great! Now even
> when the partition order did not change you can't boot anymore...
> **********************************************
The UUID of a filesystem is stored in the superblock of a filesystem
and isn't copied over to another filesystem with "cp".
Using UUIDs most certainly does prevent boot problems due to kernel
device naming issues.
> Now, luckily, I could still boot my old installation and search for
> information as to how get grub 2 to find out about the new uuid if my root
> partition, but I found none! update-grub did not do it. Grub 2 documentation
> is as easy to read as the darkest night and they should really have created
> tools to manage it before they use it as default boot loader.
>
> After some time searching to no avail, I made another search that solved my
> problem: uninstall grub 2, install grub legacy, edit /boot/grub/menu.lst, and
> voilĂ , everything works.
>
> *************Rant 2**************************
> Maybe Grub 2 has many more possibilities than Grub Legacy, for the moment and
> with the current documentation, it mostly has more problems!
> *******************************************
>
> Now to the question: does anyone know how to do with grub 2 if you move your
> system to another partition?
1. You could've found out the UUIDs of "/" and "/boot" with blkid or
tune2fs, run "tune2fs -U <uuid> ..." to change the UUID(s) of the new
filesystem(s) to the old UUIDs, and run "tune2fs -U random ..." on the
old filesystem(s).
2. You could've booted into your old install, chrooted your new
install, and run "update-grub".
This isn't a grub2 problem! Had you been running 9.04 and done the the
same "cp" you'd have had the same issue with UUIDs.
More information about the ubuntu-users
mailing list