In Scientific Linux 6, a clone of RHEL6, I have the following mtab file:
/dev/sda2 / ext4 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs rw,rootcontext="system_u:object_r:tmpfs_t:s0" 0 0
/dev/sda1 /boot ext4 rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
/tmp /tmp none rw,bind 0 0
/var/tmp /var/tmp none rw,bind 0 0
/home /home none rw,bind 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
gvfs-fuse-daemon /root/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev 0 0
the content of fstab is
enter code here
#
# /etc/fstab
# Created by anaconda on Tue Apr 21 14:07:48 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=ce58d311-5f32-4da6-9f96-ca9353dc421c / ext4 defaults 1 1
UUID=1e4e79e3-3317-4c50-8880-c25d6a03f4a4 /boot ext4 defaults 1 2
UUID=eec379ab-8116-46ef-b93b-9bdcd0ab65e2 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
and the output of mount command is:
/dev/sda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/tmp on /tmp type none (rw,bind)
/var/tmp on /var/tmp type none (rw,bind)
/home on /home type none (rw,bind)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
Why /tmp is bound on /tmp ? (also /home on /home, /var/tmp on /var/tmp)
How can I remove this bound and put /tmp as common directory under / ?
I need this because I have an old executable which use the instruction rename and it give me the following error
EXDEV oldpath and newpath are not on the same mounted file system. (Linux permits a file system to be mounted at multiple points, but rename() does not work across different mount points, even if the same file system is mounted on both.)
when it try to rename a file with oldpath int /tmp and newpath under a subdirectory of / .