Files
oldlinux-files/docs/Install-Guide/install-guide-2.2.2/node194.html
2024-02-19 00:23:35 -05:00

62 lines
3.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE>4.11.3 Fixing trashed filesystems</TITLE>
</HEAD>
<BODY>
<meta name="description" value="4.11.3 Fixing trashed filesystems">
<meta name="keywords" value="gs">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<BR> <HR><A NAME=tex2html4229 HREF="node195.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html4227 HREF="node191.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html4221 HREF="node193.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html4231 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html4232 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html4230 HREF="node195.html">4.11.4 Recovering lost files</A>
<B>Up:</B> <A NAME=tex2html4228 HREF="node191.html">4.11 What To Do </A>
<B> Previous:</B> <A NAME=tex2html4222 HREF="node193.html">4.11.2 Fixing the root </A>
<BR> <HR> <P>
<H2><A NAME=SECTION006113000000000000000>4.11.3 Fixing trashed filesystems</A></H2>
<P>
<A NAME=5136>&#160;</A>
<A NAME=5171>&#160;</A>
<A NAME=5172>&#160;</A>
If you somehow trash your filesystems, you can run <tt>e2fsck</tt>
(if you use the ext2fs filesystem type, that is) to correct any
damaged data on the filesystems from floppy. Other filesystem types use
different forms of the <tt>fsck</tt> command; see
Section <A HREF="node184.html#secmanagefs">4.8</A> for details.
<P>
When checking your filesystems from floppy, it's best for the
filesystems to not be mounted.
<P>
<A NAME=5142>&#160;</A>
<A NAME=5143>&#160;</A>
One common cause of filesystem damage is superblock corruption.
The <em>superblock</em> is the ``header'' of the filesystem that contains
information on the filesystem status, size, free blocks, and so forth.
If you corrupt your superblock (for example, by accidentally writing
data directly to the filesystem's partition), the system may not
recognize the filesystem at all. Any attempt to mount the filesystem
could fail, and <tt>e2fsck</tt> won't be able to fix the problem.
<P>
Happily, the <em>ext2fs</em> filesystem type saves copies of the superblock
at ``block group'' boundaries on the drive---usually, every 8K blocks.
In order to tell <tt>e2fsck</tt> to use a copy of the superblock, you can
use a command such as
<P><TT> # <em>e2fsck -b 8193 <IMG BORDER=0 ALIGN=BOTTOM ALT="" SRC="img264.gif"></em>
<P></TT>
where <IMG BORDER=0 ALIGN=BOTTOM ALT="" SRC="img265.gif"> is the partition on which the filesystem resides.
The <tt>-b 8193</tt> option tells <tt>e2fsck</tt> to use the copy of the superblock
stored at block 8193 in the filesystem.
<P>
<BR> <HR><A NAME=tex2html4229 HREF="node195.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html4227 HREF="node191.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html4221 HREF="node193.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html4231 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html4232 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html4230 HREF="node195.html">4.11.4 Recovering lost files</A>
<B>Up:</B> <A NAME=tex2html4228 HREF="node191.html">4.11 What To Do </A>
<B> Previous:</B> <A NAME=tex2html4222 HREF="node193.html">4.11.2 Fixing the root </A>
<BR> <HR> <P>
<BR> <HR>
<P><ADDRESS>
<I>Matt Welsh <BR>
mdw@sunsite.unc.edu</I>
</ADDRESS>
</BODY>