Subject: Re: dump_lfs issue
To: Marcin Michal Jessa <m.jessa@gmail.com>
From: Konrad Schroder <perseant@hhhh.org>
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",
e.g.:
# 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
#!/bin/sh
I=4
while true ## or, better, put a limit on it in case they're all bad
do
echo ALTSB=$I
BAD=`fsck_lfs -n -b $I /dev/rwd0g 2>&1 | grep -c 'BAD SUPER'`
if [ $BAD = 0 ]
then
break
fi
I=$(( $I + 1 ))
done
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
perseant@hhhh.org