1. 程式人生 > >Linux開機自動fsck root

Linux開機自動fsck root

fsck:file system check

/etc/default/rcS

# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.

# automatically repair filesystems with inconsistencies during boot
FSCKFIX=no
~       

/etc/rcS.d/README

The scripts in this directory whose names begin with an 'S' are
executed once when booting the system, even when booting directly into
single user mode.


The scripts are all symbolic links whose targets are located in
/etc/init.d/ .

For more information see /etc/init.d/README.

/etc/init.d/README

/usr/share/doc/debian-policy


/usr/share/doc/sysv-rc directory

 describes how the scripts in this directory work, and how the links in the /etc/rc?.d/ directories
influence system startup/shutdown.

RUNLEVEL

linux系統有多個執行級別,0~6、s,在/etc/rc.d下有7個名為rcN.d的目錄,對應系統的7個執行級別。

rcN.d目錄下都是一些符號連結檔案,這些連結檔案都指向init.d目錄下的service指令碼檔案

系統會根據指定的執行級別進入對應的rcN.d目錄,並按照檔名順序檢索目錄下的連結檔案,對於以K開頭的檔案,系統將終止對應的服務,對於以S開頭的檔案,系統將啟動對應的服務。

檢視執行級別用:runlevel

進入其它執行級別用:init N

另外init0為關機,init 6為重啟系統。

/etc/init.d/x11-common: set up the X server and ICE socket directories

兩個相關命令

df -k看現在系統的掛接和使用情況
du -ks看一個目錄的總容量。

fsck命令

指令:fsck

使用許可權 : 超級使用者

使用方式 : fsck [-sACVRP] [-t fstype] [–] [fsck-options] filesys […]

說明 : 檢查與修復 Linux 檔案系統,可以同時檢查一個或多個 Linux 檔案系統