Cloning GRUB2 makes clone not bootable

Bug #920144 reported by Francis Lamonde on 2012-01-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)

Bug Description

grub2 v1.99 included with Kubuntu 11.10.

I have 2 identical disks, the only difference being their manufacturer serial number (disk ID).

Both disks have the exact same partition table.
Both disks run exactly the same with the same distro, same grub-legacy, same data on each.
I can boot each disk in any order I want, whether they are both connected at the same time or any of them connected alone.
I can swap the order of the disks and boot no problem.

These disks are used in a testing and backup configuration and requirements, therefore I often make images of partitions and restores them, on any disk, as I wish. It always works, using 'dd' from inside the distro or 'g4l', the Ghost For Linux application on a bootable CD.

With grub2 I realized it really wants to use UUIDs everywhere, which I had to fight for. I don't think the approach of grub2 fits for everyone as UUIDs are NOT unique, therefore when you clone partitions or disks the UUIDs are the same on both partitions or disks. This is a very bad method. So I told grub2 not to use UUIDs and I have put DEVICE ID (/dev/disk/by-id/ata-etc...) in the FSTAB and grub.cfg (using 40_custom script). This method is the only one which gives unique identifiers to a partition, not even device name does (sda, sdb can be swapped, so that's not unique). It works fine on my grub2 disk. But only on the disk I have 'installed' grub2 to. The one I clone it to does not work.


sda1 linux partition
sda7 temp partition
I have other partitions for DATA purposes only.
The root and boot are in sda1.

sdb1 linux partition
sdb7 temp partition
I have other partitions for DATA purposes only.
The root and boot are in sdb1.

With grub-legacy I can clone sdb1, sda1, sdb7 and sda7 and restore the images to the other disk or the same disk and both disks remain bootable, no matter the order and no matter if one or both are connected at the same time.

If I install grub2 on DISK2 connected alone (it becomes sda1), I can boot it if it's alone or connected as first drive. grub-legacy cannot chainload to grub2 so I cannot chainload if the disk is 2nd in order. But I can boot directly from a menu in grub-legacy.

The problem occurs if I clone sdb1 and sdb7 of DISK2 to sda1 and sda7 on DISK1. Then DISK1 does not boot grub2 menu no matter what. Alone, both disks, 1st or 2nd, does not change. I get a blank screen with cursor top left and only CTRL-ALT-DEL works. My DISK1, newly cloned BYTE PER BYTE including MBR and partition tables becomes totally unusable.

But if I image sdb1 on DISK2 and restores it to sdb1 on DISK2, it works! On another disk, it doesn't.

Even if the UUIDs are the same on both disks, DISK1 should be able to boot after being cloned if it's alone connected. But it does not.

This problem is not existent with grub-legacy.
My needs go beyond UUIDs and I need disk and partition cloning to work properly.

What's the problem with grub2?
And how to fix it so that a simple clone will work (re-installing grub2 after a clone is not an option, this defeats the purposes of my cloning requirements).

Thank you

Francis Lamonde (frankebay99) wrote :

I have to re-open another ticket, this one is not clear and treats 2 problems in one.

Making it INVALID.

Changed in grub2 (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers