背景描述
一时手贱,没有卸载移动硬盘(exFAT文件系统)就直接拔下USB,再插上移动硬盘尝试进入目录时弹出报错窗口,提示:
An operation is pending
解决过程
- 首先
df
查看设备状态,检查移动硬盘挂载点,显示该硬盘已经被挂载
$ df
文件系统 1K-块 已用 可用 已用% 挂载点
...
/dev/sdc1 4883734528 1721180160 3162554368 36% /media/yyz/M21
- 第一次尝试
umount
卸载移动硬盘,报错 target is busy.。说明有进程正在使用该设备,参考网友分享使用fuser
命令杀掉占用资源的进程。 - 第二次尝试
umount
卸载移动硬盘,报错 not mounted:
$ umount /dev/sdc1
Error unmounting block device 8:33: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error unmounting /dev/sdc1: not mounted
- 于是尝试
mount
挂载该硬盘,报错 mountpoint is not empty:
sudo mount /dev/sdc1 /media/yyz/M21
FUSE exfat 1.2.8
WARN: volume was not unmounted cleanly.
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
- 根据askubuntu.com的问答,使用 fsck.exfat 修复该硬盘:
$ sudo fsck.exfat /dev/sdc1
exfatfsck 1.2.8
Checking file system on /dev/sdc1.
File system version 1.0
Sector size 512 bytes
Cluster size 4 MB
Volume size 4657 GB
Used space 1641 GB
Available space 3016 GB
ERROR: failed to read cluster 0x22e.
ERROR: 'unpackd' is empty but start cluster is 0x6658e.
ERROR: 'unpackd' is empty but marked as contiguous (0x20).
ERROR: failed to read cluster 0x3bbac.
Totally 4468 directories and 7554 files.
File system checking finished. ERRORS FOUND: 4.
$
- 完成后,即可正常卸载、挂载移动硬盘