close

現場(環境): CetnOS6 / Windows 10


 


問題:
 

Windows 10 / 2012 後掛載上去的硬碟都會遇到一個狀況
 

就是硬碟拿去掛載在linux上會出現無法掛載的狀況。
 

因為Windows 後期有快速關機,就是這個功能。
 

造成Linux再讀取時會發現硬碟被Windowscache卡住。
 

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.

 

再這個情形下,會變成你完全無法掛載硬碟
 

因為預設掛載硬碟是使用RW模式。

 


處理方式:

 

此模式的狀況下,你要掛載只有兩個方式


ntfs-3g套件請另外下載進行安裝


(ubuntu可用apt-get下載,CentOS請利用tgz檔安裝)


 


1. 掛載RO模式 (Read-only)


預設掛載是RW (-w)模式,所以這邊要想RO 就得帶(-r)


-o (是強制掛載)


#mount -t ntfs-3g /dev/sdc2(磁區) /LUN/02(掛載點) -ro force

 

 


2. 修復磁碟被cache的部份,再重新掛載RW模式上去。


#ntfsfix /dev/磁區 (sdb2 / sdc2 / sdd2)

 

# ntfsfix /dev/sdb2

 

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/sdb2 /LUN/01 -o force

 

################################################

#!/bin/bash

 

/usr/bin/mount -w -t ntfs-3g /dev/sdb2 /LUN/01 -o force

 

/usr/bin/mount -w -t ntfs-3g /dev/sdc2 /LUN/02 -o force

 

/usr/bin/mount -w -t ntfs-3g /dev/sdd2 /LUN/03 -o force

################################################


<本篇完>

arrow
arrow
    全站熱搜

    IT001 發表在 痞客邦 留言(0) 人氣()