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:

[EMAIL PROTECTED] ~]# mount /exports/srvbackup/
[EMAIL PROTECTED] ~]# mount | grep srvbackup
nas:/srvbackup on /exports/srvbackup (nfs)
[EMAIL PROTECTED] ~]# mount /exports/srvbackup/
[EMAIL PROTECTED] ~]# mount | grep srvbackup
nas:/srvbackup on /exports/srvbackup (nfs)
nas:/srvbackup on /exports/srvbackup (nfs)
[EMAIL PROTECTED] ~]# umount /exports/srvbackup/
[EMAIL PROTECTED] ~]# mount | grep srvbackup
nas:/srvbackup on /exports/srvbackup (nfs)
[EMAIL PROTECTED] ~]# umount /exports/srvbackup/
[EMAIL PROTECTED] ~]# mount | grep srvbackup
[EMAIL PROTECTED] ~]# man mount_nfs

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

[EMAIL PROTECTED] ~]# mount /exports/srvbackup/
[EMAIL PROTECTED] ~]# mount_nfs nas:/pub /exports/srvbackup/
[EMAIL PROTECTED] ~]# 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@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to