How to configure /etc/config/storage (or other config file) to mount subvolume of SSD (I have whole system running from SSD) as /srv?
When /srv is placed directly on root of SSD (@ subvolume) I have problems with snapshots (I ran out of space today, had to remove some snapshots).
I’ve modified /etc/init.d/srv to accept subvolume option in /etc/config/storage
patch
--- srv.orig 2019-09-26 01:24:28.000000000 +0200
+++ srv 2019-10-05 11:51:39.916782285 +0200
@@ -40,12 +40,18 @@
mkdir -p /srv
fi
+ # Other subvolume?
+ config_get SUBVOL srv subvolume
+ if [ -z "${SUBVOL}" ]; then
+ SUBVOL='@'
+ fi
+
# Mount it
if [ "$(blkid "$DEV" -s TYPE -o value)" = ext4 ]; then
mount -t ext4 -o noatime "$DEV" /srv || die "Can't mount $DEV as /srv"
create_notification -n error "Your srv is ext4, you should convert to btrfs to enjoy all features"
else
- mount -t btrfs -o subvol=@,noatime "$DEV" /srv || die "Can't mount $DEV as /srv"
+ mount -t btrfs -o subvol=${SUBVOL},noatime "$DEV" /srv || die "Can't mount $DEV as /srv"
fi
# Find root device
Please, do that for me. Ownership is not required.
I assume that You have this file somewhere on Your gitlab and I have no account there (and do not need another account:).