Repeated mounts

Michael Abbott michael at araneidae.co.uk
Thu Nov 26 08:53:33 UTC 2009


Has nobody else observed this problem?

On Wed, 25 Nov 2009, Michael Abbott wrote:
> Here is something very strange (though I seem to remember a conversation 
> on the subject here recently).  It would appear that every time I run 
> `mount -a` all the entries in /etc/fstab are mounted again!  How is this 
> even possible?

I'd not noticed this behaviour before.  To be honest, I would have 
expected that the kernel would have caused repetitions of the same mount 
command to either fail or overwrite the old mount, erasing the old mount, 
but experimentation tells me that I'm entirely wrong, instead repeated 
mounts appear to nest, with the most recent mount hiding all the earlier 
ones (if they share the same mount point).  Of course it makes sense for 
mounts to nest ... but not on exactly the same mount point.  Sigh.

However, I do observe that other versions of `mount -a` (not busybox) 
*don't* repeat mounts that are already in place.  It wouldn't be possible, 
please, for mount to emulate this behaviour?  Presumably the simplest 
thing would be to simply ignore mount requests on nodes that are already 
mount points?

I'm sure I seem to remember a conversation here on this very topic a few 
months ago, but google isn't helping me find it (alas, I wish google could 
be persuaded to pay attention to punctuation: searching for "-a" is 
futile!)

> 
> busybox version 1.15.2
> kernel version 2.6.26 (maybe a bug in this kernel?  I'll try upgrading it)
> 
> 
> Here is my /etc/fstab (there are some other file systems I mount first, 
> you'll see them in the mount list below):
> 
> tmpfs       /tmp            tmpfs   mode=1777
> varlog      /var/log        tmpfs   mode=755,nosuid
> varrun      /var/run        tmpfs   mode=755,nosuid
> varlock     /var/lock       tmpfs   mode=1777,nosuid,nodev,noexec
> serv0005:/home2/libera/nfs /mnt/nfs nfs rw,intr
> 172.23.100.32:/exports/dls_sw/work /mnt/work nfs ro,intr
> 172.23.100.32:/exports/dls_sw/prod /mnt/prod nfs ro,intr
> 
> 
> Finally, here is the output of `cat /proc/mounts` after running `mount -a` 
> three times or so:
> 
> # cat /proc/mounts
> rootfs / rootfs rw 0 0
> proc /proc proc rw 0 0
> sysfs /sys sysfs rw 0 0
> mdev /dev tmpfs rw 0 0
> devpts /dev/pts devpts rw,nosuid,noexec,gid=5,mode=620 0 0
> devshm /dev/shm tmpfs rw,nosuid,nodev 0 0
> tmpfs /tmp tmpfs rw 0 0
> varlog /var/log tmpfs rw,nosuid 0 0
> varrun /var/run tmpfs rw,nosuid 0 0
> varlock /var/lock tmpfs rw,nosuid,nodev,noexec 0 0
> serv0005:/home2/libera/nfs /mnt/nfs nfs 
> rw,vers=3,rsize=8192,wsize=8192,namlen=255,hard,intr,proto=udp,timeo=7,retrans=3,sec=sys,mountproto=udp,addr=172.23.240.5 0 0
> 172.23.100.32:/exports/dls_sw/work /mnt/work nfs 
> ro,vers=3,rsize=32768,wsize=32768,namlen=255,hard,intr,proto=udp,timeo=7,retrans=3,sec=sys,mountproto=udp,addr=172.23.100.32 0 0
> 172.23.100.32:/exports/dls_sw/prod /mnt/prod nfs 
> ro,vers=3,rsize=32768,wsize=32768,namlen=255,hard,intr,proto=udp,timeo=7,retrans=3,sec=sys,mountproto=udp,addr=172.23.100.32 0 0
> tmpfs /tmp tmpfs rw 0 0
> varlog /var/log tmpfs rw,nosuid 0 0
> varrun /var/run tmpfs rw,nosuid 0 0
> varlock /var/lock tmpfs rw,nosuid,nodev,noexec 0 0
> serv0005:/home2/libera/nfs /mnt/nfs nfs 
> rw,vers=3,rsize=8192,wsize=8192,namlen=255,hard,intr,proto=udp,timeo=7,retrans=3,sec=sys,mountproto=udp,addr=172.23.240.5 0 0
> 172.23.100.32:/exports/dls_sw/work /mnt/work nfs 
> ro,vers=3,rsize=32768,wsize=32768,namlen=255,hard,intr,proto=udp,timeo=7,retrans=3,sec=sys,mountproto=udp,addr=172.23.100.32 0 0
> 172.23.100.32:/exports/dls_sw/prod /mnt/prod nfs 
> ro,vers=3,rsize=32768,wsize=32768,namlen=255,hard,intr,proto=udp,timeo=7,retrans=3,sec=sys,mountproto=udp,addr=172.23.100.32 0 0
> tmpfs /tmp tmpfs rw 0 0
> varlog /var/log tmpfs rw,nosuid 0 0
> varrun /var/run tmpfs rw,nosuid 0 0
> varlock /var/lock tmpfs rw,nosuid,nodev,noexec 0 0
> tmpfs /tmp tmpfs rw 0 0
> varlog /var/log tmpfs rw,nosuid 0 0
> varrun /var/run tmpfs rw,nosuid 0 0
> varlock /var/lock tmpfs rw,nosuid,nodev,noexec 0 0
> 
> 
> 
> It's rather odd that the nfs mounts only get mounted twice, while 
> everything else seems to get remounted for each time I run mount.
> 
> I've never seen this peculiar behaviour before: any ideas what's causing 
> it?
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
> 


More information about the busybox mailing list