You are not logged in.
Pages: 1
Outline: So far I have installed Arch myself a couple of times already, always following the path of the awesome beginner's guide. However I have always used the following partition setup (as suggested in the example):
(parted) mkpart primary ext4 somesize // boot
(parted) set 1 boot on
(parted) mkpart primary ext4 somesize // / path
(parted) mkpart primary linux-swap somesize
(parted) mkpart primary ext4 somesize // /home path
This is working fine, as this setup coincides pretty much with how I run things. Now I would like to implement the above with btrfs subvolumes.
Question:
Having read through the corresponding wiki page I would like to know whether the following setup would be correct and if you guys can provide some more inputs on whether this is generally a good idea or hints on how to improve things.
(parted) mkpart primary btrfs somesize
(parted) set 1 boot on
(parted) mkpart primary linux-swap somesize# mkfs.btrfs /dev/partition_btrfs
# mkswap /dev/partition_swap
# swapon /dev/partition_swap# btrfs subvolume create /dev/partition_btrfs/ // / path
# btrfs subvolume create /dev/partition_btrfs/boot // boot
# btrfs subvolume create /dev/partition_btrfs/home // /home path# mount compress=lzo /dev/partition_btrfs/ /mnt
# mkdir /mnt/boot
# mkdir /mnt/home
# mount compress=lzo /dev/partition_btrfs/boot /mnt/boot
# mount compress=lzo /dev/partition_btrfs/home /mnt/home
And from here on proceed as described from "Select a mirror" onwards. Then, in the fstab add the compression entries.
Thanks in advance!
Last edited by robg (2015-08-21 11:16:41)
Offline
Depends on your bootloader. Only grub supports compressed btrfs volumes as boot partition from what I know - I certainly know syslinux does not. I have made a separate partition to boot from in my setup.
Your mount option for the subvolumes is wrong, I believe, you have to state the subvolume via the subvol= mount option
# mount -o compress=lzo,subvol=boot /dev/partition_btrfs /mnt/boot
# mount -o compress=lzo,subvol=home /dev/partition_btrfs /mnt/homeYou should also probably make a root subvolume, so that you can snapshot it more easier. You will have to adjust your kernel parameter in the bootloader though to use "subvol=archroot" or similar.
In my setup I have an "arch_current" subvolume and a couple of "arch_{date}" snapshots. To boot into an earlier state I just change my kernel line to mount one of the snapshots.
Last edited by Soukyuu (2015-08-14 20:48:22)
[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]
Offline
Thanks a lot for the elaborate answer! I am indeed using GRUB and just checked out its wiki entry: Booting from compressed btrfs subvolumes is indeed supported. Great call about the root subvolume and changing between snapshots on booting, that is really slick. According to this adding the subvol option seems to do the trick, just as you suggested. Before I try things out I have one more question: In my code above, I have selected
(parted) mkpart primary btrfs somesize
(parted) set 1 boot one.g. I have set the boot option on the entire btrfs partition. Upon rethinking, this does not seem quite right to me. You have mentioned that you are using a separate boot partition but do you maybe know how to properly select the boot subvolume?
Last edited by robg (2015-08-14 21:38:18)
Offline
To be honest, I have never set my boot flag, the syslinux install script does that for me. I think the grub install script should do it for you too. The boot flag belongs on the partition where you install your bootloader to - so since you only have one btrfs partition with several volumes, it seems logical it's the partition that has to be set as bootable.
Also, as I already mentioned, don't forget to set the subvolume and all the mount options you want to use on your root line. You have to do it in the bootloader, because the mount options currently apply to the whole FS (as described here).
Here is my (syslinux!) entry.
APPEND root=/dev/sda3 rw rootflags=subvol=arch_current,compress=lzo,ssd,noatime,autodefrag[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]
Offline
Once more, thanks a lot for the clarifications!
I've set up my setup along the lines described in this thread and it works flawlessly. "Problem" solved.
Offline
Pages: 1