0

I have 4 hard drivers mounted in a directory:

/dev/sda1        11T   62M   11T   1% /all-hdds/hdd1                                                    │ 36 #MpiParams=ports=#-#
/dev/sdb1        11T   62M   11T   1% /all-hdds/hdd2                                                    │ 37 #PluginDir=
/dev/sdc1        11T   62M   11T   1% /all-hdds/hdd3                                                    │ 38 #PlugStackConfig=
/dev/sdd1        11T   62M   11T   1% /all-hdds/hdd4

Is it possible to export all-hdds as a single NFS point and mount it on other clients? I tried it and I can see all the hdd1, hdd2, etc directories on the client side but when I create files inside them they don't show up on the host so I think maybe I'm hitting some sort of limitation?

Milad
  • 4,901
  • 5
  • 32
  • 43

1 Answers1

0

Let's assume that /all-hdds itself is mounted from /dev/sde1.

When /all-hdds/hdd1 is not mounted, /all-hdds (on sde1) still has a directory /hdd1, which is empty. When you mount sda1, you mounted the root of the filesystem in sda1 onto /all-hdds/hdd1.

But when you export /all-hdds/hdd1 over NFS, it's confined only to the filesystem on /dev/sde1. So if on the client you mounted /all-hdds onto e.g. /client-mountpoint and then created a file /client-mountpoint/hdd1/test, what actually happens is that the file /hdd1/test is created on the filesystem /all-hdds, stored on /dev/sde1.

Of course, you don't see that file, because it is hidden by the filesystem on sda1, mounted onto /all-hdds/hdd1.

What this means is that you need to export all the filesystems, and explicitly tell the server that you want to export them as a tree.

That entails setting fsid=0 mount option on the root of the exported tree, and setting the nohide option on the sub-exports.

The full guide is here (the installation part is Ubuntu-specific, the export part isn't).

Do note that this will mean that the client mounts yoursever:/ rather than yourserver:/all-hdds - NFSv4 only has one root.

root
  • 5,528
  • 1
  • 7
  • 15