[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mounting multiple NFS shares to the same point



A bit of background:

I run backup scripts (dumps piped through gzip to a fileshare) out of
periodic on a daily, weekly and monthly basis. In the script I mount the
NFS share, perform the dumps, and then umount the share. I was worried
that if a daily backup took a long time (more than twice the normal
time) then the weekly would bomb out because the filesystem was already
mounted. So I was going to write some checks to see if it existed before
mounting it.

Which is when I discovered that you can mount multiple NFS shares to the
same directory :-)

Here's an example of it in action:

[root_(_at_)_athena ~]# mount /exports/srvbackup/
[root_(_at_)_athena ~]# mount | grep srvbackup
nas:/srvbackup on /exports/srvbackup (nfs)
[root_(_at_)_athena ~]# mount /exports/srvbackup/
[root_(_at_)_athena ~]# mount | grep srvbackup
nas:/srvbackup on /exports/srvbackup (nfs)
nas:/srvbackup on /exports/srvbackup (nfs)
[root_(_at_)_athena ~]# umount /exports/srvbackup/
[root_(_at_)_athena ~]# mount | grep srvbackup
nas:/srvbackup on /exports/srvbackup (nfs)
[root_(_at_)_athena ~]# umount /exports/srvbackup/
[root_(_at_)_athena ~]# mount | grep srvbackup
[root_(_at_)_athena ~]# man mount_nfs

Further, you can mount /different/ shares to the same directory:

[root_(_at_)_athena ~]# mount /exports/srvbackup/
[root_(_at_)_athena ~]# mount_nfs nas:/pub /exports/srvbackup/
[root_(_at_)_athena ~]# mount | grep srvbackup
nas:/srvbackup on /exports/srvbackup (nfs)
nas:/pub on /exports/srvbackup (nfs)

I then cd'ed to /exports/srvbackup, and only saw files from the second
mount (nas:/pub). So it's not doing a union mount or anything like that.

Is this normal behaviour? Are there any problems with (performance,
perhaps) that might occur if an NFS share is mounted twice? What if my
backup job is still running, would it be interrupted by the second mount
75 minutes later (according to the `periodic` entires in crontab) or
will it be fine?

This definitely seems odd to me, I would've expected mount to express an
error to me.

-T

_______________________________________________
freebsd-questions_(_at_)_freebsd_(_dot_)_org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe_(_at_)_freebsd_(_dot_)_org"