Btrfs, subvolumes, external disk, schnapps

I have an Omnia with Turris OS 6.2.2. I have mounted an internal 500 GB SSD disk. This disk is encrypted with LVM on LUKS and a single logical volume formatted with BTRFS. By adding a hotplug script, making the right changes to /etc/cryptotab and /etc/config/fstab, adding a keyfile for decryption, and entering the relevant UUID in /etc/config/storage, the disk is mounted at boot, decrypted without human intervention, and used as /srv (as if I had used the storage plugin from reForis). The thing is, the partition I created and mounted on /srv is not a subvolume and I cannot take snapshots. Does the storage plugin automatically create a subvolume? How can I do this manually, moving the data I currently have in the main volume to the subvolume? And how do I mount the subvolume as /srv?

You basically need to have /srv mounted on /@ subvolume. If you would use storage plugin for preparing the drive it would do it for you automatically. So your options are backup data reformat with storage plugin and restore data.

Or create /@ subvolume on your drive and move data the and mount it like that:

root@ap:~# mount | grep sda
/dev/sda2 on /srv type btrfs (rw,noatime,space_cache,subvolid=724,subvol
=/@)

Thanks, I’ll try it now. I can’t use the plugin, because it doesn’t see the encryption, it formats everything and makes it unencrypted.

You should ommit subvolid in mount options if you specify subvol=/@ it will pick the right id when mounting

btrfs subvolume snapshot /mnt/yourdisk /mnt/yourdisk/@

1 Like

Do you mind sharing your hotplug script to have encrypted storage?

I got everything from here.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.