You are not logged in.

#1 2019-04-15 15:12:39

renordw
Member
From: New Mexico
Registered: 2018-03-04
Posts: 39

[SOLVED] How can I rename a BTRFS subvolume?

I am working on setting up Timeshift, and one of the requirements is for one of the subvolumes to be called @, instead right now mine is called @root.

It seems like it should be trivial to rename it, but I can't seem to figure out how to do it.

Last edited by renordw (2019-04-15 18:33:51)

Offline

#2 2019-04-15 16:22:37

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 8,824
Website

Re: [SOLVED] How can I rename a BTRFS subvolume?

You can just use mv. Remember to update any references to the old name in e.g. fstab/boot configs/scripts/etc.


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2019-04-15 17:18:59

renordw
Member
From: New Mexico
Registered: 2018-03-04
Posts: 39

Re: [SOLVED] How can I rename a BTRFS subvolume?

WorMzy wrote:

You can just use mv. Remember to update any references to the old name in e.g. fstab/boot configs/scripts/etc.

Thank you for the reply, but I am still confused... What exactly do I mv?

$ btrfs sub list /

ID 257 gen 36711 top level 5 path @root
ID 258 gen 36716 top level 5 path @var
ID 259 gen 36716 top level 5 path @home
ID 261 gen 36118 top level 258 path @var/lib/portables
ID 262 gen 36118 top level 258 path @var/lib/machines

$ cat /etc/fstab

UUID=6940ef85-e105-4090-9b7a-***  /                       btrfs             rw,noatime,compress=zstd,ssd,space_cache,commit=120,subvol=/@root                0  0
UUID=6940ef85-e105-4090-9b7a-***  /var                    btrfs             rw,noatime,compress=zstd,ssd,space_cache,commit=120,subvol=/@var                 0  0
UUID=6940ef85-e105-4090-9b7a-***  /home                   btrfs             rw,noatime,compress=zstd,ssd,space_cache,commit=120,subvol=/@home                0  0

I can't see that the name @root corresponds to an actual place in the file system...

Last edited by renordw (2019-04-15 17:21:07)

Offline

#4 2019-04-15 17:35:22

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 8,824
Website

Re: [SOLVED] How can I rename a BTRFS subvolume?

It's on the root of the btrfs filesystem (subvol=/). Since you're actively booted into @root, you'll need to boot a liveCD, mount the btrfs filesystem, and move the @root subvolume there (and update references, etc.)

Alternatively, you can just create a snapshot of @root called @ and boot that instead (again, updating refs.).


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2019-04-15 17:47:14

renordw
Member
From: New Mexico
Registered: 2018-03-04
Posts: 39

Re: [SOLVED] How can I rename a BTRFS subvolume?

WorMzy wrote:

It's on the root of the btrfs filesystem (subvol=/). Since you're actively booted into @root, you'll need to boot a liveCD, mount the btrfs filesystem, and move the @root subvolume there (and update references, etc.)

Alternatively, you can just create a snapshot of @root called @ and boot that instead (again, updating refs.).

Right. I like that second option way more! Thank you. I'll mark it solved after I don't fumble it up.

EDIT: Actually wound up doing the first...

For posterity's sake: just make sure to update fstab and your systemd-boot loader entry. (at least)

Last edited by renordw (2019-04-15 18:33:35)

Offline

Board footer

Powered by FluxBB