From owner-freebsd-hackers Fri Aug 24 9:31:48 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.hiwaay.net (fly.HiWAAY.net [208.147.154.56]) by hub.freebsd.org (Postfix) with ESMTP id 4DE5B37B401 for ; Fri, 24 Aug 2001 09:31:45 -0700 (PDT) (envelope-from steve@havk.org) Received: from bsd.havk.org (user-24-214-56-224.knology.net [24.214.56.224]) by mail.hiwaay.net (8.11.6/8.11.6) with ESMTP id f7OGViS22249 for ; Fri, 24 Aug 2001 11:31:44 -0500 (CDT) Received: by bsd.havk.org (Postfix, from userid 1001) id 940FA1A85D; Fri, 24 Aug 2001 11:31:42 -0500 (CDT) Date: Fri, 24 Aug 2001 11:31:42 -0500 From: Steve Price To: hackers@freebsd.org Subject: automating fsdb? Message-ID: <20010824113142.N70621@bsd.havk.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Operating-System: FreeBSD 4.3-STABLE i386 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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