Linux下無法掛載U盤

今日在拷貝文件時,可能是沒注意到文件還沒寫入U盤,強行將其拔出,不料卻出現無法掛載的情況:

Error mounting /dev/sdb4 at /media/xxx/xx: Command-line`mount -t "ntfs" -o"uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177""/dev/sdb4" "/media/eden/文檔"' exited with non-zero exit status14: The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount '/dev/sdb4': Operation not permitted
The NTFS partition is in an unsafe state. Please resume andshutdown
Windows fully (no hibernation or fast restarting), or mount thevolume
read-only with the 'ro' mount option.

究其原因,估計是拔出時文件還未寫完,出現故障,逐步排查如下:

1、打開終端,輸入sudo fdisk -l 可列出所有的分區情況,找到自己U盤的分區;

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = 扇區 of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x13bcd83a

   設備 啓動      起點          終點     塊數   Id  系統
/dev/sda1   *          63   163846934    81923436    7  HPFS/NTFS/exFAT
分區 1 未起始於物理扇區邊界。
/dev/sda2       163846996   859797503   347975254    f  W95 擴展 (LBA)
分區 2 未起始於物理扇區邊界。
/dev/sda5       163846998   404500634   120326818+   7  HPFS/NTFS/exFAT
分區 5 未起始於物理扇區邊界。
/dev/sda6       404500698   645138269   120318786    7  HPFS/NTFS/exFAT
分區 6 未起始於物理扇區邊界。
/dev/sda7       645138333   693843008    24352338    7  HPFS/NTFS/exFAT
分區 7 未起始於物理扇區邊界。
/dev/sda8       693843968   697843711     1999872   82  Linux 交換 / Solaris
/dev/sda9       697845760   797843455    49998848   83  Linux
/dev/sda10      797845504   857843711    29999104   83  Linux
/dev/sda11      857845760   859797503      975872   83  Linux

Disk /dev/sdb: 8004 MB, 8004304896 bytes
255 heads, 63 sectors/track, 973 cylinders, total 15633408 sectors
Units = 扇區 of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcad4ebea

   設備 啓動      起點          終點     塊數   Id  系統
/dev/sdb4   *         256    15633407     7816576    7  HPFS/NTFS/exFAT


2、得知分區爲:/dev/sdb4,創建掛載目錄:

sudo mkdir /media/xxx/yyy          (xxx爲用戶名,yyy爲掛載的U盤的名字)

3、掛載U盤:

mount -t ntfs-3g  /dev/sdb4  /media/xxx/yyy/ -o force

如此做之後,還是會出現錯誤:

$MFTMirr does not match $MFT (record 0).
Failed to mount '/dev/sdb6': 輸入/輸出錯誤
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details
.

4、還是不行,網上一搜,用以下命令,大功告成:

sudo ntfsfix /dev/sdb6

Mounting volume... FAILED
Attempting to correct errors... 
Processing $MFT and $MFTMirr...
Reading $MFT... OK
Reading $MFTMirr... OK
Comparing $MFTMirr to $MFT... FAILED
Correcting differences in $MFTMirr record 0...OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition... OK
Going to empty the journal ($LogFile)... OK
NTFS volume version is 3.1.
NTFS partition /dev/sdb6 was processed successfully.

看來以後自己得小心插拔U盤了。


發佈了31 篇原創文章 · 獲贊 54 · 訪問量 11萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章