https://www.slackwiki.com/index.php?title=Forced_Fsck&feed=atom&action=historyForced Fsck - Revision history2024-03-29T12:29:30ZRevision history for this page on the wikiMediaWiki 1.40.0https://www.slackwiki.com/index.php?title=Forced_Fsck&diff=214&oldid=prevRobRistroph: /* Bypassing A Hung Forced Fsck */2009-06-23T20:29:14Z<p><span dir="auto"><span class="autocomment">Bypassing A Hung Forced Fsck</span></span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 20:29, 23 June 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l36">Line 36:</td>
<td colspan="2" class="diff-lineno">Line 36:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Sometimes, a forced fsck will occur and may not complete. It may hang or just keep starting over. To (down and dirty) fix this, boot the machine from a bootable disk (3.5" or CD), DO NOT mount the unchecked filesystem and manually run fsck. You may have to run any one of three modes to complete the check:<br></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Sometimes, a forced fsck will occur and may not complete. It may hang or just keep starting over. To (down and dirty) fix this, boot the machine from a bootable disk (3.5" or CD), DO NOT mount the unchecked filesystem and manually run fsck. You may have to run any one of three modes to complete the check:<br></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>::<code>fsck -f <i>filesystem</i></code> - Force checking even if the file system seems clean.<br></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>::<code>fsck -f <i>filesystem</i></code> - Force checking even if the file system seems clean.<br></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>::<code>fsck -c <i>filesystem</i></code> - This option causes e2fsck to run the badblocks program to find any blocks which are bad on the filesystem, and then marks them as bad by adding them to the bad block inode. If this option is specified twice, then the bad block scan will be done using a non-destructive read-write test.<br></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>::<code>fsck -c <i>filesystem</i></code> - This option causes e2fsck to run the badblocks program to find any blocks which are bad on the filesystem, and then marks them as bad by adding them to the bad block inode. If this option is specified twice, then the bad block scan will be done using a non-destructive read-write test<ins style="font-weight: bold; text-decoration: none;">. Be aware that this takes a long time, such as days on large disk with the the double -c set, but it does tend to fix problematic disks when it does complete</ins>.<br></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>::<code>fsck -p <i>filesystem</i></code> - Automatically repair ("preen") the file system without any questions.<br></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>::<code>fsck -p <i>filesystem</i></code> - Automatically repair ("preen") the file system without any questions.<br></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>:::<b>NOTE: <code><i>filesystem</i></code> = boot partition (e.g. <code>/dev/hda1</code>)</b></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>:::<b>NOTE: <code><i>filesystem</i></code> = boot partition (e.g. <code>/dev/hda1</code>)</b></div></td></tr>
</table>RobRistrophhttps://www.slackwiki.com/index.php?title=Forced_Fsck&diff=114&oldid=prevErik: Copy from old2009-06-03T02:16:58Z<p>Copy from old</p>
<p><b>New page</b></p><div>[[Category:Tips]]<br />
<br />
A Forced Fsck (forced file check) happens on boot up due to one of three things:<br />
<br />
:1) The system was not cleanly shutdown previously (you just turned off the power) and the file system was not cleanly un-mounted.<br />
<br />
:2) The maximum number of sucessive re-boots (re-mounts ([[Mount Count|mount count]])) between fsck checks has been reached (you have reached [[Maximum Mount Count]]).<br />
<br />
:3) A period of time has passed between fscks that exceed the filesystem's last checked criteria.<br />
<br />
==Manually Forcing a Forced Fsck==<br />
<br />
To force a check on the next boot, simply create the file '/etc/forcefsck' and reboot:<br />
:<code>touch /etc/forcefsck</code><br />
<br />
<br />
==Bypassing A Forced Fsck==<br />
<br />
<b>METHOD 1: Increase the Mount Count/Last-checked time span-</b><br><br />
The only way to bypass a Forced Fsck is to boot the machine from another boot medium (e.g. a boot CD) and use <code>tune2fs</code> to increase the Maximum Mount Count or the Last-checked Time span.<br />
<br />
To increase the Maximum Mount Count: <code>tune2fs -c <i>new_mount_count filesystem</i></code><br><br />
EXAMPLE: <code>tune2fs -c 50 /dev/hda1</code> - This will cause a fsck after 50 re-mounts.<br />
<br />
To increase the Last-checked Time span: <code>tune2fs -i <i>new_time_span filesystem</i></code><br><br />
EXAMPLE: <code>tune2fs -i 3m /dev/hda1</code> - This will cause a fsck after 3 months.<br />
<br />
<b>GOTCHA:</b> If you are running a RAID Array, make sure you load a kernel image that supports RAID when booting! See the RAID Array tips.<br />
<br />
<br />
<b>METHOD 2: Manually run fsck-</b><br><br />
See <i>Bypassing A Hung Forced Fsck</i> instructions below.<br />
<br />
<br />
==Bypassing A Hung Forced Fsck==<br />
Sometimes, a forced fsck will occur and may not complete. It may hang or just keep starting over. To (down and dirty) fix this, boot the machine from a bootable disk (3.5" or CD), DO NOT mount the unchecked filesystem and manually run fsck. You may have to run any one of three modes to complete the check:<br><br />
::<code>fsck -f <i>filesystem</i></code> - Force checking even if the file system seems clean.<br><br />
::<code>fsck -c <i>filesystem</i></code> - This option causes e2fsck to run the badblocks program to find any blocks which are bad on the filesystem, and then marks them as bad by adding them to the bad block inode. If this option is specified twice, then the bad block scan will be done using a non-destructive read-write test.<br><br />
::<code>fsck -p <i>filesystem</i></code> - Automatically repair ("preen") the file system without any questions.<br><br />
:::<b>NOTE: <code><i>filesystem</i></code> = boot partition (e.g. <code>/dev/hda1</code>)</b><br />
<br />
<b>GOTCHA:</b> If you are running a RAID Array, make sure you load a kernel image that supports RAID when booting! See the [[RAID_Array_%28Hardware%29|RAID Array tips]].<br />
<br />
After a successful completion of anyone of the above, your filesystem's [[Mount Count|mount count]] will be reset to zero and you should be able to boot normally again.</div>Erik