[comp.sys.sun] Restoring by i-node?

grant@saturn.cs.swin (Grant Collins) (05/31/90)

I am running SunOS 4.0.3 and wish to extract a file from a level 0 dump
tape using restore and the files' i-node number.  This is because a
filesystem became corrupted and fsck has placed the files in lost+found
using the files' i-node as part of its name.  The good 'ol SunOS man page
for restore indicates that there is an "m" option to retrieve files by
inode rather than by name, but I cant get it to work because it keeps
wanting to use the i-number supplied as the NAME of the file to extract.
Any ideas?.. Is there any other way to recover these files??  Any help
most appreciated.

jms@tardis.tymnet.com (Joe Smith) (06/15/90)

In article <8364@brazos.Rice.edu> grant@saturn.cs.swin (Grant Collins) writes:

>I wish to extract a file from a level 0 dump tape using restore and the
>files' i-node number.  This is because a filesystem became corrupted and
>fsck has placed the files in lost+found using the files' i-node as part of
>its name.

So your basic problem is that you know the inode number, but not the
original name(s) of the file.  This information is in the dump tape's
table of contents.

	# restore tf /dev/rst8 | sort >/tmp/dump.toc
	# egrep '1234|4567|932' /tmp/dump.toc
	# restore ivf /dev/rst8
	restore> add thisfile foo/thatfile bar/otherfile
	restore> extract

The 't' option to restore gets the table of contents, which is piped into
sort to make it easier to find the other names of a file that has hard
links.  Use grep to find the inodes in question and it will print the
names associated with those files.

Joe Smith (408)922-6220 | SMTP: jms@tardis.tymnet.com or jms@gemini.tymnet.com
BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-C41    | BIX: smithjoe | 12 PDP-10s still running! "POPJ P,"
San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga speaks for me."