The officially official Devuan Forum!

You are not logged in.

#1 2022-02-02 05:56:06

MLEvD
Member
Registered: 2021-02-14
Posts: 124  

Changing UUID of /root?

How is this done? Live or chroot? I know about changing uuid in fstab, but there is something else I need to do, what is it? Is there a guide online to this?
I want to clone a system then give it a new UUID?

Last edited by MLEvD (2022-02-02 10:13:19)

Offline

#2 2022-02-02 05:57:38

Dutch_Master
Member
Registered: 2018-05-31
Posts: 230  

Re: Changing UUID of /root?

Don't. Root requires a UUID of 1.

Offline

#3 2022-02-02 06:15:05

MLEvD
Member
Registered: 2021-02-14
Posts: 124  

Re: Changing UUID of /root?

What? I have never had a root with a UUID of 1.

My current root UUID is 08e4209d-xxxx-xxxx-xxxx-d44fa7e0f470

(some chars exed for privacy)

Offline

#4 2022-02-02 09:04:56

GlennW
Member
Registered: 2019-07-18
Posts: 261  

Re: Changing UUID of /root?

I had a couple of attemps at this but struck out time and again. sorry. I've only done this with filesystems. Changing system UID's is different... https://kerneltalks.com/tips-tricks/how … -in-linux/

Offline

#5 2022-02-02 09:30:25

Camtaf
Member
Registered: 2019-11-19
Posts: 213  

Re: Changing UUID of /root?

Each disk has a unique UUID, you will have to find the new disks UUID first, & then add it to fstab of that disk, then it should boot.


@ Dutch_Master
(The root user has the ID of 0.)

$ id root
uid=0(root) gid=0(root) groups=0(root)

Online

#6 2022-02-02 10:12:29

MLEvD
Member
Registered: 2021-02-14
Posts: 124  

Re: Changing UUID of /root?

Camtaf wrote:

Each disk has a unique UUID, you will have to find the new disks UUID first, & then add it to fstab of that disk, then it should boot.


It doesn't boot. Grub complains it can't find the old uuid.

Offline

#7 2022-02-02 13:59:09

Camtaf
Member
Registered: 2019-11-19
Posts: 213  

Re: Changing UUID of /root?

Ah, OK, try re installing grub to that drive, you may need to use a 'live' version of your distro.

Online

#8 2022-02-02 15:13:20

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 2,530  

Re: Changing UUID of /root?

https://unix.stackexchange.com/question … -same-uuid

@OP: search engines are quicker than forums wink

Offline

#9 2022-02-02 15:59:07

Dutch_Master
Member
Registered: 2018-05-31
Posts: 230  

Re: Changing UUID of /root?

(The root user has the ID of 0.)

Errmmm, oops yikes

Offline

#10 2022-02-03 01:00:51

GlennW
Member
Registered: 2019-07-18
Posts: 261  

Re: Changing UUID of /root?

Well, if it's uuid of fs you require, You can check with lsblk and blkid and fstab, piping through grep for your disk /dev/sd*

Then changing the uuid in fstab for that system. Personally I find using a "live" varient simpler with a text editor and cut/copy/paste.

This is what I have done after changing a(n) fs, even swaps.

Last edited by GlennW (2022-02-03 01:01:19)

Offline

#11 2022-02-03 13:28:08

hevidevi
Member
Registered: 2021-09-17
Posts: 230  

Re: Changing UUID of /root?

clone the system then chroot into it and change the UUID, depends on use case scenario. If grub is not finding the uuid then you have not update the grub.cfg inside the chroot it would seem?

Ive done this in the past using rsync, i rsync the root file system to a usb stick or other partition, chroot into it via /mnt using arch-install-scripts the do all the work from there. Grub is key though, as i said depends on scenario, dual boot, boot from stick, other hard disk on other machine etc etc...

Offline

Board footer