Context
I have a laptop with a SATA (sdb/hd1
) slot and an m.2 (sda/hd0
) slot. I had an SSD on the hd0 slot with the boot and EFI partition, and an HHD on the hd1 with the /
, /home
and swap
partitions on it.
I recently bought a bigger SSD to replace the old one. And when replacing it, I did a backup (using clonezilla) of all the partitions on the SSD, plus the /root
partition on the HDD ; I then restored all those partitions on the new drive. I also kept the old /
partition on the HDD in case a problem would occur.
I did those changes after the restore:
- On the
/boot/grub.cfg
file, I changed all the lines referencing the old/root
partition (/dev/sdxn
) or its UUID (UUID=[old partition's uuid]
) to reference the new one. - On
/etc/fstab
(on the new partition), I also changed all the UUID's of the old partitions to the new ones.
Problem
These changes allowed me to boot correctly on the new SSD, but after every update, the /boot/grub.cfg
file goes back to referencing the old partition.
I am guessing that there's still some file responsible for generating the grub configuration that still has the old partition informations, but I can't manage to find it.
/
partitions had the same UUID's, so both of them were added as GRUB entries but with exactly the same UUID and the old one was always the one chosen by grub – Blumer Jan 10 '21 at 14:01