Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to explain NFS crossmnt argument?

Tags:

nfs

A client of mine discovered that he needs to include 'crossmnt' along with his NFS export options. I am going to write the option into our software, so that he doesn't have to put in a hack and can use crossmnt as a real option.

Is this a correct explanation of crossmnt that I can use in our docs?

Crossmnt allows the NFS client to traverse the directories below the exported root. For example: etc/exports:

/exports      *(fsid=0,ro,root_squash,sync)
/exports/doc  *(ro,root_squash,bind=/usr/share/doc)

With crossmnt, the client can see the contents of /exports/doc as the subfolder of /exports, while without crossmnt, doc would appear to be an empty folder.

This video was used for an example: https://www.youtube.com/watch?v=-9cJciX8dB8

Does that sound right? Thank you.

like image 962
rajat banerjee Avatar asked Dec 02 '13 02:12

rajat banerjee


People also ask

What is NFS Crossmnt?

Crossmnt allows the NFS client to traverse the directories below the exported root. For example: etc/exports: /exports *(fsid=0,ro,root_squash,sync) /exports/doc *(ro,root_squash,bind=/usr/share/doc)

What is meaning of No_root_squash in NFS?

Some Linux NFS servers have an option called no_root_squash which disables the default behavior of squashing the root user. Root squashing is a security feature. NFS commands executed as the root user on the client will be considered as originating from the "anonymous" user.

What is Fsid in NFS?

For NFSv4, there is a distinguished filesystem which is the root of all exported filesystem. This is specified with fsid=root or fsid=0 both of which mean exactly the same thing. Other filesystems can be identified with a small integer, or a UUID which should contain 32 hex digits and arbitrary punctuation.

What does No_subtree_check mean?

no_subtree_check This option disables subtree checking, which has mild security implications, but can improve reliability in some circumstances.


1 Answers

I believe that there is something missing in this explanation.. what i know from crossmount is that it allows you to see a mounting point inside an exported directory. If the exported directory doesn't have any partition mounted over its subfolders, they should be visible in the client side of the NFS.

For example, if you have an exported directory over "/mnt/testing_dir", with this content:

/mnt/testing_dir/
                 dir1/
                           text1.txt
                           executable.bin
                 dir2/ (mount point for /dev/sda6)
                           doc1
                           doc2

The "dir1" will be visible even if without the "crossmnt" option. However, "dir2", as it is a mounting point, will be visible with the "crossmnt" option, and will be empty without it (unless you use another options like "nohide").

Reference:

crossmnt - 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.

like image 93
Vitor Avatar answered Oct 20 '22 01:10

Vitor