#Creating subvolumes on btrfs. [SOLVED]
419 messages · Page 1 of 1 (latest)
oof yeah
should've made subvols at install
anyways create the /@ subvol
move everything but /home there
then create /@home move every part of home there
of course you will need to enter a live environemnt
no problem
oh an installer?
the you likely already have subvols
no
as you can see
see sudo btrfs subvol list /
ah
okay do the steps i told you
i want to create a subvolume for / and /home
which steps?
i also recommend putting flatpak into its own subvol if you wanna use it
package cache, logs and other things too
@pastel oasis
since snapshots will be per subvol
taking snapshots if you didn't make cache and logs to its own subvol will make the snapshot save logs and cache as well
how do i move everything except home?
sudo btrfs subvol create /@
i have entered this
ok now mount it, with mount -t btrfs -o subvol=path_to_subvolume /dev/deviceX /mnt (of course replace the path_to_subvolume and deviceX)
now you can just mv the directories under / to that subvolume, besides /home
to the mountpoint*
how do i do that?
mv /boot /mnt/boot etc.
but wont that brick my system while im moving stuff to it?
its still running
im not on a live usb
@modest hamlet
oh, well you should do it from a live usb
the path to the subvolume might be a little weird now, i think its gonna be /root/@ instead, but my system is like that and its working fine so it shouldnt be that big of a deal its just a bit annoying
i want it to be just /@
you can delete it and create it again then, this time from the live usb
just mount the drive and create it on the mountpoint
like btrfs create subvolume /mnt/@ (assuming you mount the drive on /mnt)
oh let me check i dont rememebr
use loadkeys name-of-layout
if its available on the iso
idk what the void iso is like
ty
now lemme mount that shit
where do i mount this again?
i entered the live iso
idk what to do
ok so now you can make the subvolume with btrfs create subvolume /mnt/@
so now you can mount the subvolume with mount -t btrfs -o subvol=path_to_subvolume /dev/deviceX /mnt but since theres already something on /mnt you can create another directory to mount it in
you mean /mnt/@?
ye that's the path_to_subvolume
you can create a directory like /subvol just to mount it
so you replace /mnt in that command with that
like mount -t btrfs -o subvol=/mnt/@ /dev/deviceX /subvol for example
bit blurry sorry
mount -o subvol=/mnt/@ /dev/nvme0n1p3 /mnt
well, you should mount it somewhere else other than /mnt since you already mounted the drive there, but its saying the file or directory doesnt exist so thats not why there was an error
could you do btrfs subvolume list /mnt?
oh wait i see the problem lol, i think you dont have to put the absolute path of the subvolume in the mount, just the relative path, so it should be mount -o subvol=/@ /dev/nvme0n1p3 /subvolume (notice how i removed the /mnt before /@)
(assuming you create a directory /subvolume to mount it in)
whats an example command?
for what part?
what
wdym what did you do wrong?
well that looks right, did you mount the wrong drive?
you create the subvolume with btrfs create subvolume /mnt/@
you already created it though, and it worked, it showed up when you did btrfs subvolume list ...
you create a directory to mount the subvolume, for example, /subvolume:
mkdir /subvolume
and mount it:
mount -o subvol=/@ /dev/nvme0n1p3 /subvolume
oh yeah ok
do mv ./subvol ../subvol to move it to root
youre in root's home, i forgot it doesnt start at / lol
after doing this you can try to mount again, it should work
it did work
alright
why did we do /@ instead of /mnt/@?
so now you can move all the directories from /mnt to /subvol, besides root
mv /mnt/boot /subvol/boot etc.
because its relative to the mountpoint, so you dont need the /mnt
im not in /mnt tho
you asked about the mount command right?
you did mount -o subvol=/@ /dev/nvme0n1p3 /subvolume which is mounting the subvolume /@ that is in the device /dev/nvme0n1p3
inside the device, its in the base folder, not inside /mnt, thats just where you mounted the device
idk if that made sense
after doing this you could do a ls -a /mnt to make sure theres nothing left besides /home in there
yeah you can do that after moving the stuff to the root subvolume
i cant move lib32
hmm, whats the error?
i hate my camera
cannot overwrite directory /subvol/lib32 with non directory
@modest hamlet
you dont need to move the @
do i create a subvol for @home?
is there anything inside /home ?
yes
hmm
ok yeah you should create the subvolume like you said
inside /mnt
so btrfs create subvolume /mnt/@home
and then whatm
theres no home inside /subvol if you do ls right?
yeah
ok, so create an empty home directory there with mkdir /subvol/home
what about i just move it from mnt?
you cant cuz youll have to mount the subvolume there
ah ok
you should move it after mounting the subvolume
but you need somewhere to mount it, so thats why i said to create an empty one first
so after creating the home you can mount the subvolume there with mount -o subvolume=/@home /dev/nvme0n1p3 /subvol/home
alright, now just move the contents of /mnt/home to /subvol/home
i imagine theres just your user folder in there so move that
my fans started speeding up
huh
i think that will give the same error as before, you tried to move to /subvol/home but that already exists
sorry, i should have clarified 
it ran
it finished without errors?
and ls /subvol/home gives what?
it says my name
alright so that worked, i didnt know you could do it like that lol
so now just to check, whats the output of ls /mnt and ls /subvol ?
actually do ls -a for those sorry
oh yeah, you can move boot to subvol too
and do rmdir /mnt/home since that should be empty now
with rmdir theres no risk of accidentally deleting something lol
not yet, first do umount /subvol and umount /mnt
and then do mount -o subvolume=/@ /dev/nvme0n1p3 /mnt and afterwards mount -o subvolume=/@home /dev/nvme0n1p3 /mnt/home to mount them in the correct places
HELP ME GOOOD
ah thats fine will just be a bit more manual lol
alright tell me when you finish doing this (after unmounting)
i already umounted /mnt
oh actually first you have to umount /subvol/home
since theres something mounted there as well
then you can umount /subvol
ok, so mount these now
actually wait
since you will have to write the fstab manually anyways you just need to mount the first one lol
ok i did
it says nothing
ok
well the old fstab should already have this info actually
just remembered lol
do cat /mnt/etc/fstab
there is already an fstab
yeah, cat it so i can see where it will have to be changed
okay sorry, i was gone
so , how's it going
pretty fine actually
just need to edit fstab now
we are so close i think
very epic
ok, in the first line, after "defaults", add ,subvol=/@
yup
should be just that
mine is way more complicated for some reason lol
ig genfstab does some weird stuff
cause it was taken from mnttab :v
@modest hamlet
oh wait i just realized
in the line where you do @home also change the first /to /home if you didnt lol
ok you did
alright
should be just that
do i beroot?
yeah just save and reboot
see how i only mount with subvol=/,defaults as mount options,
the kernel handles the rest
fuck
oh no
oh oh
what happened?

you did btrfs subvol create /@ right?
was / the partition you want to subvol?
huh 
oh yeah, regenerate grub config to make grub realize that /boot is actually at /@/boot
can you show me your fstab?
im glad you returned i would have had no clue lmao
bootloaders are my mortal enemies
i usually put my bootloader in ESP so i can avoid problems
how do i regenerate grub conf
fuccckk
well i know you'll have to mount it again and chroot
its so close
also show me ls /boot in the chroot
grub-mkconfig
and just to be safe, let's run grub-install again
grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB
subtitue esp to where you mount your EFI partition
im about to cry
setting up subvol for root post-install was a bad idea :v
it's quite more complicated and involved
lots of things to consider
I have done it successfully if that's any assurance
wait wtf
there is stuff in /boot even tho i havent mounted my boot partition
@modest hamlet
help please
huh
/boot isn't always a partition
yeah you heard me right
um
your original lsblk makes it clear that /boot isn't a seperate partition
/boot/efi is
just run grub-install and grub-mkconfig as per my instruction
this is the chroot right?
compose yourself
sorry
can you lsblk outside of the chroot
i forgot how troublesome vanilla chroot is
does void have a chroot that integrates more with the host system?
like arch's arch-chroot
chroot doesn't share stuff like block device list by default
i dont even know man
well, let me see lsblk when you're outside chroot
oh
there is a chroot for void linux
YOOOOO
its working
i updated grub
lemme reboot
yes
okay good
you haven't? damn
you did grub-install and then grub-mkconf?
this is an emotional rollercoaster
oh
it booted?
well, that just means we need to fix fstab
before we do that
run sudo btrfs subvol list /
can you show me your fstab please?
i need to verify this
and my fstab won't help
there is @ and @home
just show it to me
maybe adding the subvolid would help, i remember having just the subvol being a bit weird sometimes
defaults is valid
defaults let's kernel handle things
what you see in mine are defaults when i generated the fstab
okay now calm down
assess the environment
give me findmnt
oh the problem is there was no comma
it should be defaults,subvol=
yeah
different mount options are seperated by commas
thats why deleting defaults fixed it
letss goooo
np 
this was an emotional rollercoaster
alright i think you have to put [SOLVED] in the title now
im so happy

thamk you guys
yeah
Switching up subvol for root requires a lot of prerequisite knowledge
couldnt have done it without you
well, glad you solved it
ah
i think someone needs to pin this thread or something
Creating subvolumes on btrfs. [SOLVED]

im gonna give yall some thank you cookies @oblique copper
Curvy Linux User received a thank you cookie!
thank you @oblique copper
You're thanking too much ó_ò
You're thanking too much ó_ò
