Linux fsck命令 – 檢查并修復(fù)Linux文件系統(tǒng)
fsck命令的英文全稱是“filesystem check”,即檢查文件系統(tǒng)的意思,常用于檢查并修復(fù)Linux文件系統(tǒng)的一些錯誤信息,操作文件系統(tǒng)需要先備份重要數(shù)據(jù),以防丟失。
Linux fsck命令用于檢查并修復(fù)Linux文件系統(tǒng),可以同時檢查一個或多個 Linux 文件系統(tǒng);若系統(tǒng)掉電或磁盤發(fā)生問題,可利用fsck命令對文件系統(tǒng)進行檢查。
語法格式:fsck [參數(shù)] [文件系統(tǒng)]
常用參數(shù):
-a 自動修復(fù)文件系統(tǒng),不詢問任何問題
-A 依照/etc/fstab配置文件的內(nèi)容,檢查文件內(nèi)所列的全部文件系統(tǒng)
-N 不執(zhí)行指令,僅列出實際執(zhí)行會進行的動作
-P 當(dāng)搭配”-A”參數(shù)使用時,則會同時檢查所有的文件系統(tǒng)
-r 采用互動模式,在執(zhí)行修復(fù)時詢問問題,讓用戶得以確認并決定處理方式
-R 當(dāng)搭配”-A”參數(shù)使用時,則會略過/目錄的文件系統(tǒng)不予檢查
-t 指定要檢查的文件系統(tǒng)類型
-T 執(zhí)行fsck指令時,不顯示標題信息
-V 顯示指令執(zhí)行過程
參考實例
修復(fù)壞的分區(qū)文件系統(tǒng):
[root@linuxcool ~]# fsck -t ext3 -r /usr/local
fsck from util-linux 2.23.2
e2fsck 1.42.9 (28-Dec-2013)
fsck.ext3: Is a directory while trying to open /usr/local
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193
/usr/local: status 8, rss 1232, real 0.020288, user 0.002022, sys 0.005354
顯示fsck系統(tǒng)安裝的版本號:
[root@linuxcool ~]# fsck --version
fsck from util-linux 2.23.2
作者:大學(xué)生新聞網(wǎng) 來源:大學(xué)生新聞網(wǎng)
- Linux tftp命令 – 上傳及下載文件
- tftp命令來自于英文詞組”Trivial File Transfer Protocol“的縮寫,中文譯為簡單文件傳輸協(xié)議,其功能是基于TFTP協(xié)議進行的文件傳輸工
- 03-13 關(guān)注:3