Score:0

NFS server is exporting shares but is not?

us flag

I'm running a Lubuntu QEMU VM under Bunsenlabs Lithium (Debian 10). I'm testing different ways to share folder with NFS. First created share was OK, but the host refused to share the second folder.

=== SNIP ===

/etc/exports:

/Data/virtualization/KVMShare   *(rw,sync,no_root_squash,no_subtree_check)
/Data/share2    *(rw,sync,no_root_squash,no_subtree_check,insecure)

Both exportfs and showmount show that the folders are being exported:

pg@TREX:~$ sudo exportfs -rav
exporting *:/Data/share2
exporting *:/Data/virtualization/KVMShare  

pg@TREX:~$ sudo showmount -e localhost 
Export list for localhost:
/Data/share2                  *
/Data/virtualization/KVMShare *

Client shows the same:

pg@PT-Lubu:~$ sudo showmount -e 192.168.122.1 
Export list for 192.168.122.1:
/Data/share2                  *
/Data/virtualization/KVMShare *

=== SNIP ===

... and this isn't supposed to work???

pg@PT-Lubu:~$ sudo mount -t nfs4 192.168.122.1:/ share
pg@PT-Lubu:~$ ll -A share
lrwxrwxrwx 1 root root 6 aug 31 18:30 share -> /share/
pg@PT-Lubu:~$ ll -A share/Data
total 8
drwxrwxrwx 2 nobody nogroup 4096 aug 31 19:17 share2/
drwxrwxrwx 6 root   root    4096 aug 31 13:38 virtualization/

What's going on?

EDIT

As @Michael Hampton below kindly helped me see the error in my understanding, I snipped out parts that are no longer relevant.

I still don't understand why I'm able to mount the parent directories while I'm sharing the children. What I'm looking for is this:

  • Server is sharing from Drive1 folders /Data/Share/Foo1 and /Data/Share/Foo2
  • Client sees and can mount Server:/Foo1 and Server:/Foo2
  • Client neither sees nor can mount Server:/Data or Server:/Data/Share
  • If Drive1 fails I can simply activate Drive2/Share/Foo1 & 2 with the same share IDs
  • Client still sees and mounts only Server:/Foo1 & 2

I'd really appreciate if someone can point me to the right direction.

Before asking I already checked a number of resources over the inertnet, some of them very detailed. But sentences like "this is possible using appropriated options" aren't helpful if said options aren't pointed out. Also spending 2 hours trying to figure out why things aren't working when following detailed instructions, only to find out that the option isn't "no_sub_tree_check" as described, is somewhat less than extremely productive.

Michael Hampton avatar
cz flag
You can only mount a remote directory that has been exported. But you asked for a directory that is not exported.
Peregrino69 avatar
us flag
Can you please clarify? As far as I understand I'm exporting 2 directories under /Data, not /Data itself, and I can mount /Data but not the 2 directories I think I'm exporting.
Michael Hampton avatar
cz flag
But you didn't specify either of those directories in your `mount` command!
Peregrino69 avatar
us flag
"sudo mount -t nfs 192.168.122.1:/KVMShare share" -> "mount resource KVMShare shared by system 192.168.122.1 to local folder named share" - what am I misunderstanding?
Michael Hampton avatar
cz flag
You didn't export a directory named `/KVMShare`.
Peregrino69 avatar
us flag
My excuses for being daft. So the correct mount is "mount ... /Data/virtualization/KVMShare". I misunderstood the resource would be shared just with the name, not the whole path. So thanks for that. However I shouldn't be able to mount /Data or /Data/virtualization directly - what's up with that? To just present to the network the share names without complete paths, should I create symlinks in / and share those instead of the directories themselves?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.