Changing ISO BTRFS subvolumes

Is it possible to change the subvolumes calamares creates during installation? I found a subvolume list in /etc/calamares/modules/mount.conf, but after adding my own desired subvolumes, the installer crashes when it comes to creating the subvolumes:

Create subvolume '/tmp/calamares-root-uk0o_soq/@'
Create subvolume '/tmp/calamares-root-uk0o_soq/@home'
Create subvolume '/tmp/calamares-root-uk0o_soq/@cache'
Create subvolume '/tmp/calamares-root-uk0o_soq/@log'
Create subvolume '/tmp/calamares-root-uk0o_soq/@crash'
Create subvolume '/tmp/calamares-root-uk0o_soq/@spool'
Python Error:
 <class 'KeyError'> 
 ('subvolume',) 
 File "/usr/lib/calamares/modules/mount/main.py", line 165, in run
    mount_partition(root_mount_point, partition, partitions)

  File "/usr/lib/calamares/modules/mount/main.py", line 115, in mount_partition
    root_mount_point + s['subvolume']]) 

Is there a better way of creating more subvolumes that I’m not thinking of?

It looks like there is an error in the mount.conf file. The format isn’t very forgiving.

Can we see the file you are trying to use?

Yes, you need to change mount.conf in /etc…

for example:

sudo nano /etc/calamares/modules/mount.conf
Add these to the end of the file:
-mountPoint: /.snapshots
subvolume: /@snapshots

Here it worked, that’s all I did to get @snapshots created, it also added an entry automatically to fstab

$ sudo btrfs subvolume list /
ID 256 gen 3425 top level 5 path @
ID 257 gen 3428 top level 5 path @home
ID 258 gen 3365 top level 5 path @cache
ID 259 gen 3426 top level 5 path @log
ID 260 gen 3395 top level 5 path @snapshots

fstab
UUID=81e1d399-1f9c-45d6-b4c4-7a8992bfb5e5 /.snapshots    btrfs   subvol=/@snapshots,defaults,noatime,space_cache,autodefrag,compress=lzo 0 0
1 Like

So I changed the btrfsSubvolumes to this:

btrfsSubvolumes:
    - mountPoint: /
      subvolume: /@
    - mountPoint: /home
      subvolume: /@home
    - mountPoint: /var/cache
      subvolume: /@cache
    - mountPoint: /var/log
      subvolume: /@log
    - mountPoint: /var/crash
      subvolume: /@crash
    - mountPoint: /var/spool
      subvolume: /@spool
    - mountPoint: /var/lib/docker
      subolume: /@docker
    - mountPoint: /var/lib/containers
      subvolume: /@containers
    - mountPoint: /var/tmp
      subvolume: /@var-tmp
    - mountPoint: /.swap
      subolvume: /@swap
    - mountPoint: /boot
      subolvume: /@boot

The installer crashed when it got to creating @docker.

Yes, that would crash.

You spelled subvolume wrong on several of those lines. :wink:

3 Likes

Well I feel dumb. I looked it over and my brain skipped right over that haha.

2 Likes

It doesn’t seem to like creating a subvolume called @swap, it seems that when you pick the option to create a swapfile the installer does that. Everything completed successfully when I took @swap out of the .conf. Thanks!

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