我有2台机器,我想把A机器挂载到B机器上。
NFS安装
B机器执行-服务端:sudo apt-get install nfs-kernel-server
A机器执行-客户端:sudo apt-get install nfs-common
指定共享盘
进入B机器,配置共享盘
创建需要让别人访问的目录:
sudo mkdir /ttsGuaZai(名字你按自己需求来)
sudo vi /etc/exports
#文件内写的配置,开启读写权限,共享,不用root
/ttsGuaZai *(rw,sync,no_root_squash)
设置文件夹权限
sudo chmod -Rf 777 /ttsGuaZai
重启B机器的NFS
sudo /etc/init.d/nfs-kernel-server restart
挂载磁盘
进入A机器创建文件夹
mkdir /pzk/ttsGuaZai
挂载nfs网络磁盘
sudo mount -t nfs B机器的ip:/ttsGuaZai /pzk/ttsGuaZai
测试
在a机器里面创建一个a.txt
在b机器里看一下
成功!
问题汇总
我在第一步更新失败,是因为默认地址下载地址在国外,设置成国内的镜像源,比如阿里的
sudo vi cat /etc/apt/sources.list
然后把这个替换成下面的
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial maindeb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates maindeb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universedeb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu focal main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu focal main restricted## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu focal-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu focal-updates main restricted## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu focal universe
# deb-src http://cn.archive.ubuntu.com/ubuntu focal universe
deb http://cn.archive.ubuntu.com/ubuntu focal-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu focal-updates universe## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu focal multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu focal multiverse
deb http://cn.archive.ubuntu.com/ubuntu focal-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu focal-updates multiverse## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partnerdeb http://cn.archive.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu focal-security main restricted
deb http://cn.archive.ubuntu.com/ubuntu focal-security universe
# deb-src http://cn.archive.ubuntu.com/ubuntu focal-security universe
deb http://cn.archive.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu focal-security multiverse
然后更新
sudo apt-get upgrade
再重新执行你的安装命令
参考:
https://www.cnblogs.com/infinite-ryvius/p/17527471.html
已解决Ubuntu系统下载更新源包时提示 “Failed to fetch”错误_failedtofetch怎么解决-CSDN博客