65 lines
2.2 KiB
HTML
65 lines
2.2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
|
|
<TITLE>Linux Ext2fs Undeletion mini-HOWTO: Obtaining the details of the inodes</TITLE>
|
|
<LINK HREF="Ext2fs-Undeletion-10.html" REL=next>
|
|
<LINK HREF="Ext2fs-Undeletion-8.html" REL=previous>
|
|
<LINK HREF="Ext2fs-Undeletion.html#toc9" REL=contents>
|
|
</HEAD>
|
|
<BODY>
|
|
<A HREF="Ext2fs-Undeletion-10.html">Next</A>
|
|
<A HREF="Ext2fs-Undeletion-8.html">Previous</A>
|
|
<A HREF="Ext2fs-Undeletion.html#toc9">Contents</A>
|
|
<HR>
|
|
<H2><A NAME="sec-obtain"></A> <A NAME="s9">9. Obtaining the details of the inodes</A></H2>
|
|
|
|
<P><CODE>debugfs</CODE> has a <CODE>stat</CODE> command which prints details about an inode.
|
|
Issue the command for each inode in your recovery list. For example, if you're
|
|
interested in inode number 148003, try this:
|
|
<P>
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
debugfs: stat <148003>
|
|
Inode: 148003 Type: regular Mode: 0644 Flags: 0x0 Version: 1
|
|
User: 503 Group: 100 Size: 6065
|
|
File ACL: 0 Directory ACL: 0
|
|
Links: 0 Blockcount: 12
|
|
Fragment: Address: 0 Number: 0 Size: 0
|
|
ctime: 0x31a9a574 -- Mon May 27 13:52:04 1996
|
|
atime: 0x31a21dd1 -- Tue May 21 20:47:29 1996
|
|
mtime: 0x313bf4d7 -- Tue Mar 5 08:01:27 1996
|
|
dtime: 0x31a9a574 -- Mon May 27 13:52:04 1996
|
|
BLOCKS:
|
|
594810 594811 594814 594815 594816 594817
|
|
TOTAL: 6
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
<P>If you have a lot of files to recover, you'll want to automate this. Assuming
|
|
that your <CODE>lsdel</CODE> list of inodes to recover in is in <CODE>lsdel.out</CODE>, try
|
|
this:
|
|
<P>
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
# cut -c1-6 lsdel.out | grep "[0-9]" | tr -d " " > inodes
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
<P>This new file <CODE>inodes</CODE> contains just the numbers of the inodes to recover,
|
|
one per line. We save it because it will very likely come in handy later on.
|
|
Then you just say:
|
|
<P>
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
# sed 's/^.*$/stat <\0>/' inodes | debugfs /dev/hda5 > stats
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
<P>and <CODE>stats</CODE> contains the output of all the <CODE>stat</CODE> commands.
|
|
<P>
|
|
<P>
|
|
<HR>
|
|
<A HREF="Ext2fs-Undeletion-10.html">Next</A>
|
|
<A HREF="Ext2fs-Undeletion-8.html">Previous</A>
|
|
<A HREF="Ext2fs-Undeletion.html#toc9">Contents</A>
|
|
</BODY>
|
|
</HTML>
|