ext4无法挂载:bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.


问题描述

使用mount挂载硬盘,尝试使用busybox挂载也失败了。

itaken@itaken:~$ sudo mount -t nfs -o resvport,soft,intr,rsize=32768,wsize=32768,timeo=900,retrans=3,proto=tcp,vers=3,async 192.168.1.3:/data /home/itaken/tmp/data
mount: /home/itaken/tmp/data: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.

itaken@itaken:~$ sudo busybox mount -t ext4 -o resvport,soft,intr,rsize=32768,wsize=32768,timeo=900,retrans=3,proto=tcp,vers=3,async 192.168.1.3:/data /home/itaken/tmp/data
mount: mounting 192.168.1.3:/data on /home/itaken/tmp/data failed: No such file or directory

itaken@itaken:~$ sudo busybox mount -t nfs -o resvport,soft,intr,rsize=32768,wsize=32768,timeo=900,retrans=3,proto=tcp,vers=3,async 192.168.1.3:/data /home/itaken/tmp/data
mount: unknown nfs mount option: resvport
mount: mounting 192.168.1.3:/data on /home/itaken/tmp/data failed

解决方案

安装nfs-kernel-server,重启系统即可。

itaken@itaken:~$ sudo apt install nfs-kernel-server
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
将会同时安装下列软件:
  keyutils libnfsidmap2 nfs-common rpcbind
建议安装:
  open-iscsi watchdog
下列【新】软件包将被安装:
  keyutils libnfsidmap2 nfs-common nfs-kernel-server rpcbind
升级了 0 个软件包,新安装了 5 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 479 kB 的归档。
解压缩后会消耗 1,504 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 https://home-packages.chinauos.com/home plum/main amd64 libnfsidmap2 amd64 0.25-5.1 [32.6 kB]
...
Creating config file /etc/default/nfs-kernel-server with new version
Failed to start nfs-kernel-server.service: Unit -.mount is masked.
invoke-rc.d: initscript nfs-kernel-server, action "start" failed.
● nfs-server.service - NFS server and services
   Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
Failed to start nfs-kernel-server, ignoring.
正在处理用于 systemd (241.16-1+dde) 的触发器 ...
正在处理用于 man-db (2.8.5-2) 的触发器 ...
正在处理用于 libc-bin (2.28.12-1+eagle) 的触发器 ...

如果没有重启,可能挂载失败。

itaken@itaken:~$ sudo mount -t nfs -o resvport,soft,intr,rsize=32768,wsize=32768,timeo=900,retrans=3,proto=tcp,vers=3,async 192.168.1.3:/data /home/itaken/tmp/data
Failed to start rpc-statd.service: Unit -.mount is masked.

参考文档


Author: Itaken
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Itaken !
  TOC目录