Changing name & label of the root partition possible?

Is it possible to relabel drives that were given a name and label during installation (root partition => name endeavouros, label endeavouros) when they are unmounted (live session) if they have already been entered in /etc/fstab (with UUID)? In this case it is the subvolume @ on Btrfs.

I know this is a question for @dalto but i also wonder if you can just use gparted to change the names by right click and name or label which allows you to edit it? :thinking:

I’m not sure how that affects the fstab or subvolumes?

1 Like

As long as you are mounting them by UUID, changing the labels and/or partition name shouldn’t be a problem.

If you change the name of the subvolume, you would have to make a change to /etc/fstab as well.

If you change the name of the root subvolume aka @, you would also need to change it in the bootloader settings.

2 Likes

Does this mean you could do it from gparted rather than a live session and unmounting?

I don’t know if gparted will let you relabel a mounted volume. There is one easy way to find out though.

2 Likes

After some testing, it looks like gparted will let you change the name but not the label while the partition is mounted.

2 Likes

I just tried it in vmware on xfce but is ext4 file system. So you can rename it and change the label name without unmounting it? I just right clicked and then use name or label for each and i edited the name.

I can do this with Gparted in live mode, but my question is about the boot behavior.

It shouldn’t impact boot unless you have the labels in fstab or in your bootloader options. My more detailed answer is above.

1 Like

I just did it on a vm but it is not btrfs and i had no problem but it is systemd-boot also not grub.

After some testing, it looks like gparted will let you change the name but not the label while the partition is mounted.

I just right clicked and used label?

Edit: One is name and other is label.

Here is my fstab:

UUID=7AC8-1029                             /efi           vfat    defaults,noatime 0 2
UUID=329087f6-bc68-4a90-97f4-987896e1b7b3  /              btrfs   subvol=/@,defaults,noatime,compress=zstd 0 0
UUID=329087f6-bc68-4a90-97f4-987896e1b7b3  /home          btrfs   subvol=/@home,defaults,noatime,compress=zstd 0 0
UUID=329087f6-bc68-4a90-97f4-987896e1b7b3  /var/cache     btrfs   subvol=/@cache,defaults,noatime,compress=zstd 0 0
UUID=329087f6-bc68-4a90-97f4-987896e1b7b3  /var/log       btrfs   subvol=/@log,defaults,noatime,compress=zstd 0 0
UUID=329087f6-bc68-4a90-97f4-987896e1b7b3  /swap          btrfs   subvol=/@swap,defaults,noatime 0 0
/swap/swapfile                              none          swap    defaults 0 0
UUID=caf40634-610f-4992-b2db-16d556eaf403  /mnt/data      ext4    defaults,noatime 0 2
tmpfs                                      /tmp           tmpfs   defaults,noatime,mode=1777 0 0

As long as you don’t change the name of the subvolumes(like renaming @home to @myhome you shouldn’t need to make any changes.

What you would be looking for is something like LABEL=mylabel or PARTLABEL=mypartlabel but you don’t have anything like that.

I suppose you would also have to avoid /dev/disk/by-label/mylabel and /dev/disk/by-partlabel/mypartlabel as well. But you also don’t have anything like that.

1 Like

thx @dalto , @ricklinux

1 Like

@dalto

Could one use PARTUUID (or /dev/disk/by-partuuid) instead of UUID for a partition?
Not sure about this but one can then format a partition without the need to change its UUID in fstab?

Yes.

I don’t know either. :sweat_smile:

1 Like

I have a vague recollection that I read somewhere that PARTUUID is identifier for the partition itself and not the filesystem which is identified by UUID. When the partition is formatted, the filesystem will get a new UUID but the PARTUUID remains the same.

Take this with a grain of salt :wink:

PS. I am gonna test it on a partition and report back.

Update: Looks like my memory still serves me right sometimes :sweat_smile:

Before formatting (ext4):

$ sudo blkid /dev/sda6
/dev/sda6: UUID="a9b2cd1f-5080-48df-afff-48afe2c9db8e" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="63444f18-cc49-46d8-8cc7-22cbc020c584"

After formatting (ext4):

$ sudo blkid /dev/sda6
/dev/sda6: UUID="6c7c6fc3-d247-4fd1-85a0-ce11e928d73b" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="63444f18-cc49-46d8-8cc7-22cbc020c584"

After formatting to another filesystem (btrfs):

$ sudo blkid /dev/sda6
/dev/sda6: UUID="ddba58bc-ce57-4b2e-a8b3-13c904bf9d33" UUID_SUB="a394e4c3-fd62-4199-901d-c637f8e035ed" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="63444f18-cc49-46d8-8cc7-22cbc020c584"

Looks like PARTUUID remains the same.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.