I have "only" a 64 Gigabyte root partition, /
, hence implicitly the /var
dir is on this partition, and so is snap's multi-GB subdir /var/lib/snapd/snaps
. Snap stores the snap images in this directory. This takes quite some disk space.
I have freshly installed these snaps: boxy-svg, core, core18, core20, core22, eclipse, fx, gnome-3-34-1804, gnome-3-38-2004, go, gtk-common-themes, inkscape, minizinc, postman, powershell, rustup, slack, snapd, tidy, youtube-dl, zoom-client
, and they already need 2,7G for a single-instance install. For backups this will increase to 10 GB quickly, because snap stores images of the 2 previous images too, in the long run.
I want to move these 10 GB on /var/lib/snapd/snaps
to a different partition, on a different SSD. How can I do that properly?
I've tried by
- just by stopping snapd with
sysctl
, - move
/var/lib/snapd/snaps
to a different partition - symlinking to that partition
ln -s /mnt/big-disk/snaps /var/lib/snapd/snaps
1, restart snapd
However, this construct does not "survive" reboots (snaps cannot be mounted during startup), and also the snaps cannot be updated easily. As a workaround I've tried scripting commands such as
mount /var/lib/snapd/snaps/inkscape_10426.snap /snap/inkscape/10426
(with /var/lib/snapd/snaps/
being a symlink),
but these are a nightmare to maintain, because the release ids such as 10426
always change.