1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
7 D.9. /etc/rc.d/init.d/checkfs
9 <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
10 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
11 <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
12 "text/css" media="print" />
14 <body class="lfs" id="lfs-6.8">
15 <div class="navheader">
17 Linux From Scratch - Version 6.8
20 付録 D. ブートスクリプトと sysconfig スクリプト version-20100627
24 <a accesskey="p" href="apds08.html" title=
25 "/etc/rc.d/init.d/setclock">前のページ</a>
27 /etc/rc.d/init.d/setclock
31 <a accesskey="n" href="apds10.html" title=
32 "/etc/rc.d/init.d/mountfs">次のページ</a>
34 /etc/rc.d/init.d/mountfs
38 <a accesskey="u" href="scripts.html" title=
39 "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
42 <a accesskey="h" href="../index.html" title=
43 "Linux From Scratch - Version 6.8">ホーム</a>
47 <div class="wrap" lang="ja" xml:lang="ja">
49 <a id="checkfs" name="checkfs"></a>D.9. /etc/rc.d/init.d/checkfs
53 ########################################################################
54 # Begin $rc_base/init.d/checkfs
56 # Description : File System Check
58 # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
59 # A. Luebke - luebke@users.sourceforge.net
65 # Based on checkfs script from LFS-3.1 and earlier.
69 # 1 - File system errors corrected
70 # 2 - System should be rebooted
71 # 4 - File system errors left uncorrected
72 # 8 - Operational error
73 # 16 - Usage or syntax error
74 # 32 - Fsck canceled by user request
75 # 128 - Shared library error
77 #########################################################################
84 if [ -f /fastboot ]; then
85 boot_mesg -n "/fastboot found, will not perform" ${INFO}
86 boot_mesg " file system checks as requested."
91 boot_mesg "Mounting root file system in read-only mode..."
92 mount -n -o remount,ro / >/dev/null
95 if [ ${?} != 0 ]; then
97 boot_mesg -n "FAILURE:\n\nCannot check root" ${FAILURE}
98 boot_mesg -n " filesystem because it could not be mounted"
99 boot_mesg -n " in read-only mode.\n\nAfter you"
100 boot_mesg -n " press Enter, this system will be"
101 boot_mesg -n " halted and powered off."
102 boot_mesg -n "\n\nPress enter to continue..." ${INFO}
103 boot_mesg "" ${NORMAL}
105 ${rc_base}/init.d/halt stop
108 if [ -f /forcefsck ]; then
109 boot_mesg -n "/forcefsck found, forcing file" ${INFO}
110 boot_mesg " system checks as requested."
117 boot_mesg "Checking file systems..."
118 # Note: -a option used to be -p; but this fails e.g.
120 fsck ${options} -a -A -C -T
123 if [ "${error_value}" = 0 ]; then
127 if [ "${error_value}" = 1 ]; then
129 boot_mesg -n "WARNING:\n\nFile system errors" ${WARNING}
130 boot_mesg -n " were found and have been corrected."
131 boot_mesg -n " You may want to double-check that"
132 boot_mesg -n " everything was fixed properly."
133 boot_mesg "" ${NORMAL}
136 if [ "${error_value}" = 2 -o "${error_value}" = 3 ]; then
138 boot_mesg -n "WARNING:\n\nFile system errors" ${WARNING}
139 boot_mesg -n " were found and have been been"
140 boot_mesg -n " corrected, but the nature of the"
141 boot_mesg -n " errors require this system to be"
142 boot_mesg -n " rebooted.\n\nAfter you press enter,"
143 boot_mesg -n " this system will be rebooted"
144 boot_mesg -n "\n\nPress Enter to continue..." ${INFO}
145 boot_mesg "" ${NORMAL}
150 if [ "${error_value}" -gt 3 -a "${error_value}" -lt 16 ]; then
152 boot_mesg -n "FAILURE:\n\nFile system errors" ${FAILURE}
153 boot_mesg -n " were encountered that could not be"
154 boot_mesg -n " fixed automatically. This system"
155 boot_mesg -n " cannot continue to boot and will"
156 boot_mesg -n " therefore be halted until those"
157 boot_mesg -n " errors are fixed manually by a"
158 boot_mesg -n " System Administrator.\n\nAfter you"
159 boot_mesg -n " press Enter, this system will be"
160 boot_mesg -n " halted and powered off."
161 boot_mesg -n "\n\nPress Enter to continue..." ${INFO}
162 boot_mesg "" ${NORMAL}
164 ${rc_base}/init.d/halt stop
167 if [ "${error_value}" -ge 16 ]; then
169 boot_mesg -n "FAILURE:\n\nUnexpected Failure" ${FAILURE}
170 boot_mesg -n " running fsck. Exited with error"
171 boot_mesg -n " code: ${error_value}."
172 boot_mesg "" ${NORMAL}
177 echo "Usage: ${0} {start}"
182 # End $rc_base/init.d/checkfs
185 <div class="navfooter">
188 <a accesskey="p" href="apds08.html" title=
189 "/etc/rc.d/init.d/setclock">前のページ</a>
191 /etc/rc.d/init.d/setclock
195 <a accesskey="n" href="apds10.html" title=
196 "/etc/rc.d/init.d/mountfs">次のページ</a>
198 /etc/rc.d/init.d/mountfs
202 <a accesskey="u" href="scripts.html" title=
203 "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
206 <a accesskey="h" href="../index.html" title=
207 "Linux From Scratch - Version 6.8">ホーム</a>