1

I'm studing the use of df, when i tried it on centos 7 on my virtualBox, i got this :

df -h 
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 1.9G     0  1.9G   0% /dev
tmpfs                    1.9G     0  1.9G   0% /dev/shm
tmpfs                    1.9G  9.6M  1.9G   1% /run
tmpfs                    1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/mapper/centos-root  8.0G  5.3G  2.8G  66% /
/dev/sda1               1014M  239M  776M  24% /boot
tmpfs                    379M   24K  379M   1% /run/user/1000

i don't understand from where all this space came from, because i have only 10G when i first created this VM, and 4G for the RAM, and in the configuration of the VM i get this :

enter image description here

Information when i click in storage  : 
type : Normal (VDI)
virtual size : 10G
reel size : 4.86
details : storage of differentiation
Emplacement : ...
attached to : centos (install snapshot)
2
  • 2
    tmpfs filesystems are virtual; see man tmpfs for a full explanation. Feb 6 at 2:33
  • @ajgringo619 thank you for your response, i did a little search about it, i found it's a virtual space used for swap, so i should have maximum 4G of RAM and 10 G of storage i configured at the creation and not 17 G like it shows
    – adil
    Feb 6 at 2:39

1 Answer 1

2

df shows all mounted filesystems, which include tmpfs virtual filesystems that reside in memory.

From your df output you have just two filesystems saved on disk:

  • 1 GB /boot on sda1 partition
  • 8 GB / on centos-root logical volume

The remaining 1 GB from your disk is most likely used for swap which is not shown in df output (you can use lsblk to list block devices on your system, it will show swap too).

The content of remaining mountpoints you see (/dev, /run...) is stored in memory. These are special folders created dynamically by the OS (for example /dev contains special files that represent block and character devices in your system). RAM for these is allocated dynamically when needed, these don't actually take 2 GB of RAM each, the size is just an upper limit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.