Subject: Re: dump_lfs issue
To: Marcin Michal Jessa <>
From: Konrad Schroder <>
List: current-users
Date: 04/30/2007 15:26:34
On Mon, 30 Apr 2007, Marcin Michal Jessa wrote:

> I ran dump_lfs  -0u -f /dev/xbd0i /home/mail
> It seems like I instead dumped empty dir - /home/mail to /dev/xbd0i
> Is that correct?

Oh, I had hoped to get some more information from you about your 
filesystem while in the "fsck says it's okay but the kernel panics" state.

Unfortunately, yes, it looks like that is what happened.  dump has to be 
used in conjunction with restore, so to do what you were trying to do, you 
wanted something like

   dump_lfs -0 -f- /dev/xbd0i | (cd /home/mail; restore xf -)

If you know what parameters you gave to newfs_lfs when you created the 
filesystem, and you did not use the -A parameter, you can add "-N" and it 
should give you a list of alternate superblocks to give to fsck_lfs "-b", 

   # newfs_lfs -N -f 1024 -b 8192 /dev/rwhatever
   Creating a version 2 LFS with roll-forward ident 0x28bb39e1
   3072.0MB in 3072 segments of size 1048576
   307 segments held in reserve, 154 for cleaner only
   super-block backups (for fsck -b #) at:
   16, 628736, 1257472, 1886208, 2514944, 3143680, 3772416, 4401152, 5029888, 5658624.

   # fsck_lfs -b 628736 /dev/rwhatever

If you did use -A, you may have to search the disk for superblocks.  I 
don't have a tool that does this, but something like


   while true   ## or, better, put a limit on it in case they're all bad
       echo ALTSB=$I
       BAD=`fsck_lfs -n -b $I /dev/rwd0g 2>&1 | grep -c 'BAD SUPER'`
       if [ $BAD = 0 ]
       I=$(( $I + 1 ))
   echo ALTSB=$I

ought to work, albeit slowly.

The result of running fsck_lfs on the filesystem once you have determined 
a good alternate superblock, we hope, can be dumped with dump_lfs.

Take care,
 						Konrad Schroder