現場(環境):CentOS 6.8 套件:ntfs-3g
原因:
Windows 2012 使用過的硬碟掛載到linux都會出現錯誤
造成無法使用的狀況。
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount '/dev/sdb2': Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the 'ro' mount option.
查詢完原因後,
發現是因為Windows 8以後期有設定快速關機,
(因為Windows2012 & Win8屬於同一世代)
就是這個造成Linux讀取時會發現
硬碟被Windows的cache卡住。
這個情形下,會變成你完全無法掛載硬碟
因為預設掛載硬碟是使用RW模式。
處理方式:
此模式的狀況下,掛載只有兩個方式
ntfs-3g套件請另外下載進行安裝
(ubuntu可用apt-get下載,CentOS 要用source檔)
1. 掛載RO模式 (Read-only)
預設掛載是RW (-w)模式,所以這邊要想RO 就得帶(-r)
-o (是強制掛載)
#mount -t ntfs-3g /dev/sdb1(磁區) /test(掛載點) -ro force
2. 修復磁碟被cache的部份,再重新掛載RW模式上去。
#ntfsfix /dev/磁區 (sdb1 / sdb2 / sdb3)
# ntfsfix /dev/sdb1
Mounting volume... The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
FAILED
Attempting to correct errors...
Processing $MFT and $MFTMirr...
Reading $MFT... OK
Reading $MFTMirr... OK
Comparing $MFTMirr to $MFT... OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition... OK
Going to empty the journal ($LogFile)... OK
Checking the alternate boot sector... OK
NTFS volume version is 3.1.
NTFS partition /dev/sdb2 was processed successfully.
修復後就可以正常掛載了,但因為這是不穩定的狀態
不建議寫入/etc/fstab
建議另外寫shell ,再開機後啟用shell就好。
#/usr/bin/mount -w -t ntfs-3g /dev/sdb1 /XXX01 -o force
#!###############################################
#!/bin/bash
/usr/bin/mount -w -t ntfs-3g /dev/sdb1 /XXX01 -o force
/usr/bin/mount -w -t ntfs-3g /dev/sdc2 /XXX02 -o force
/usr/bin/mount -w -t ntfs-3g /dev/sdd3 /XXX03 -o force
#!###############################################
留言列表