无法从我的主目录中导出任何目录 - Ubuntu 18.04

无法从我的主目录中导出任何目录 - Ubuntu 18.04

每当我在主目录外的文件夹上进行 NFS 导出时,我都会收到以下错误(感谢这个示例太简短,但下一组代码显示了我是如何到达这里的):

$ sudo exportfs -ar
exportfs: /export/test does not support NFS export

这是我所做的详细内容:

## Create the bind mount ##
$ sudo  mount --bind /home/john/test /export/test

## Verify original /home/john/test folder exists ##
john@john:~/test$ cd ~/
john@john:~$ ls -l | grep test
drwxrwxr-x  2 john john  4096 Feb  9 13:33 test

## Check what files exist in this folder and confirm they are in the bind location ##
john@john:~$ cd test
john@john:~/test$ ls 
f  test  testfile

## Verify bind location folder exists & that the same files are in this location ##
john@john:~/test$ cd /export/test
john@john:/export/test$ ls
f  test  testfile

## Ensure export file is exporting the bind location ##
john@john:/export/test$ grep test /etc/exports
/export/test 192.168.0.0/24(rw,sync,root_squash,no_subtree_check)

## Re-export shares to get the /export/test nfs share on the network ##
john@john:/export/test$ sudo exportfs -ar
exportfs: /export/test does not support NFS export

如你看到的。当我尝试重新导出我的共享时,它会抛出上述错误。经过下面的测试后,我发现只有在尝试导出链接的任何内容或直接导出我的 /home/john/ 目录时才会发生这种情况。我不知道为什么。


#################### 使用 /home 之外的目录进行测试 ########################

在这里,我尝试在新目录“/test”上使用 NFS 共享,而无需绑定安装,并且它有效:

#note, continuing from the bash commands above#
john@john:/test$ cd ..
john@john:/$ sudo umount /test
john@john:/$ ls /test
test
john@john:/$  sudo exportfs -ar
john@john:/$ 

########## 使用 /home 目录中的共享进行测试(没有绑定安装)########

在这里,我在主目录之外的目录上进行了共享(因为我怀疑主目录挂载有问题),没有任何绑定,这不起作用

john@john:~$ mkdir test-nobind
john@john:~$ cd test-nobind/
john@john:~/test-nobind$ touch file1 file2
john@john:~/test-nobind$ ls -l
total 16
-rw-rw-r-- 1 john john 0 Feb  9 19:23 file1
-rw-rw-r-- 1 john john 0 Feb  9 19:23 file2
john@john:~/test-nobind$ cd ..
john@john:~$ sudo nano /etc/exports ###added line to export this folder
john@john:~$ grep test /etc/exports
/home/john/test-nobind 172.31.16.0/24(rw,sync,root_squash,no_subtree_check)

john@john:~$ sudo exportfs -rav
exporting 172.31.16.0/24:/home/john/test-nobind
exportfs: /home/john/test-nobind does not support NFS export

正如你所看到的,我有与我原来的帖子相同的错误,其中 exportfs 说“不支持 NFS 导出”。所以这是我的主目录导致了问题。我的 /etc/crypttab 文件是空的,所以我不相信我正在运行任何加密(至少我不认为我这样做)。我想知道为什么我会收到此错误?


下面是这个论坛中人们要求我检查的内容/输出的列表

john@john:/home$ df $HOME
Filesystem            1K-blocks     Used Available Use% Mounted on
/home/john/.Private 106992680 81417972  20116688  81% /home/john

john@john:~$ mount | grep /home/john
/home/john/.Private on /home/john type ecryptfs (rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=b15035efe9091f4e,ecryptfs_sig=05afa3a5d0c7b155,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs)

相关内容