1. es war die frage bei debugfs nicht dumpefsklopskuchen wrote:dumpe2fs will bei mir keinen alternativen Superblock. e2fsck schon.
2. alle 3 ( e2fsck , debugfs, dumpe2fs ) akzeptieren einen Alternativsuperblock, sowie eine Blockgrössenangabe .....
Auszüge aus den Manpages :
e2fsck
Code: Select all
-b superblock
Instead of using the normal superblock, use an alternative superblock specified by superblock. This option is normally used
when the primary superblock has been corrupted. The location of the backup superblock is dependent on the filesystem's
blocksize. For filesystems with 1k blocksizes, a backup superblock can be found at block 8193; for filesystems with 2k
blocksizes, at block 16384; and for 4k blocksizes, at block 32768.
Additional backup superblocks can be determined by using the mke2fs program using the -n option to print out where the
superblocks were created. The -b option to mke2fs, which specifies blocksize of the filesystem must be specified in order
for the superblock locations that are printed out to be accurate.
If an alternative superblock is specified and the filesystem is not opened read-only, e2fsck will make sure that the primary
superblock is updated appropriately upon completion of the filesystem check.
-B blocksize
Normally, e2fsck will search for the superblock at various different block sizes in an attempt to find the appropriate
block size. This search can be fooled in some cases. This option forces e2fsck to only try locating the superblock
at a particular blocksize. If the superblock is not found, e2fsck will terminate with a fatal error.
Code: Select all
-b blocksize
Forces the use of the given block size for the file system, rather than detecting the correct block size as normal.
-s superblock
Causes the file system superblock to be read from the given block number, rather than the default (1). If you give a -s option, you must
also give a -b option.
Code: Select all
-ob superblock
use the block superblock when examining the filesystem. This option is not usually needed except by a filesystem wizard who is examining
the remains of a very badly corupted filesystem.
-oB blocksize
use blocks of blocksize bytes when examining the filesystem. This option is not usually needed except by a filesystem wizard who is exam-
ining the remains of a very badly corupted filesystem.
laut meiner manpage ( und auch der Fehlermeldung" von e2fsck ohne gleichheitszeichen >>>klopskuchen wrote:Allerdings hast du einen Syntaxfehler gemacht. Mit "e2fsck -b $z /dev/hdb2" nimmt das Programm immer Block 0. Es fehlt das Gleichheitszeichen:
e2fsck -b=$z /dev/hdb2
Code: Select all
:~ # e2fsck -b 33 /dev/hdb2
e2fsck 1.35 (28-Feb-2004)
e2fsck: Bad magic number in super-block while trying to open /dev/hdb2
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
:~ # e2fsck -b=33 /dev/hdb2
e2fsck 1.35 (28-Feb-2004)
e2fsck: Bad magic number in super-block while trying to open /dev/hdb2
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
Na ja - Das "alte" Script arbeitete mit verschachtelten for-schleifen -klopskuchen wrote:Wenn die erste Suche bei Block 10000000 erfolgte, hast du ein Offset von mindestens >3GB (bei 512Bytes per Block, das achtfache bei 4096Byes per Block).
1-9 = 1 for schleife, 10-99 2 for schleifen, 100-999 3 ......
und Udo M. ( gast ) stellte in Frage was da rauskommt :
x=x1$x2$x3$x4$x5$x6$x7$x8 ( 8 verschachtelte For-Schleifen )
ergibt echo $x nun x10000000 oder 10000000
aber mit der Runderneuerung via while-schleife denke ich das ganze eleganter gelöst zu haben
Code: Select all
#!/bin/sh
x=0
while [ $x -le 28596456 ]; do
((++x))
y=0
while [ $y -le 65536 ]; do
((++y))
nice -n 20 dumpe2fs -oB $y -ob $x /dev/hdb2
nice -n 20 debugfs -b $y -s $x -c -R quit /dev/hdb2
nice -n 20 e2fsck -B $y -b $x /dev/hdb2
echo Ende Schleifendurchlauf Subblock $x $y
done
echo
echo Ende Schleifendurchlauf Block $x
echo
done