0

This is my /etc/fstab file on my CentOS6.6 :

/dev/mapper/VolGroup-lv_root    /       ext4    usrjquota=quota.user,jqfmt=vfsv0,noatime,nodiratime,commit=120  1       1
UUID=5fde0497-7901-4de8-9516-f645e4fc9029 /boot                   ext4    defaults        1 2
/dev/mapper/VolGroup-lv_home    /home   ext4    usrjquota=quota.user,jqfmt=vfsv0,noatime,nodiratime,commit=120,data=writeback   1       2
/dev/mapper/VolGroup-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults,nodev,nosuid,noexec        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/usr/tmpDSK             /tmp                    ext3    defaults,noauto,nodev,nosuid,noexec        0 0
/tmp                    /var/tmp                none    rw,noexec,nosuid,nodev,bind     0 0

I know that if you want to mount anything in fstab in the very first section we need to address the device (exp: /dev/sda1) or label (LABEL=/newdisk) or UUID

But i see that in my fstab some lines are without mentioning the device name/UUID or LABEL first. Like: (It is a Cpanel Server)

tmpfs /dev/shm  tmpfs   defaults,nodev,nosuid,noexec        0 0
devpts /dev/pts devpts  gid=5,mode=620  0 0
sysfs /sys sysfs   defaults        0 0
proc /proc proc    defaults        0 0
/usr/tmpDSK /tmp ext3    defaults,noauto,nodev,nosuid,noexec        0 0
/tmp /var/tmp none    rw,noexec,nosuid,nodev,bind     0 0

But we don't have any device name /usr/tmpDSK What about the tmpfs which is mounted on /dev/shm what about proc which is mounted on /proc

How these are mounted without mentioned the device name which they belongs to?

I read many articles on web but i didn't realized how these files are mounted on mount point

Could you please help me understand this?

1 Answer 1

1

Those are special virtual filesystems:

tmpfs is an in-memory special device used specially for temporary files (that's why is used for tmp) More info in http://www.denx.de/wiki/view/DULG/FilesystemTMPFS

proc is a very special filesystem that exposes system configurations, status and more information in filesystem. More info about in http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html

devpts and sysfs are also virtual filesystems used by the kernel, you can search for them if you want to know.

And finally regarding /usr/tmpDSK there's an option noauto so the volume is not mounted.

3
  • Thank you Pablo. But what if i remove noauto? As you see the defaults is mentioned in options which contains auto within it! so will we be able to mount a file on a mountpoint like that?
    – Armin
    Jun 22, 2015 at 13:57
  • You can mount a file as a loopback filesystem, if you really want to do something like that you could do "dd if=/dev/zero of=/usr/tmpDSK bs=1024 count=20000" to create a 20MB file in /usr/tmpDSK, then you can format it with "mkfs.ext3 /usr/tmpDSK" and the you will be able to mount it. That said: DO NOT DO IT :) If you do it, you will mount on top of /tmp and that will cause issues. My bet is that that /tmp line in fstab is there because of legacy reasons, you should just ignore it. Jun 22, 2015 at 15:43
  • Dear Pablo, what do you mean by legacy reasons? But what if i stop php webserver and mysql (services with temp files) and then copy the content of /tmp to a safe place and later mount tmpDSK on top of /tmp and then copy back the old contents of /tmp to their original place?
    – Armin
    Jun 23, 2015 at 5:14

Not the answer you're looking for? Browse other questions tagged .