[修改] Ubuntu nfs编译通过

This commit is contained in:
gaoyang3513
2023-10-14 15:29:05 +00:00
parent 60af3c3f3a
commit 205aa31030

View File

@ -100,9 +100,11 @@ Even if neither end of the connection supports nfs v4, adding nfsver=3 is still
Installation of NFS Utilities Installation of NFS Utilities
Before you compile the program, ensure that the nobody user and nogroup group have been created as done in the current LFS book. You can add them by running the following commands as the root user: Before you compile the program, ensure that the nobody user and nogroup group have been created as done in the current LFS book. You can add them by running the following commands as the root user:
```shell
groupadd -g 99 nogroup && groupadd -g 99 nogroup &&
useradd -c "Unprivileged Nobody" -d /dev/null -g nogroup \ useradd -c "Unprivileged Nobody" -d /dev/null -g nogroup \
-s /bin/false -u 99 nobody -s /bin/false -u 99 nobody
```
[Note] Note [Note] Note
The classic uid and gid values are 65534 which is also -2 when interpreted as a signed 16-bit number. These values impact other files on some filesystems that do not have support for sparse files. The nobody and nogroup values are relatively arbitrary. The impact on a server is nil if the exports file is configured correctly. If it is misconfigured, an ls -l or ps listing will show a uid or gid number of 65534 instead of a name. The client uses nobody only as the user running rpc.statd. The classic uid and gid values are 65534 which is also -2 when interpreted as a signed 16-bit number. These values impact other files on some filesystems that do not have support for sparse files. The nobody and nogroup values are relatively arbitrary. The impact on a server is nil if the exports file is configured correctly. If it is misconfigured, an ls -l or ps listing will show a uid or gid number of 65534 instead of a name. The client uses nobody only as the user running rpc.statd.
@ -125,9 +127,25 @@ chown nobody.nogroup /var/lib/nfs
```shell ```shell
./configure --prefix=${PWD}/../_install \ ./configure --prefix=${PWD}/../_install --disable-nfsv4 --disable-gss --disable-uuid --disable-mount --sbindir=${PWD}/../_install/sbin/ --with-statedir=${PWD}/../_install/var/lig/nfs/
--sbindir=/sbin \
--disable-nfsv4 \ # install-data-hook目标错误修改Makefile屏蔽chown/var/lib/nfs
--disable-gss &&
#
make make
``` ```
## 启动
https://blog.csdn.net/qq_26601681/article/details/104940430
http://www.cnitblog.com/gouzhuang/archive/2010/03/23/nfs_utils.html
```shell
sudo mount -t nfsd nfsd /proc/fs/nfsd
./../_install/sbin/rpc.statd
./../_install/sbin/rpc.nfsd
./../_install/sbin/rpc.mountd
```