4

when I type df -h to see the storage of my system the following is the result

root@kch-rsp:/home/pi# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs           13G  2.4G   10G  20% /
/dev/root        13G  2.4G   10G  20% /
devtmpfs        215M     0  215M   0% /dev
tmpfs            44M  228K   44M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            88M     0   88M   0% /run/shm
/dev/mmcblk0p5   60M  9.4M   50M  16% /boot

there are several questions about this result:

  1. why are there multiple tmpfs? I know that this is a swap space but when I executed swapon -s, I only see one swap space.

    root@kch-rsp:/home/pi# swapon -s
    Filename                                Type            Size    Used    Priority
    /var/swap                               file            102396  0       -1
    
  2. the rootfs and /dev/root looks like to be indicating the same thing but why express them as these two entries?

  • do findmnt for more info. – mikeserv Aug 27 '14 at 7:14
  • I do not see how tmpfs and swap space are related? The swap space is on a partition normally, but without a filesystem, and not mounted. – Volker Siegel Aug 27 '14 at 7:15
  • @VolkerSiegel then from my output, why are there three tmpfs? does it mean that there are three tmpfs swap files that are mounted to three different directories? – kwagjj Aug 27 '14 at 7:19
  • There is some relation in that the content of a tmpfs can get written to swap space like other data, which is not possible for the simpler ramfs. – Volker Siegel Aug 27 '14 at 7:20
  • 1
    It means there are three tmpfs file systems mounted into three directories. That has nothing to do with which swap files exist. – Volker Siegel Aug 27 '14 at 7:22
4

There is already a good answer in a comment by Volker Siegel related to tmpfs:

It means there are three tmpfs file systems mounted into three directories. That has nothing to do with which swap files exist.

I can add a reference explaining the rootfs issue.

ramfs, rootfs and initramfs
October 17, 2005
Rob Landley 
=============================
...
What is rootfs?
---------------
Rootfs is a special instance of ramfs (or tmpfs, if that's enabled), which is
always present in 2.6 systems.  You can't unmount rootfs for approximately the
same reason you can't kill the init process; ...

Most systems just mount another filesystem over rootfs and ignore it.  The
amount of space an empty instance of ramfs takes up is tiny.
...

https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt

Take a look at the "What is initramfs?" section in the same document to get some information on how the system uses rootfs.

  • But how do I distinguish which tmpfs is which? Sometimes they mean the same actual tmpfs. When you create a file in one of them, the USED space increases in another. – Artem Novikov Apr 18 '18 at 13:21

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.