Should I move /snap to a separate hard drive?
-
Don,
I have been doing a refresher on LPIC-1 and LPIC-2. My Linux servers are Ubuntu and Kali now. I have been noticing the /snap directories are 100% filled and usually small. My Linux VMs are on my VMWare 6 stand alone. Usually, I create thin vdisks for them
My Wordpress Webservers
/.boot 2GB
/Var 1TB
/ 25-30 GB of MariaDB 10.6.x, Apache, PHP 8.x
/swap usually same size as ram/dev/loop0 11M 11M 0 100% /snap/canonical-livepatch/102
/dev/loop3 100M 100M 0 100% /snap/core/11420
/dev/loop2 100M 100M 0 100% /snap/core/11316
/dev/loop1 11M 11M 0 100% /snap/canonical-livepatch/104
/dev/loop4 56M 56M 0 100% /snap/core18/2074
/dev/loop6 56M 56M 0 100% /snap/core18/2066
/dev/loop5 68M 68M 0 100% /snap/lxd/20326
/dev/loop7 33M 33M 0 100% /snap/snapd/12704
/dev/loop8 33M 33M 0 100% /snap/snapd/12398
/dev/loop9 71M 71M 0 100% /snap/lxd/21029So four separate vdisks or hard drives in VMWare 6. I have see all the /dev/loop that are for /snap/... I know I can create another hard drive and use other to put in /snap. I was thinking of 2-4 GB for it since it seems to use around 600 MB. I am seeing /snap more and more with Ubuntu 20.04 and Kali for installation packages.
VMWare 6 and LVM don't behave well together. So I don't use LVM. One day, I might replace this HP 360e Gen8 server with a Gen10 server and VMWare 6.7 or 7. It won't support higher than VMWare 6U3 .
-
I wouldn't recommend mounting your snap folder somewhere else unless you sized your root partition too small. The snap directories are not designed to hold data so they tend to be very small. They just hold the application files while the data is stored elsewhere. They are typically very small because the developers know exactly how much space their application needs. For example, if I install the AWS CLI from the Ubuntu repositories, it requires 166MB of space due to all the libraries and dependencies it pulls down with it. However, the "aws-cli" snap is only 18MB. That is why the
/snap
folder is not a separate volume. It is just a subfolder under your root folder and shouldn't be treated any differently than/bin
or/sbin
.All that being said, I am not a fan of snaps and it is one of the first things I remove when installing Ubuntu server.
-
To me, snap is more annoying because you get 10+ entries in DF - H. I didn't think I could remove them safely during install. I thought it was the new method of installing all the extra stuff. I mainly do server installs without GUI. Can Linux run efficiently without snaps?