system mounts /dev/loop0 on /snap/core/3604 and it's 100% full, where is it coming from?

52,591

and it's always 100% full

That is normal. /dev/loopX are virtual devices to mount image files. And they are -read only- so do not get larger or smaller than they are when created.

Those mount points are connected to the snapd service. You will see extra loop devices added for every software you install using "snap". Libreoffice has a snap, VLC has one.

From my system:

rinzwind@schijfwereld:~$ df -H
Filesystem      Size  Used Avail Use% Mounted on
...
/dev/loop0       88M   88M     0 100% /snap/core/3440
/dev/loop2       88M   88M     0 100% /snap/core/3604
/dev/loop1      204M  204M     0 100% /snap/vlc/65
/dev/loop3       88M   88M     0 100% /snap/core/3247
/dev/loop4      121M  121M     0 100% /snap/vlc/4

I have installed VLC from a snap install so I have 2 extra named "vlc". "core" is used for snapd itself. Remove the service and those loop devices disappear with it (sudo apt purge snapd ubuntu-core-launcher squashfs-tools would remove it; but I would leave it as is if I was you).

++++++++++++++++++++++++++ additional info:

maximum@maxipc:~$ systemctl status snap-core-3604.mount

● snap-core-3604.mount - Mount unit for core
   Loaded: loaded (/etc/systemd/system/snap-core-3604.mount; enabled; vendor pre
   Active: active (mounted) since Wed 2017-12-27 15:44:36 EST; 2min 6s ago
    Where: /snap/core/3604
     What: /dev/loop0
  Process: 838 ExecMount=/bin/mount /var/lib/snapd/snaps/core_3604.snap /snap/co

Dec 27 15:44:36 maxipc systemd[1]: Mounting Mount unit for core...
Dec 27 15:44:36 maxipc systemd[1]: Mounted Mount unit for core.
Share:
52,591
Mahmoud Gudarzi
Author by

Mahmoud Gudarzi

Updated on September 18, 2022

Comments

  • Mahmoud Gudarzi
    Mahmoud Gudarzi over 1 year

    looking at df -h, I realized I have this /dev/loop0 mounted on /snap/core/3604 and it's always 100% full :

    root@maxipc:~# df -h
    Filesystem      Size  Used Avail Use% Mounted on
    udev            7.8G     0  7.8G   0% /dev
    tmpfs           1.6G  9.9M  1.6G   1% /run
    /dev/sda3       116G   38G   73G  35% /
    tmpfs           7.8G   20M  7.8G   1% /dev/shm
    tmpfs           5.0M  4.0K  5.0M   1% /run/lock
    tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
    /dev/loop0       84M   84M     0 100% /snap/core/3604
    /dev/sda1       239M  111M  111M  50% /boot
    cgmfs           100K     0  100K   0% /run/cgmanager/fs
    tmpfs           1.6G   44K  1.6G   1% /run/user/1000
    

    When I do a umount /snap/core/3604orumount /dev/loop0 it will unmount so it's apparently not busy at all(also when i try to remount /dev/loop0 again, it doesnt remount because, of course, it's not in fstab. in it, it looks like there is a whole little, cute and tiny root filesystem squashed in that 84M:

    root@maxipc:~# ls -la /snap/core/3604
    total 4
    drwxr-xr-x 24 root root  333 Nov 30 12:39 .
    drwxr-xr-x  3 root root 4096 Dec 26 20:29 ..
    drwxr-xr-x  2 root root 1937 Nov 30 12:38 bin
    drwxr-xr-x  6 root root  129 Nov 30 12:38 boot
    drwxr-xr-x  4 root root 1160 Nov 30 12:38 dev
    drwxr-xr-x 80 root root 2399 Nov 30 12:38 etc
    drwxr-xr-x  2 root root    3 Apr 12  2016 home
    drwxr-xr-x 20 root root  406 Nov 30 12:38 lib
    drwxr-xr-x  2 root root   43 Nov 30 12:38 lib64
    drwxr-xr-x  2 root root    3 Nov 30 12:35 media
    drwxr-xr-x  3 root root   45 Nov 30 12:39 meta
    drwxr-xr-x  2 root root    3 Nov 30 12:35 mnt
    drwxr-xr-x  2 root root    3 Nov 30 12:35 opt
    drwxr-xr-x  2 root root    3 Apr 12  2016 proc
    drwx------  2 root root   46 Nov 30 12:38 root
    drwxr-xr-x  8 root root  115 Nov 30 12:38 run
    drwxr-xr-x  2 root root 2349 Nov 30 12:38 sbin
    drwxr-xr-x  2 root root   58 Nov 30 12:39 snap
    drwxr-xr-x  2 root root    3 Nov 30 12:35 srv
    drwxr-xr-x  2 root root    3 Feb  5  2016 sys
    drwxrwxrwt  2 root root    3 Nov 30 12:37 tmp
    drwxr-xr-x 11 root root  151 Nov 30 12:38 usr
    drwxr-xr-x 12 root root  172 Nov 30 12:38 var
    drwxr-xr-x  2 root root    3 Nov 30 12:36 writable
    

    and when I try to do a fuser -m /snap/core/3604 to see who uses the mount, nothing shows up. it reappears every single boot, and I don't know how the heck it's coming up, oh also, there is no sign of it in /etc/fstab. it's also squashfs file system. it looks like it's harmless but I just wanna know why it does what it does. what is it? any help/reply would be appreciated.

    Thank you in advance,

    MG

    ps: I thought this question is different because the loop device is mounted as if it is an primary and working filesystem eventhough it's not busy at all. it gets umounted everytime if you want to, but it shows up again after boot. usually loop devices come up by df -H but for me this loop device comes up even among things that gnome graphical tools show, just like how a hardrive shows in your nautilus.