Date: Fri, 24 Aug 2001 11:31:42 -0500 From: Steve Price <steve@havk.org> To: hackers@freebsd.org Subject: automating fsdb? Message-ID: <20010824113142.N70621@bsd.havk.org>
next in thread | raw e-mail | index | archive | help
Is there an easy way to script interaction with fsdb? I'm trying to
rebuild a disk that failed recently and I'm searching for the inode
contains a directory that I need. However the entry in the root inode
lists the inode for the directory I'm after as 0. I know it is there
somewhere on the disk (or at least I hope it is) and I really don't
want to have to type every number between 1 and 14,292,725 to find it.
I thought if I could script fsdb I could do it much faster. In that
vein I tossed together this silly little script but I'm missing something
obvious because it doesn't work. Any suggestions besides don't do
this? :)
root@max(~)# cat foo.pl
#!/usr/bin/perl -w
open(FOO, "| fsdb /dev/vinum/mirror") or die "failed to start fsdb: $!";
print FOO "help\n";
close(FOO);
root@max(~)# ./foo.pl
** /dev/vinum/mirror
Editing file system `/dev/vinum/mirror'
Last Mounted on /a
current inode: directory
I=2 MODE=40755 SIZE=512
MTIME=Aug 11 20:41:59 2001 [0 nsec]
CTIME=Aug 11 20:41:59 2001 [0 nsec]
ATIME=Aug 21 03:01:03 2001 [0 nsec]
OWNER=root GRP=wheel LINKCNT=8 FLAGS=0 BLKCNT=2 GEN=54e262d0
fsdb (inum: 2)>
***** FILE SYSTEM STILL DIRTY *****
*** FILE SYSTEM MARKED DIRTY
*** BE SURE TO RUN FSCK TO CLEAN UP ANY DAMAGE
*** IF IT WAS MOUNTED, RE-MOUNT WITH -u -o reload
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010824113142.N70621>
