Ubuntu, Copying Partitions and UUIDs

After some rather unsettling moments when everything in RAM kept running, but the root filesystem quietly disappeared, I decided to clone the root partition onto a second drive and boot from that. On investigation it looked like the first hard drive – /dev/sda –  had been hitting a max temprature of over 130°C.

The thing that was really puzzling me was how to tell Grub 2 that it should use /dev/sdc6 as the new root partition. I followed several sets of instructions, but no matter what I did, it always chose /dev/sda6 as the root partition.

I then tried using the excellent boot-repair disk to see if that could do what I wanted.  I ticked the option I wanted which was to use /dev/sdc6 a the default boot partition.  I applied the changes and still it booted from the wrong partition.  boot-repair sends a clear and well thought-out report to paste.ubuntu.com, and while looking through this I happened to note that the cloned partition had the same UUID (Universally Unique IDentifier) as the original partition.

light bulb!

I figured that this must be causing the confusion, so a quick google pointed me to this post by Paul Goscicki, which confirmed that it was a likely cause.  So on running tune2fs -U random /dev/sdc6 , and then re-running boot-repair, I now have a system booting from the correct partition.

UUIDs are obviously not always UUIDs!

Tags: , , , ,