For redundancy purposes, my computer has two identical hard drives.
I installed Ubuntu 12.04 and Grub in /dev/sda.
I cloned /dev/sda to /dev/sdb (I used FOG)
When I change the primary hard drive in the BIOS I don't always get that hard drive to boot. It doesn't always start the Grub installed in this "primary hard drive".
I have read some information about the boot sequence
http://www.dedoimedo.com/computers/grub.html
http://www.golinuxhub.com/2014/03/step-by-step-linux-boot-process.html
http://www.thegeekstuff.com/2011/02/linux-boot-process/
but I'm still unable to consistently boot from the drive I want. My fstab uses the UUID.
After the clone, the partitions in sda and sdb have the same UUID. I changed the UUID of the partions in /dev/sdbx with
tune2fs -U random /dev/sdbx
And updated the /etc/fstab file in /dev/sdb1 to use the new UUIDs. I then updated grub with
sudo update-grub
And I installed it in both hard drives:
sudo install-grub /dev/sda
sudo install-grub /dev/sdb
When I boot again, it doesn't matter if I choose the first (sda) or the fourth (sdb) option in Grub, it always boots from sda.
The file /boot/grub/grub.cfg uses the UUID. could this be related to my problem?
sda
and which drive issdb
depends on the ports the drives are connected to. If you have four SATA-ports, the drive connected to the first port issda
. Numbering of ports is different on motherboards, may be port0-3 or port1-4. In the first case port0 issda
, in second case port1 issda
.