N
N
Nikita Chukov2015-03-05 01:35:09
linux
Nikita Chukov, 2015-03-05 01:35:09

How to configure file system export via nfs?

Friends!
I want to configure NFS so that when mounting it would not be necessary to specify the full path to the directory on the server.
Example:
This exports a directory (server name: server):
[email protected] ~ $ cat /etc/exports |grep -v ^#
/images/software 192.168.0.3/24(rw,sync,all_squash,anonuid=99,anongid =99)
Thus, the directory is mounted on the client:
oracle:~ # mount -t nfs -o users,noatime,exec server:/images/software /mnt
And I want to connect something like this:
oracle:~ # mount -t nfs -o users ,noatime,exec server:/software /mnt
Thanks.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita Chukov, 2015-03-06
@chukov

After reading carefully man 5 exports , I found the crossmnt option
This option is similar to nohide but it makes it possible for clients to move from the filesystem marked with crossmnt to exported filesystems
mounted on it. Thus when a child filesystem "B" is mounted on a parent "A", setting crossmnt on "A" has the same effect as setting "nohide" on B.
[email protected] ~ $ cat /etc/exports |grep -v "^#"
/images 192.168.0.0/24(fsid=0,crossmnt,ro,root_squash,async,no_subtree_check)
/images/software 192.168.0.0/24( rw,insecure,no_root_squash,sync,no_subtree_check)
oracle:~ # cat /etc/fstab | grep nfs server:/software /u01/distrs nfs4 rw,bg,hard,rsize=65536,wsize=65536,noatime,exec,proto=tcp, actimeo
=0 0 0 Now it remains to check how the windows 8 client will react to such a ball Thank you all for the comments.

A
Andrey Burov, 2015-03-05
@BuriK666

Only creating directories at the root, otherwise it will not work (this is how NFS works).
PS:
192.168.0.3/24 - you allow mounting the entire 192.168.0.0 subnet, if you need a separate host, then 192.168.0.3/32.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question