I have an external USB drive with various partitions and I have installed Ubuntu 20.04 in one of them, updated grub (on the external and internal drives) and now I can boot from both my internal drive and my external one.
The external drive have several partitions and I have installed from the live stick on dev/sdb7 UUID=f3590ceb-cd80-40cc-8388-cc1797ab0b33
The autogenerated grub entry for this installation reads
Code:
menuentry 'Ubuntu 20.04 LTS (20.04) (on /dev/sdb7)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-f3590ceb-cd80-40cc-8388-cc1797ab0b33' {
insmod part_msdos
insmod ext2
set root='hd1,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos7 --hint-efi=hd1,msdos7 --hint-baremetal=ahci1,msdos7 f3590ceb-cd80-40cc-8388-cc1797ab0b33
else
search --no-floppy --fs-uuid --set=root f3590ceb-cd80-40cc-8388-cc1797ab0b33
fi
linux /boot/vmlinuz-5.4.0-26-generic root=UUID=f3590ceb-cd80-40cc-8388-cc1797ab0b33 ro quiet splash $vt_handoff
initrd /boot/initrd.img-5.4.0-26-generic
}
and works fine.
Then I have copied the installation to another partition of the same drive (/dev/sdb5) UUID=adcdd044-5e77-44c2-9b52-55961254c3d9
When I update grub I get
Code:
menuentry 'Ubuntu 20.04 LTS (20.04) (on /dev/sdb5)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-adcdd044-5e77-44c2-9b52-55961254c3d9' {
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 adcdd044-5e77-44c2-9b52-55961254c3d9
else
search --no-floppy --fs-uuid --set=root adcdd044-5e77-44c2-9b52-55961254c3d9
fi
linux /boot/vmlinuz-5.4.0-26-generic root=UUID=f3590ceb-cd80-40cc-8388-cc1797ab0b33 ro quiet splash $vt_handoff
initrd /boot/initrd.img-5.4.0-26-generic
}
I note that the --fs-uuid used the uuid of the new partition (/dev/sdb5) but the second last line still points to (/dev/sdb7) and if I boot using this entry I still boot into the system that is in fact in (/dev/sdb7)
So I have changed that line to read
Code:
linux /boot/vmlinuz-5.4.0-26-generic root=UUID=adcdd044-5e77-44c2-9b52-55961254c3d9 ro quiet splash $vt_handoff
to match the UUID of the rest of the entry, (I have done this using 40_custom but it can be done also editing directly grub.cfg)
I have also updated the fstab in the partition that corresponds to (/dev/sdb5):
Code:
# / was on /dev/sdc7 during installation (changed to what now is sdb5)
UUID=adcdd044-5e77-44c2-9b52-55961254c3d9 / ext4 errors=remount-ro 0 1
# swap was on /dev/sdc8 during installation
UUID=83dd8c27-711b-4f2c-865c-af056a37f968 none swap sw 0 0
Note that also swap is on the external USB drive.
But then when I boot using this entry it hangs, trowing a number of errors during boot.
I though that the installation was partition agnostic and in the past I have done it many times with older versions of Ubuntu. I do it when I want to install a new release, I first install in the external drive, I try it. Then I move my internal current version to the another partition of the external drive and check that I can boot it (this is where it now fails). And only then I move the installation of the new release to my internal drive.
As I said I have done this many times in the past but now clearly something changed and I am missing it.
Any clues?
Thanks
Bookmarks