原帖: https://segmentfault.com/a/1190000044382461
使用移动硬盘在win和linux之间拷贝文件、同步本地git仓库时遇到linux无法打开硬盘
硬盘自动挂载在/run/media/userName/X
报错:无法连接 X
详细信息:Error mounting /dev/sda1 at run/media/userName/X: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error.
查看demsg
$ sudo dmesg | grep ntfs
得到信息:
...
[ 364.140143] ntfs3(sda1): It is recommened to use chkdsk.
[ 364.141955] ntfs3(sda1): volume is dirty and "force" flag is not set!
...
因为/dev/sda1这个volume被标记为dirty,并且ntfs3在没有force这个flag设置的情况下不会挂载。
可以通过ntfsfix命令去修复,-d参数,可以清除dirty的标记。
运行:
$ sudo ntfsfix -d /dev/sda1
输出如下:
Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
Checking the alternate boot sector... OK
NTFS volume version is 3.1.
NTFS partition /dev/sda1 was processed successfully.
然后就好了。