今天在操作移动硬盘挂载服务器时,执行完mount指令,直接报错“Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command
.”

root@dell-PowerEdge-T430:/home# mount -t ntfs-3g /dev/sdc1 /home/upan
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.

翻译下:“拒绝挂载,因为NTFS卷已经独占地打开了。卷可能已经挂载,或其他软件可能使用它

可以通过'fuser'命令的帮助来识别。”

原因:回想了下,应该是非正常umount操作,可能是直接拔出USB,或者服务器重启造成的。

根据报错提示,我们可以通过fuser指令,来查看打开文件的信息。那就查下fuser的如何使用,执行

fuser --hlep

root@dell-PowerEdge-T430:/home# fuser --help
fuser: Invalid option --help
Usage: fuser [-fMuvw] [-a|-s] [-4|-6] [-c|-m|-n SPACE] [-k [-i] [-SIGNAL]] NAME...
       fuser -l
       fuser -V
Show which processes use the named files, sockets, or filesystems.

  -a,--all              display unused files too
  -i,--interactive      ask before killing (ignored without -k)
  -k,--kill             kill processes accessing the named file
  -l,--list-signals     list available signal names
  -m,--mount            show all processes using the named filesystems or block device
  -M,--ismountpoint     fulfill request only if NAME is a mount point
  -n,--namespace SPACE  search in this name space (file, udp, or tcp)
  -s,--silent           silent operation
  -SIGNAL               send this signal instead of SIGKILL
  -u,--user             display user IDs
  -v,--verbose          verbose output
  -w,--writeonly        kill only processes with write access
  -V,--version          display version information
  -4,--ipv4             search IPv4 sockets only
  -6,--ipv6             search IPv6 sockets only
  -                     reset options

  udp/tcp names: [local_port][,[rmt_host][,[rmt_port]]]

查询全部信息

root@dell-PowerEdge-T430:/home# fuser -a /dev/sdc1
/dev/sdc1:            3774

有点少啊,就一个文件路径和进程号,直接执行kill,关闭当前打开的进程。

root@dell-PowerEdge-T430:/home# fuser -k /dev/sdc1
/dev/sdc1:            3774

再次查询

root@dell-PowerEdge-T430:/home# fuser -a /dev/sdc1
/dev/sdc1:

进程已经关闭了。

重新执行mount挂载指令即可。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐