#Creating subvolumes on btrfs. [SOLVED]

419 messages · Page 1 of 1 (latest)

pastel oasis
#
nvme0n1
├─nvme0n1p1 vfat   FAT32       FCB3-8CD6                            1021.7M     0% /boot/efi
├─nvme0n1p2 swap   1           eb877a1b-38e7-4614-b6e2-8b97a3ea9fd6                [SWAP]
└─nvme0n1p3 btrfs              0c0e0553-95ed-467b-bd9d-617a1deb3de3  312.3G    32% /```
pastel oasis
#

This is post installation

#

i want to create home and root subvolumes

oblique copper
#

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

pastel oasis
#

im on void linux

#

so had no option

oblique copper
#

of course you will need to enter a live environemnt

pastel oasis
oblique copper
pastel oasis
#

as you can see

oblique copper
#

see sudo btrfs subvol list /

pastel oasis
modest hamlet
#

ah

oblique copper
#

okay do the steps i told you

pastel oasis
#

i want to create a subvolume for / and /home

pastel oasis
oblique copper
oblique copper
#

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

pastel oasis
#

sudo btrfs subvol create /@

#

i have entered this

modest hamlet
#

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)

pastel oasis
#

im not on installation

#

this is post installation

modest hamlet
#

thats fine

#

you can still mount it normally

pastel oasis
#

ok

#

then?

modest hamlet
#

now you can just mv the directories under / to that subvolume, besides /home

#

to the mountpoint*

modest hamlet
#

mv /boot /mnt/boot etc.

pastel oasis
#

but wont that brick my system while im moving stuff to it?

#

its still running

#

im not on a live usb

#

@modest hamlet

modest hamlet
#

oh, well you should do it from a live usb

pastel oasis
#

ok

#

lemme switch to my live usb

modest hamlet
#

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

pastel oasis
#

i want it to be just /@

modest hamlet
#

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

pastel oasis
#

wait

#

im gonna switch to my live iso

modest hamlet
pastel oasis
#

uhh

#

how do we change the

#

keyboard layout

modest hamlet
#

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

pastel oasis
#

ty

#

now lemme mount that shit

#

where do i mount this again?

#

i entered the live iso

#

idk what to do

modest hamlet
#

you can mount it to /mnt

#

just do mount /dev/deviceX /mnt with the correct device

pastel oasis
#

ok

#

ibdid

#

i did

#

now what

modest hamlet
#

ok so now you can make the subvolume with btrfs create subvolume /mnt/@

pastel oasis
#

ok

#

now?

modest hamlet
#

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

modest hamlet
#

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

pastel oasis
#

bit blurry sorry

modest hamlet
#

hm

#

where did you try to mount it to?

#

i cant read that end of the command

pastel oasis
#

mount -o subvol=/mnt/@ /dev/nvme0n1p3 /mnt

modest hamlet
#

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?

pastel oasis
modest hamlet
#

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)

pastel oasis
#

whats an example command?

modest hamlet
#

wha for what part?

pastel oasis
#

mounting the subvol

#

oh

#

wait

#

ok sorry

#

wait wtf

modest hamlet
#

what

pastel oasis
#

i messed everything up

#

can u teach me step by step?

modest hamlet
#

wdym what did you do wrong?

pastel oasis
#

this is my lsblk

modest hamlet
#

well that looks right, did you mount the wrong drive?

pastel oasis
#

no

#

lets start from scratch

#

ok?

#

i mounted my disk to /mnt

#

and now what?

modest hamlet
#

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 ...

pastel oasis
#

yeah

#

and then?

modest hamlet
#

you create a directory to mount the subvolume, for example, /subvolume:
mkdir /subvolume
and mount it:
mount -o subvol=/@ /dev/nvme0n1p3 /subvolume

pastel oasis
#

im back

#

@modest hamlet

#

i created a directory called subvol

modest hamlet
#

did you do the mkdir /subvolfirst?

#

oh

#

huh, weird, can you show the output of ls

pastel oasis
modest hamlet
#

oh maybe youre not in /

#

do pwd

pastel oasis
#

you mean chroot?

#

pwd

#

wait

#

sorry

#

this is not the terminal lol

modest hamlet
#

where is the /mnt directory?

pastel oasis
modest hamlet
#

oh yeah ok

#

do mv ./subvol ../subvol to move it to root

#

youre in root's home, i forgot it doesnt start at / lol

modest hamlet
pastel oasis
#

it did work

modest hamlet
#

alright

pastel oasis
#

why did we do /@ instead of /mnt/@?

modest hamlet
#

so now you can move all the directories from /mnt to /subvol, besides root
mv /mnt/boot /subvol/boot etc.

modest hamlet
pastel oasis
#

im not in /mnt tho

modest hamlet
#

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

pastel oasis
#

ohhhhh

#

ok

#

i also wanna make a subvol for home too

modest hamlet
modest hamlet
pastel oasis
#

i cant move lib32

modest hamlet
#

hmm, whats the error?

pastel oasis
#

i hate my camera

#

cannot overwrite directory /subvol/lib32 with non directory

#

@modest hamlet

modest hamlet
#

hmmm

#

oh, you have to do mv /mnt/lib32 /subvol/lib32

#

just missed the last lib32

pastel oasis
#

ok

#

i did the same for every one of them tho

#

now theres boot, home and @ left

modest hamlet
#

you dont need to move the @

pastel oasis
#

do i create a subvol for @home?

modest hamlet
#

is there anything inside /home ?

pastel oasis
#

yes

modest hamlet
#

hmm

#

ok yeah you should create the subvolume like you said

#

inside /mnt

#

so btrfs create subvolume /mnt/@home

pastel oasis
#

and then whatm

modest hamlet
#

theres no home inside /subvol if you do ls right?

pastel oasis
#

yeah

modest hamlet
#

ok, so create an empty home directory there with mkdir /subvol/home

pastel oasis
#

what about i just move it from mnt?

modest hamlet
#

you cant cuz youll have to mount the subvolume there

pastel oasis
#

ah ok

modest hamlet
#

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

pastel oasis
#

ok

#

done

modest hamlet
#

so after creating the home you can mount the subvolume there with mount -o subvolume=/@home /dev/nvme0n1p3 /subvol/home

pastel oasis
modest hamlet
#

alright, now just move the contents of /mnt/home to /subvol/home

#

i imagine theres just your user folder in there so move that

pastel oasis
#

my fans started speeding up

modest hamlet
#

huh

pastel oasis
#

i hope i did it right

modest hamlet
#

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 isaac_sad

pastel oasis
#

it ran

modest hamlet
#

it finished without errors?

pastel oasis
#

i didnt move /mnt/home

#

i moved the contenta

#

contents

modest hamlet
#

and ls /subvol/home gives what?

pastel oasis
#

it says my name

modest hamlet
#

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

pastel oasis
#

everything is in my subvol

#

except boot

modest hamlet
#

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

pastel oasis
#

ok

#

then

#

do i regenerate fstab?

#

i forgot how to do genfstab tho

modest hamlet
#

not yet, first do umount /subvol and umount /mnt

pastel oasis
#

FUUUCK

#

genfstab doesnt exist

modest hamlet
#

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

pastel oasis
#

HELP ME GOOOD

modest hamlet
modest hamlet
pastel oasis
modest hamlet
#

maybe try the opposite order

#

im not usre which depends on which lol

pastel oasis
#

i already umounted /mnt

modest hamlet
#

oh actually first you have to umount /subvol/home

#

since theres something mounted there as well

#

then you can umount /subvol

pastel oasis
#

ok

#

i unmounted

modest hamlet
#

actually wait

#

since you will have to write the fstab manually anyways you just need to mount the first one lol

pastel oasis
#

ok i did

modest hamlet
#

is there blkid in the iso?

#

like can you run that

#

blkid /dev/nvme0n1p3

pastel oasis
#

it says nothing

modest hamlet
#

ok

pastel oasis
#

oh wait

#

its because im on chroot

modest hamlet
#

well the old fstab should already have this info actually

#

just remembered lol

#

do cat /mnt/etc/fstab

pastel oasis
#

there is already an fstab

modest hamlet
#

yeah, cat it so i can see where it will have to be changed

pastel oasis
#

@modest hamlet

oblique copper
#

okay sorry, i was gone
so , how's it going

pastel oasis
#

pretty fine actually

modest hamlet
pastel oasis
#

we are so close i think

oblique copper
#

very epic

modest hamlet
#

ok, in the first line, after "defaults", add ,subvol=/@

pastel oasis
#

and copy that line

#

and do the same for home right?

modest hamlet
#

yup

#

should be just that

#

mine is way more complicated for some reason lol

#

ig genfstab does some weird stuff

oblique copper
pastel oasis
#

@modest hamlet

modest hamlet
#

oh wait i just realized

pastel oasis
modest hamlet
#

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

pastel oasis
#

do i beroot?

modest hamlet
#

yeah just save and reboot

oblique copper
pastel oasis
#

fuck

modest hamlet
#

oh no

oblique copper
#

oh oh

modest hamlet
#

what happened?

pastel oasis
#

idk

#

i saved and rebooted

modest hamlet
pastel oasis
oblique copper
#

you did btrfs subvol create /@ right?
was / the partition you want to subvol?

modest hamlet
oblique copper
# pastel oasis

oh yeah, regenerate grub config to make grub realize that /boot is actually at /@/boot

modest hamlet
#

bootloaders are my mortal enemies

pastel oasis
#

ahhhh

#

fucckkkk

oblique copper
#

i usually put my bootloader in ESP so i can avoid problems

pastel oasis
#

how do i regenerate grub conf

oblique copper
#

in your live session

#

chroot
then grub-mkconfig -o /path/to/grub/config

pastel oasis
#

fuccckk

modest hamlet
#

well i know you'll have to mount it again and chroot

pastel oasis
#

i hope i can fix this today

#

i chrooted

modest hamlet
#

its so close

oblique copper
#

also show me ls /boot in the chroot

pastel oasis
oblique copper
#

and just to be safe, let's run grub-install again

pastel oasis
#

oops

#

sorry

#

i found the cause i think

oblique copper
#
grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB

subtitue esp to where you mount your EFI partition

pastel oasis
#

im about to cry

oblique copper
#

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

pastel oasis
#

wait wtf

#

there is stuff in /boot even tho i havent mounted my boot partition

#

@modest hamlet

#

help please

modest hamlet
#

huh

oblique copper
#

/boot isn't always a partition

pastel oasis
#

yeah you heard me right

modest hamlet
#

um

pastel oasis
#

oh wait

#

i know

#

fuck im dumb

oblique copper
pastel oasis
#

ok

#

it still throwing me the same errors

oblique copper
#

just run grub-install and grub-mkconfig as per my instruction

pastel oasis
#

what the actual fuck is going on here?

#

@modest hamlet

#

do you know?

oblique copper
#

this is the chroot right?

pastel oasis
#

yes

#

guys

#

im about to fucking cry right here

#

im so sad

oblique copper
#

compose yourself

pastel oasis
#

sorry

oblique copper
#

can you lsblk outside of the chroot

pastel oasis
#

im emotional

#

yes

#

:(((

oblique copper
#

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

pastel oasis
#

i dont even know man

oblique copper
#

well, let me see lsblk when you're outside chroot

pastel oasis
#

oh

#

there is a chroot for void linux

#

YOOOOO

#

its working

#

i updated grub

#

lemme reboot

oblique copper
#

wait

#

did you mount /mnt/boot/efi before chrooting?

pastel oasis
#

yes

oblique copper
#

okay good

pastel oasis
#

it gave me the same error while booting

#

lemme try the thing u said

oblique copper
#

you haven't? damn

modest hamlet
#

you did grub-install and then grub-mkconf?

pastel oasis
#

this is an emotional rollercoaster

modest hamlet
#

oh

pastel oasis
#

no

#

i just typed in update-grub

#

YooOOo

#

PMGMFMMG

#

YSGSGHSGDHS

modest hamlet
#

it booted?

pastel oasis
#

yeah

#

but

#

with problems

modest hamlet
#

oh

#

like what

pastel oasis
#

not seeing home

#

THE FUXK

oblique copper
#

well, that just means we need to fix fstab

pastel oasis
#

My hone direxotry

#

;(

oblique copper
#

before we do that

pastel oasis
#

ok lets try

oblique copper
#

run sudo btrfs subvol list /

pastel oasis
#

can you show me your fstab please?

oblique copper
#

i need to verify this
and my fstab won't help

pastel oasis
#

there is @ and @home

pastel oasis
oblique copper
modest hamlet
#

maybe adding the subvolid would help, i remember having just the subvol being a bit weird sometimes

pastel oasis
#

@oblique copper

#

im on my phone

oblique copper
pastel oasis
#

there is nothing called defaults there

#

@modest hamlet

oblique copper
#

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

pastel oasis
#

YOOOO

#

when i deleted defaults

#

it fixed itself

modest hamlet
#

oh the problem is there was no comma

pastel oasis
#

ty guys

#

omggg

#

wait

#

really?

#

im gonna try with a comma then

modest hamlet
#

it should be defaults,subvol=

oblique copper
#

yeah
different mount options are seperated by commas

modest hamlet
#

thats why deleting defaults fixed it

pastel oasis
#

letss goooo

modest hamlet
#

niceee

#

so there were no problems now?

pastel oasis
#

Thank you so much guys

modest hamlet
#

np PI_thumbsup3

pastel oasis
#

this was an emotional rollercoaster

modest hamlet
#

alright i think you have to put [SOLVED] in the title now

pastel oasis
#

im so happy

modest hamlet
pastel oasis
#

thamk you guys

oblique copper
#

yeah

Switching up subvol for root requires a lot of prerequisite knowledge

pastel oasis
#

couldnt have done it without you

oblique copper
#

well, glad you solved it

pastel oasis
#

ah

#

i think someone needs to pin this thread or something

#

Creating subvolumes on btrfs. [SOLVED]

modest hamlet
pastel oasis
#

im gonna give yall some thank you cookies @oblique copper

meager domeBOT
#

Curvy Linux User received a thank you cookie!

pastel oasis
#

thank you @oblique copper

meager domeBOT
#

You're thanking too much ó_ò

pastel oasis
#

wait

#

thank you @modest hamlet

meager domeBOT
#

You're thanking too much ó_ò