How can I control the storage path of a snap?

I’m trying to install bitcoin-core. It’s approximately 300GB.

I only have an 80GB SSD, but I have a 1TB drive mounted.

I’ve tried installing it with --classic and then symlinking the ~/snap/bitcoin-core folders to the HDD, but this didn’t work.

What are my options?

snap packages themselves live in /var/lib/snapd and store their non-user-specific data in /var/snap …

snap uses apparmor for the security confinement, apparmor does not deal with cross-disk symlinks … but you can use bind mounts … so copy the contents of /var/snap and /var/lib/snapd to the big disk and create bind mounts to the real /var/snap and /var/lib/snapd dirs … (the same also works with ~/snap but you need to make sure to get the user permissios right at the endpoint of the bind mount)

1 Like