最近在將Ubuntu系統中的大量文件(超過100G)拷貝到移動硬盤的過程中,出現了卡死的情況。開始是採用直接文件夾複製粘貼的方式,出現卡死之後換成了"scp -r"的方式,都沒能搞定。
這個問題主要是由於Ubuntu系統中Kernel寫入緩存太大,以至於從高速存儲寫往低速設備時出現擁塞瓶頸,從而出現卡死的情況。
解決方法是避免使用文件管理器及scp的方法,在拷貝大文件時可以採用如下指令:
rsync -avP source/ target/
rsync是一個遠程數據同步工具,可通過LAN/WAN快速同步多臺主機間的文件,且可以查看文件傳輸過程、速率等,十分方便。
此外,在拷貝到移動硬盤卡死的時候,由於強行拔出移動硬盤導致文件索引目錄損壞,導致Ubuntu系統無法掛載移動硬盤,並出現如下錯誤提示:
Failed to mount '/dev/sdb1': Input/output error
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.
根據上面的提示,可在Windows系統下解決:
1、Windows下 “運行”中輸入cmd進入DOS命令行窗口
2、查找移動硬盤的卷名(如G:)
3、在命令行中輸入:
chkdsk G:/f
chkdsk命令用於掃描磁盤,自動檢查並修復索引錯誤等。上述第3步指令輸入後有三個階段,如果文件數目很多的話,時間會很久,需要耐心等待修復完成。之後,在Ubuntu系統中就可以正常掛載了。