I did not like the way Turris Omnia uses ‘@‘ as subvolume for /srv since that’s conventionally used for root, so I wanted to move it to ‘@srv‘ instead.

Assuming you have your drive already set up, we first gotta check what is using ‘/srv‘ currently:

# lsof /srv

COMMAND    PID      USER FD   TYPE DEVICE SIZE/OFF NODE NAME
syslog-ng 7526      root 17w   REG   0,39   330310  349 /srv/log/messages
syncthing 8374 syncthing  3w   REG   0,39   174833  260 /srv/syncthing/syncthing.log
syncthing 9191 syncthing  3r   REG   0,39        0  504 /srv/syncthing/syncthing.lock
syncthing 9191 syncthing  6u   REG   0,39        0  268 /srv/syncthing/index-v0.14.0.db/LOCK
syncthing 9191 syncthing  7w   REG   0,39     3739  269 /srv/syncthing/index-v0.14.0.db/LOG
syncthing 9191 syncthing  8w   REG   0,39     1149  506 /srv/syncthing/index-v0.14.0.db/000013.log
syncthing 9191 syncthing  9w   REG   0,39      427  507 /srv/syncthing/index-v0.14.0.db/MANIFEST-000014
syncthing 9191 syncthing 10r   REG   0,39     1630  505 /srv/syncthing/index-v0.14.0.db/000012.ldb
syncthing 9191 syncthing 11r   REG   0,39     7354  348 /srv/syncthing/index-v0.14.0.db/000011.ldb

Ok, so we gotta stop what’s running there so that we can unmount it and do our operation.

service syncthing stop
service syslog-ng stop
uci set storage.srv.syslog=0
uci commit storage
killall syslog-ng

You can run lsof /srv again to verify nothing is accessing it anymore before we continue.

Now that nothing is using /srv anymore, we can unmount it, mount the root, rename the subvolume, unmount, adapt the config and reboot, like this:

umount /srv
mount /dev/sda /mnt
mv /mnt/@ /mnt/@srv
umount /mnt
uci set storage.srv.subvolume=@srv
uci set storage.srv.syslog=1
uci commit storage
reboot

Now after reboot you can SSH into it again and verify like this:

# mount | grep srv
/dev/sda on /srv type btrfs (rw,noatime,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@srv)

That’s really all there is to it! I hope this helped you out. Consider donating a coffee! *twitches*

– Sin