Mount NFS filesystem in two different directories on same system

by Vivek Gite on March 16, 2007 · 4 comments

Q. How do I mount NFS filesystem twice in two different dirs on same Linux client?

NFS Server : nfsserver:/data

Mount to dirs /home/data and /backup

A. You will not able to do that. However mount command has bind option to remount part of the file hierarchy somewhere else.

Procedure

First mount to /home/data
# mount -t nfs4 nfsserver:/data /home/data
Now bind /home/data to /backup
# mount --bind /home/data /backup
# ls /backup /home/data

Read man page of mount command for more information:
$ man mount

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 4 comments… read them below or add one }

1 manpreet singh April 3, 2007

hello , i want to help for linux commands and working in linux so plz regarding me some helping notes or documents through i m doing mastering thanks for your goodness.

Reply

2 Wederik May 29, 2007

Mr Singh,
Try IBM DeveloperWorks LPI Tutorials. An absolute must in my opinion.

Reply

3 Steve O October 15, 2008

Thanks for this – I was getting “stale NFS file handle” because I had mounted the filesystem twice. Clearly I should not have done so!

Reply

4 Chase January 11, 2010

Do you know if there is anything that causes issues with bind when using a CIFS mount?

I have a few directories that I mount that way, but after a while, it starts listing everything in them (the bind mounted ones) as directories. The original CIFS mount is still fine though.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 7 + 2 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: