347 lines
5.6 KiB
HTML
347 lines
5.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Directory And File Management</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="The Linux FAQ"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Application Software Management"
|
|
HREF="app-management.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Connecting To A Network"
|
|
HREF="networking.html"></HEAD
|
|
><BODY
|
|
CLASS="sect1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>The Linux FAQ</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="app-management.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="networking.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="file-management"
|
|
></A
|
|
>10. Directory And File Management</H1
|
|
><DIV
|
|
CLASS="qandaset"
|
|
><DL
|
|
><DT
|
|
>Q: <A
|
|
HREF="file-management.html#undelete-files"
|
|
>How Do I Undelete Files?</A
|
|
></DT
|
|
><DT
|
|
>Q: <A
|
|
HREF="file-management.html#how-do-i-make-backups"
|
|
>How Do I Make Backups?</A
|
|
></DT
|
|
><DT
|
|
>Q: <A
|
|
HREF="file-management.html#defragmenter-for-ext2fs-etc]]"
|
|
>Is There a Defragmenter for Ext2fs?</A
|
|
></DT
|
|
></DL
|
|
><DIV
|
|
CLASS="qandaentry"
|
|
><DIV
|
|
CLASS="question"
|
|
><P
|
|
><A
|
|
NAME="undelete-files"
|
|
></A
|
|
><B
|
|
>Q: </B
|
|
>How Do I Undelete Files?</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="answer"
|
|
><P
|
|
><B
|
|
>A: </B
|
|
>In general, this is very hard to do on unices because of their
|
|
multitasking nature. Undelete functionality for the <I
|
|
CLASS="citetitle"
|
|
>ext2fs</I
|
|
>
|
|
file system is being worked on, but don't hold your breath.
|
|
</P
|
|
><P
|
|
>There are a number of packages available which
|
|
instead provide new commands for deleting and copying which move deleted
|
|
files into a "wastebasket" directory. The files can be recovered until
|
|
cleaned out automatically by background processing.
|
|
</P
|
|
><P
|
|
>The Midnight Commander file manager provides an undelete facility that uses Ext2
|
|
file system library functions and an undelete directory for each file system.
|
|
Commercial distribution packages of MC may or may not have this feature
|
|
enabled, so be sure to look in the source code distribution for instructions
|
|
on how to enable the undelete feature.
|
|
</P
|
|
><P
|
|
>Alternatively, you can
|
|
search the raw disk device which holds the file system in question. This is
|
|
hard work, and you will need to be logged in as root to do this. But it can
|
|
be done. Run <B
|
|
CLASS="command"
|
|
>grep</B
|
|
> on the raw device; e.g.:
|
|
</P
|
|
><P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
> grep -b 'bookmarks' /dev/hda</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
><P
|
|
>If the data has not been overwritten, you should be able to recover it with a text editor.
|
|
</P
|
|
><P
|
|
>[Dave Cinege, Daniel Novotny]
|
|
</P
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="qandaentry"
|
|
><DIV
|
|
CLASS="question"
|
|
><P
|
|
><A
|
|
NAME="how-do-i-make-backups"
|
|
></A
|
|
><B
|
|
>Q: </B
|
|
>How Do I Make Backups?</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="answer"
|
|
><P
|
|
><B
|
|
>A: </B
|
|
>You can back up a directory hierarchy or complete
|
|
file system to any media using GNU <B
|
|
CLASS="command"
|
|
>tar</B
|
|
> or <B
|
|
CLASS="command"
|
|
>cpio</B
|
|
>,
|
|
the standard *nix tools for this purpose. <B
|
|
CLASS="command"
|
|
>tar</B
|
|
> seems to be the more
|
|
commonly used program currently, and includes command line options to make compressed, incremental, and
|
|
multi-volume backups. Complete information is contained in the documentation,
|
|
which is in GNU Texinfo format.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="answer"
|
|
><P
|
|
><B
|
|
>A: </B
|
|
>The free program, <SPAN
|
|
CLASS="application"
|
|
>Amanda</SPAN
|
|
>, receives a lot of mentions on Usenet. Its home page is <A
|
|
HREF="http://www.amanda.org"
|
|
TARGET="_top"
|
|
><I
|
|
CLASS="citetitle"
|
|
>http://www.amanda.org</I
|
|
></A
|
|
>.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="answer"
|
|
><P
|
|
><B
|
|
>A: </B
|
|
>Several commercial backup utilities also exist. They are often included in commercial
|
|
distributions.
|
|
</P
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="qandaentry"
|
|
><DIV
|
|
CLASS="question"
|
|
><P
|
|
><A
|
|
NAME="defragmenter-for-ext2fs-etc]]"
|
|
></A
|
|
><B
|
|
>Q: </B
|
|
>Is There a Defragmenter for Ext2fs?</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="answer"
|
|
><P
|
|
><B
|
|
>A: </B
|
|
>Yes. There is <SPAN
|
|
CLASS="application"
|
|
>defrag</SPAN
|
|
>, a Linux file system defragmenter
|
|
for <I
|
|
CLASS="citetitle"
|
|
>ext2</I
|
|
>, <I
|
|
CLASS="citetitle"
|
|
>Minix</I
|
|
>,
|
|
and old-style <I
|
|
CLASS="citetitle"
|
|
>ext</I
|
|
> file systems. It is available at
|
|
<A
|
|
HREF="ftp://metalab.unc.edu/pub/Linux/system/filesystems/defrag-0.70.tar.gz"
|
|
TARGET="_top"
|
|
><I
|
|
CLASS="citetitle"
|
|
>ftp://metalab.unc.edu/pub/Linux/system/filesystems/defrag-0.70.tar.gz</I
|
|
></A
|
|
>.
|
|
Users of the <I
|
|
CLASS="citetitle"
|
|
>ext2</I
|
|
>
|
|
file system can probably do without <SPAN
|
|
CLASS="application"
|
|
>defrag</SPAN
|
|
>,
|
|
because <I
|
|
CLASS="citetitle"
|
|
>ext2</I
|
|
> contains extra code to keep fragmentation
|
|
reduced even in very full file systems.
|
|
</P
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="app-management.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="networking.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Application Software Management</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Connecting To A Network</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |