增加 Manjaro 下的配置方法.

Signed-off-by: rick.chan <chenyang@autoai.com>
This commit is contained in:
rick.chan 2020-05-11 15:48:07 +08:00
parent e072f91c99
commit 09f4028de6
2 changed files with 38 additions and 9 deletions

View File

@ -6,6 +6,8 @@
# Ubuntu
sudo apt-get install nfs-kernel-server
sudo apt-get install nfs-common
# Manjaro
sudo pacman -S nfs-utils
```
## 配置
@ -14,45 +16,53 @@ sudo apt-get install nfs-common
sudo vim /etc/exports
```
若需要把 “/nfsroot” 目录设置为 NFS 共享目录,请在该文件末尾添加下面的一行:
在该文件末尾添加下面的一行:
```sh
/nfsroot *(rw,sync,no_root_squash) # * 表示允许任何网段 IP 的系统访问该 NFS 目录
<NFS share dir> *(rw,sync,no_root_squash,no_subtree_check) # * 表示允许任何网段 IP 的系统访问该 NFS 目录
```
新建“/nfsroot”目录,并为该目录设置最宽松的权限:
新建“\<NFS share dir\>”目录,并为该目录设置最宽松的权限:
```sh
sudo mkdir /nfsroot
sudo mkdir <NFS share dir>
# -R 表示递归更改该目录下所有文件
sudo chmod -R 777 /nfsroot
sudo chown <usr>:<group> /nfsroot/ -R
sudo chmod -R 777 <NFS share dir>
sudo chown <usr>:<group> <NFS share dir> -R
```
如果修改了 exports 文件需要通过以下命令使修改生效:
```sh
sudo exportfs -rv
sudo exportfs -arv
```
## 使能/启动 NFS 服务
```sh
# Ubuntu
sudo systemctl enable nfs-kernel-server
sudo systemctl start nfs-kernel-server
# Manjaro
sudo systemctl enable nfs-server
sudo systemctl start nfs-server
```
## 停止/禁用 NFS 服务
```sh
# Ubuntu
sudo systemctl stop nfs-kernel-server
sudo systemctl disable nfs-kernel-server
# Manjaro
sudo systemctl stop nfs-server
sudo systemctl disable nfs-server
```
## 挂载 NFS 文件系统
```sh
sudo mount -t nfs <nfs server ip>:/nfsroot /mnt -o nolock
sudo mount -t nfs <nfs server ip>:<NFS share dir> <mount point> -o nolock
```
## 查看状态

View File

@ -5,15 +5,20 @@
```sh
# Ubuntu
sudo apt-get install tftpd-hpa
# Manjaro
sudo pacman -S tftp-hpa
```
## 配置
```sh
# Ubuntu
sudo vim /etc/default/tftpd-hpa
# Manjaro
sudo vim /etc/conf.d/tftpd
```
修改为如下内容
Ubuntu 系统修改为如下内容
```sh
TFTP_USERNAME="tftp"
@ -23,16 +28,30 @@ TFTP_OPTIONS="-l -c -s"
#TFTP_OPTIONS="--secure"
```
Manjaro 系统修改为如下内容:
```sh
TFTPD_ARGS="-l -c -s /home/rick/Share/tftp"
```
## 使能/启动 TFTP 服务
```sh
# Ubuntu
sudo systemctl enable tftp-hpa
sudo systemctl start tftp-hpa
# Manjaro
sudo systemctl enable tftpd
sudo systemctl start tftpd
```
## 停止/禁用 TFTP 服务
```sh
# Ubuntu
sudo systemctl stop tftp-hpa
sudo systemctl disable tftp-hpa
# Manjaro
sudo systemctl stop tftpd
sudo systemctl disable tftpd
```