2017年6月18日 星期日

Fsck 說明

Unix/Linux 啟動後先會檢視檔案 /etc/fstab 中的 pass 欄 (第六欄) 檢查檔案系統的次序。pass 值為 0 時表示永不檢查,非零亦由小至大逐個檢查。以下面例子,GNU/Linux 會先檢查 /dev/sda6 ,然後檢查 /dev/sda1。
proc       /proc          proc     defaults        0  0
/dev/sda6  /              ext3     defaults        0  1
/dev/sda1  /boot          ext3     defaults        0  2
/dev/sda5  none           swap     sw              0  0


fsck mount Vs umount

Q. Can I run fsck or e2fsck command when Linux file system is mounted? Do you advice to run fsck on a live file system? I am using Cent OS.
A. No. Do not run fsck on a live or mounted file system. fsck is used to check and optionally repair one or more Linux file systems. Running fsck on a mounted filesystem can usually result in disk / data corruption. So please do not do it. You have two choices
(a) Take down system to single user mode and unmout system
(b) Boot from the installation CD into rescue mode

Ref :
https://blog.gtwang.org/linux/linux-fsck-examples/
https://www.cyberciti.biz/faq/can-i-run-fsck-or-e2fsck-when-linux-file-system-is-mounted/
https://serverfault.com/questions/29889/why-cant-you-fsck-a-mounted-partition

沒有留言:

張貼留言