Score:0

Change the UUID which the system selects for root partition

us flag

After investigation, I realized the UUID of the root partition / was appearing at least in 3 different locations:

  1. /boot/efi/EFI/ubuntu/grub.cfg
  2. /proc/cmdline
  3. /etc/fstab

How do I change the UUID which the system selects for root partition?

ru flag
is there a reason you want to change the UUIDs?
us flag
@ThomasWard If I clone the partition with `dd` the UUID is also cloned to another partition
ru flag
So, you have identical UUIDs then. Why the change then to the UUID? Changing the partition UUID can cause other problems, **ESPECIALLY** if you're using `dd` to do a clone.
us flag
@ThomasWard so if you have two partitions with exactly the same UUID, how do you select which is the root partition?
ru flag
Maybe you need to start over and explain what you're trying to achieve. The question as asked sounds like an incomplete question, and judging by your statement that's *also* the case that your use case here and needs are not documented, suggesting that it's missing details in the question about WHY you need to change UUID, etc.
us flag
@ThomasWard I edited my question. Imagine you clone a partition to another partition, then you change the UUID of the cloned partition. You have two partitions exactly equal except for their UUIDs. How do I change the `UUID` which the system selects for root partition?
muru avatar
us flag
@JoãoPimentelFerreira if you clone the root filesystem to another partition, and change the cloned filesystem's UUID, then you no longer have duplicate UUIDs.
us flag
@muru true, but image now, that I want the system to startup with cloned partition as root, after I changed its UUID
muru avatar
us flag
Change `fstab`, run `update-initramfs`, `update-grub`.
us flag
@muru, can you kindly be more verbose or give me some references? ;) I just need to change fstab mounting point and then run those 2 commands?
us flag
@muru, please add those steps as an answer for me to accept it :) thanks
muru avatar
us flag
I don't have a system on hand to test, but those should be enough. Check the generated grub config after running `update-grub` to confirm before rebooting.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.