On Sat, 22 Aug 2009 19:36:12 +0300, Yuri Chislov wrote:
> On Saturday 22 August 2009 19:21:39 Ryusuke Konishi wrote:
> > What will happen if you run the attached script?
> >
> > $ chmod +x find-root.sh
> > $ sudo ./find-root.sh <device> 10938 | tee -a segment-with-root-inode.log
> Done.
>
> Log file attached.
>
> Thanks.
> Yuri.
Ah, sorry. Pattern matching of the script was incomplete.
Could you retry with the revised script?
If the new script find the blocks storing the root inode, it will also
dump them to files like:
ifile-2-seg649-1329203
ifile-2-seg649-1329259
ifile-2-seg649-1329315
ifile-2-seg649-1329372
ifile-2-seg649-1329428
ifile-2-seg649-1329455
Then, we can see if the root inode is actually broken or not.
Thanks,
Ryuske Konishi
#!/bin/bash
cmd=`basename $0`
blocksize=4k
function die() { echo "$1" 1>&2; exit 1; }
test -n "$1" -a -n "$2" -a -b "$1" || die "usage: $cmd <device> <segnum>"
dev=$1
for (( i=$2; i >= 0; i-- )); do
hit=`dumpseg $dev $i | sed -ne '/ino = 6,/,/finfo/{p}' | sed -ne "/blkoff
= 2,/{s/^.* blocknr = \([0-9]\+\).*$/\1/p}"`
if [ -n "$hit" ]; then
echo "$cmd: root inode found in segnum=$i"
dumpseg $dev $i
for b in $hit; do
echo "$cmd: dump root inode block: blocknr=$b"
dd if=$dev of=ifile-2-seg${i}-${b} bs=$blocksize skip=$b count=1
done
exit 0
fi
done
die "$cmd: root inode not found"
_______________________________________________
users mailing list
[email protected]
https://www.nilfs.org/mailman/listinfo/users