0

I am in a dilemma and want to confirm whether the size of loopback devices is considered while calculation disk size using df -h command.

Here is the output of my df -h command.

Filesystem                          Size  Used Avail Use% Mounted on
udev                                7.8G     0  7.8G   0% /dev
tmpfs                               1.6G  3.4M  1.6G   1% /run
/dev/sda1                           902G  204G  652G  24% /
tmpfs                               7.8G     0  7.8G   0% /dev/shm
tmpfs                               5.0M  4.0K  5.0M   1% /run/lock
tmpfs                               7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/loop0                          128K  128K     0 100% /snap/hello-world/27
/dev/loop1                           94M   94M     0 100% /snap/bcompare/114
/dev/loop2                          128K  128K     0 100% /snap/hello-world/29
/dev/loop3                          164M  164M     0 100% /snap/spotify/41
/dev/loop13                          27M   27M     0 100% /snap/taskbook/23
/dev/loop11                          68M   68M     0 100% /snap/sublime-text/85
/dev/loop14                          68M   68M     0 100% /snap/sublime-text/77
/dev/loop12                          94M   94M     0 100% /snap/bcompare/115
/dev/loop10                         182M  182M     0 100% /snap/spotify/36
tmpfs                               1.6G   36K  1.6G   1% /run/user/1000
//qvsfilestore/builds_mobile         19T   11T  8.1T  57% /mnt/builds_mobile

As I can see that my total Used space is 204G , but I want to know whether this includes the sizes of the loopback devices or whether the actual Used space on my machine is 204G + (Sum of all loopback devices).

Krishna Oza
  • 101
  • 3
  • Loopback devices take zero space on disk, and are unrelated to your disk space -- they are separate devices. The files (snaps) that are mounted upon those loopback devices do take up space on disk, and those files are included in the 204G – user535733 May 20 '20 at 10:36
  • @user535733 okay and what does their size in `Size` column indicates , is it that their initial size which is shown in size column is already added in the `Used` column i.e. 204 G in current case. – Krishna Oza May 20 '20 at 10:53
  • Well, that's a separate question. A snap on disk is a squashfs read-only file. The device listing shows the squashfs plus writable bits usage in RAM. Amount of RAM used may be very different from the amount of disk space used. – user535733 May 20 '20 at 11:03
  • @user535733 any reference you can share where I could read up more on this. – Krishna Oza May 20 '20 at 11:06
  • Does this answer your question? [Prevent du command report inflated info about /snap directories](https://askubuntu.com/questions/1233922/prevent-du-command-report-inflated-info-about-snap-directories) – N0rbert May 20 '20 at 12:52

0 Answers0