You are not logged in.
Hello, thanks for your time!
I want to install Devuan on a BTRFS partition with subvolumes "@" and "@home"
What are the steps? With which "iso"?
any ideas?
Last edited by Cosque (2018-06-24 17:03:01)
Offline
I don't like the @ naming convention for subvolumes as the @ has to be escaped in shell. Instead I give these directories the .subvol extension.
Choose expert install, proceed up to and including partitioning. Finish partitioning normally, choosing luks,lvm,btrfs or whatever. Then:
- go to another terminal (alt+f2)
- find the btrfs filesystem device in output of # mount (in my case it is at /dev/vg_devuan/main)
- # mkdir /tmp/target
- # cp -ar /target/* /tmp/target
- # umount /target
- (Add --mixed if device is under 5 GB or so) # mkfs.btrfs -f /dev/vg_devuan/main
- # mkdir /rv
- # mount -o noatime,compress=lzo,nossd,autodefrag,space_cache=v2 /dev/vg_devuan/main /rv
- # btrfs subvol create /rv/devuan/root.subvol
- # mount -o noatime,compress=lzo,nossd,autodefrag,subvol=/devuan/root.subvol /dev/path/to/btrfs/device /target
- # cp -ar /tmp/target/* /target
- (optional, if you are low on RAM) # rm -r /tmp/target
Now go back to the installer and proceed at the "Install base system" step. This is does not happen any more.
Disregard the above, it results in the "Install base system" hitting
"Error: apt or in-target already running" and I do not know how to resolve it.
So, just complete the install normally, without compression or subvolumes,
we'll deal with that later.
Complete the install and reboot. When it reboots, login as root only and do the following:
- # mkdir /rv
Edit /etc/fstab, and change it to resemble the following (Note: the nossd flag is there because the ssd allocator has some issues on kernels <4.15 or some such):
/etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/vg_devuan-main / btrfs defaults,nossd,compress=lzo,noatime,subvol=/devuan/root.subvol 0 0
/dev/mapper/vg_devuan-main /home btrfs defaults,nossd,compress=lzo,noatime,subvol=/devuan/home.subvol 0 0
/dev/mapper/vg_devuan-main /rv btrfs defaults,nossd,compress=lzo,noatime,subvolid=5 0 0
tmpfs /tmp tmpfs defaults 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
The /tmp line is optional.
- # mount /rv
- # btrfs subvol create /rv/devuan/home.subvol
- # cp -ar --reflink=always /rv/devuan/root.subvol/home/* /rv/devuan/home.subvol
Remember the --reflink=always parameter, it makes cp do a shallow copy on btrfs (same files underneath, copy on change). You might want to put that into bashrc as an alias: alias cpref="cp --reflink=always.
- # rm -r /home/*
- # mount /home
Reboot for the new mount flags to take to effect. Now it should work as intended and the output of # mount should reflect that.
EDIT 2020.05.10: Changed 16GB->5GB to be in line with btrfs recommendations. Added space_cache=v2. Changed rootfs.subvol to just root.subvol
Note: if you get stuck on the first boot, ctrl-c will unstuck it and land you at login. If you further cannot remount / rw, then also specify the device on the command line. Seems to happen if no lvm/luks is used, as the above reformat step will change UUID.
I will amend this post with further fixes, should any problems arise.
Last edited by specing (2020-05-10 14:34:21)
Offline
ahoy specing,
thanks for the detailed tutorial on getting Btrfs+subvolumes installed. i am trying to use an existing Btrfs partition and subvolumes (described in more detail here https://dev1galaxy.org/viewtopic.php?pid=19401#p19401) but am having problems with the step
Choose expert install, proceed up to and including partitioning. Finish partitioning normally, choosing luks,lvm,btrfs or whatever.
when i get to the partitioning step in the netinst expert mode installer, i cannot find a way to select a root partition that allows that step to complete without (seemingly) the installer overwriting my Btrfs partition. my disk only has 2 partitions:
/dev/sda1 GRUB BIOS boot partition (for booting GPT disk with BIOS)
/dev/sda2 LUKS1 dm encrypted Btrfs partition (remainder of disk)
thus has something changed in the latest installer for ASCII stable 2.1 that changes your instructions? or am i missing some simple step implied in your tutorial (this is my first experience with the Debian/Devuan installer)?
thanks again for your help, w
Offline
I just install a standard system, back it up then create the subvolume layout as desired and rsync the backup to the new layout.
The fstab and bootloader need correcting afterwards but it works:
empty@E485:~ $ grep '/ ' /proc/self/mounts
/dev/nvme0n1p3 / btrfs rw,relatime,ssd,space_cache,subvolid=257,subvol=/debian 0 0
empty@E485:~ $
Brianna Ghey — Rest In Power
Offline
I just install a standard system, back it up then create the subvolume layout as desired and rsync the backup to the new layout.
The fstab and bootloader need correcting afterwards but it works:
empty@E485:~ $ grep '/ ' /proc/self/mounts /dev/nvme0n1p3 / btrfs rw,relatime,ssd,space_cache,subvolid=257,subvol=/debian 0 0 empty@E485:~ $
thank you, i was considering this too. however unfortunately in this HDD i do not have any extra partitions to which i can do a temp install. though can we install to an external USB partition?
also i am still hoping for something a little less convoluted
thanks again, w
Offline
unfortunately in this HDD i do not have any extra partitions to which i can do a temp install. though can we install to an external USB partition?
Install to the HDD and use the USB to hold the backup, that's what I do.
Brianna Ghey — Rest In Power
Offline
waynedpj wrote:unfortunately in this HDD i do not have any extra partitions to which i can do a temp install. though can we install to an external USB partition?
Install to the HDD and use the USB to hold the backup, that's what I do.
thanks again, maybe i will end up having to do this if neither installer can be made to work with Btrfs subvolumes. so you just rsync everything from / and /home to the respective subvolumes? and i assume then update fstab, cryptab, and GRUB?
thanks, w
Offline
so you just rsync everything from / and /home to the respective subvolumes?
Yes, I use this method to create a full backup then reverse the process when the subvolumes are created and mounted as desired.
and i assume then update fstab, cryptab, and GRUB?
I don't use encryption[1] so just the fstab and bootloader need correcting. I use a custom grub.cfg but grub-mkconfig can deal with subvolumes and appears to create a working configuration file.
[1] I don't keep anything important on computers and in my country (the UK) I can go to jail if the Police want to see what's on it and I can't remember the password.
Brianna Ghey — Rest In Power
Offline
Yes, I use this method to create a full backup then reverse the process when the subvolumes are created and mounted as desired.
thanks, handy method, nice and simple.
waynedpj wrote:and i assume then update fstab, cryptab, and GRUB?
I don't use encryption[1] so just the fstab and bootloader need correcting. I use a custom grub.cfg but grub-mkconfig can deal with subvolumes and appears to create a working configuration file.
unfortunately thus far with the refractainstaller it seems like something GRUB-related is not working as it is not opening the encrypted partition and finding the initramfs even though it accesses the encrypted /boot (details https://dev1galaxy.org/viewtopic.php?pid=19493#p19493).
[1] I don't keep anything important on computers and in my country (the UK) I can go to jail if the Police want to see what's on it and I can't remember the password.
i imagine that unfortunately this can happen in pretty much any country no matter what the law says
thanks again, w
Offline
unfortunately thus far with the refractainstaller it seems like something GRUB-related is not working as it is not opening the encrypted partition and finding the initramfs even though it accesses the encrypted /boot (details https://dev1galaxy.org/viewtopic.php?pid=19493#p19493).
just to update this thread: i was able to get Devuan installed to my existing encrypted partition with Btrfs subvolumes, details in my thread https://dev1galaxy.org/viewtopic.php?pid=19578#p19578. thanks again for the help here.
peace, w
Offline
...
Cool. My instructions were for making an entirely new install, I have not yet concerned myself with multiple distros on same btrfs (outside LXC).
If the installer does not let you proceed without creating anything on disk, then my first reaction would be to give it a USB stick or another disk (easy with qemu) to play on. Then change /target before starting installation.
Last edited by specing (2020-05-10 10:47:07)
Offline