You are not logged in.

#1 2014-11-26 09:12:49

akermu
Member
Registered: 2014-11-26
Posts: 2

Move btrfs root filesystem to a subvolume

Hello everyone,

I have installed btrfs as my filesystem for / in a single encrypted partition. I have created a separate subvolume for /home.
Now i want to have / in a separate subvolume too. Is it possible to move / to a subvolume retroactively without loosing everything in it?

Thanks in advance!

P.S. Its kind of annoying, that this forum-software needs the referrer to function hmm

Offline

#2 2014-11-26 15:04:31

nstgc
Member
Registered: 2014-03-17
Posts: 393

Re: Move btrfs root filesystem to a subvolume

From my understanding of how btrfs works, everything is already in a subvolume. Its just in the default subvolume. It should be possible to move the subvolume that root is in. Alternatively you can use rsync. What you do need to make sure of is that your boot loader knows where to look and also that fstab is updated. For example in grub I have the line

linux	/arch/boot/vmlinuz-linux root=UUID=8f324aa7-a827-4b28-b706-f0ae9816f98b rw rootflags=subvol=arch  quiet

and in fstab I have the mount option "subvol=arch".

I would suggest looking through "man btrfs-subvolumes" if you want to try moving the default subvolume elsewhere.

Last edited by nstgc (2014-11-26 15:05:31)

Offline

#3 2014-11-28 10:47:37

akermu
Member
Registered: 2014-11-26
Posts: 2

Re: Move btrfs root filesystem to a subvolume

Yeah my problem was, that when i did a

# btrfs subvolume list /

i only got

ID 257 gen 65504 top level 5 path home

but i can take snapshots of /, so i guess i'm alright. Thanks!

Edit: Can somebody mark this as Solved? Thanks!

Last edited by akermu (2014-11-28 10:50:50)

Offline

#4 2014-11-28 14:29:55

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Move btrfs root filesystem to a subvolume

akermu wrote:

Edit: Can somebody mark this as Solved? Thanks!

Congrats on finding a solution. smile You can mark it yourself by editing the first post and adding "[SOLVED]" to the subject. Directions are also found in the How to Post section of the forum etiquette which I suggest all newcomers to the forums should read.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

Board footer

Powered by FluxBB