I was reading through the man page for mount today, and noticed in the section about using the loop device that it's recommended to make /etc/mtab a symlink to /proc/mounts in order for umount to automatically free loop devices. Now I shut down every night and rarely use the loop device, but I'm also somewhat pedantic and would rather have things just right.
Now /proc/mounts is a symlink to /proc/self/mounts, so to follow the mount man page recommendation properly /etc/mtab should point there instead, but on examining the contents of both those files there are several minor differences:
Code:
bash-3.00# cat /etc/mtab
/dev/hda3 / reiserfs rw 0 0
/dev/hda5 /home reiserfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
and
Code:
bash-3.00# cat /proc/self/mounts
rootfs / rootfs rw 0 0
/dev/root / reiserfs rw 0 0
/dev/hda5 /home reiserfs rw 0 0
devpts /dev/pts devpts rw 0 0
proc /proc proc rw,nodiratime 0 0
sysfs /sys sysfs rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
Despite the differences (which suggests two different processes each acting on one of the files), is it still ok to change /etc/mtab to be a symlink, or is this not recommended (other than by the mount man page)? Or is there a way to remove /etc/mtab altogether (since the existence of /proc/self/mounts makes it redundant and it doesn't make sense to have it in /etc anyway)?