上周,我一直在努力为我的网络添加一个(asustor) nas,最后我可以通过ubuntu中的nfs和运行raspberry-pi的rune-音频安装文件夹。
我将它们安装在根/nfs/“文件夹”中,并将其添加到nautilus侧栏中。现在,我想在引导时自动挂载这些内容,并阅读了以下内容:
https://help.ubuntu.com/community/Autofs和,
我安装了autofs。
但是,当我手动将任务挂载到auto.master规则时,我似乎不知道如何转换终端中的分配:
手动安装规则: sudo挂载192.168.0.200:/volume1 1/Public /nfs/Public
对此“转换”的帮助将不胜感激。
也就是说,我假设将该规则添加到标准auto.master中就足够了,还是应该使用间接规则?不相关的auto.nfs?
对于任何援助,我们都要事先表示感谢。
增添:
由于steeldriver的帮助,我确实安装了文件夹。
但我忘记提及,除了上述规则外:
数多山192.168.0.200:/volume1 1/Public /nfs/Public。
我还需要安装:
数多山192.168.0.200:/share/USB1 1 /nfs/Music。
我认为这与实现类似,但当它尝试以下操作时:
* -fstype=nfs,软,intr,rsize=8192,wsize=8192,nosuid,tcp 192.168.0.200:/volume1 1/Public
* -fstype=nfs,软,intr,rsize=8192,wsize=8192,nosuid,tcp 192.168.0.200:/share/USB1 1
但这只给了我一个带有公共内容的音乐文件夹,而不是USB1内容。我在这里做错什么了?
发布于 2017-02-17 15:13:17
要挂载NFS共享,我们需要安装nfs-通用的:
sudo apt-get install nfs-common为了避免在每次重新启动后重新键入该文件,我们将以下行添加到/etc/fstab中:
<nfs-server-IP>:/ /mnt nfs auto 0 0如果挂载后,/proc/mounts中的条目显示为:// (带有两个斜杠),则可能需要在/etc/fstab中指定两个斜杠,否则umount可能会抱怨它找不到挂载。
自动选项在启动时挂载。但是,如果客户端使用在用户级别(登录后)管理的wifi连接,这将无法工作,因为网络在启动时将不可用。在Ubuntu 12.04 LTS和更高版本中,wifi连接默认是在系统级别管理的,因此在引导时自动挂载NFS共享应该可以正常工作。
来源:https://help.ubuntu.com/community/SettingUpNFSHowTo
我们从安装AutoFS开始:
sudo apt install autofs我们编辑/etc/auto.master:
sudo nano /etc/auto.master内容:
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
# options are explicitly given.
#
#/net -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
#+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
#+auto.master
/media/nfs /etc/auto.nfs --ghost注释掉(#) "+auto.master“和"+dir:/etc/auto.master.d”,并在底部添加行。我花了两个小时试图让它工作,不知怎么的,它是行不通的,而不添加-鬼怪选项。如果有人知道为什么请评论。现在/media/nfs是包含NFS共享的dir (您不必创建它,autofs是为您创建的),/etc/auto.nfs是您的共享的配置文件。我们现在要这样做:
sudo nano /etc/auto.nfs插入股票:
Backup 10.0.1.100:/Backup
Multimedia 10.0.1.100:/Multimedia现在备份dir10.0.1.100:/ Backup将接受/media/nfs。
重新启动autofs:
sudo systemctl restart autofs就这样,享受你们的股份吧。
https://askubuntu.com/questions/884389
复制相似问题