8 Dec 2009 17:48
botched RAID, now e2fsck or what?
Lucian Șandor <lucisandor <at> gmail.com>
2009-12-08 16:48:18 GMT
2009-12-08 16:48:18 GMT
Hi all, Somehow I managed to mess with a RAID array containing an ext3 partition. Parenthesis, if it matters: I disconnected physically a drive while the array was online. Next thing, I lost the right order of the drives in the array. While trying to re-create it, I overwrote the raid superblocks. Luckily, the array was RAID5 degraded, so whenever I re-created it, it didn't go into sync; thus, everything besides the RAID superblocks is preserved (or so I think). Now, I am trying to re-create the array in the proper order. It takes me countless attempts, through hundreds of permutations. I am doing it programatically, but I don't think I have the right tool. Now, after creating the array and mounting it with mount -t ext3 -n -r /dev/md2 /media/olddepot I issue an: e2fsck -n -f /media/olddepot However, I cycled through all the permutations without apparent success. I.e., in all combinations it just refused to check it, saying something about "short read" and, of course, about invalid file systems. Does anybody know a better tool to check whether the mounted partition is a slightly damaged ext3 file system? I am thinking about dumping ext3 superblocks, but I don't know how that works. Thanks. (I am on the latest openSuSE, 11.2, with the latest mdadm available.)(Continue reading)
> Question 1: Is there a way to make dumpe2fs or another command
> estimate the number of files in what appears to be an ext3 partition?
I can only think of:
$ dumpe2fs -h /dev/loop0 | egrep 'Inode count|Free inodes'
The difference between both values should be the used inodes, i.e.
files/directories on the filesystem.
> Question: if I were to struck lucky and find the right combination,
> would dumpe2fs give me a very-very long list of superblocks?
The superblock count depends on how the fs was initially created. I could
imagine that the list is longer for a real filesystem, as "garbage"
won't have any superblocks at all.
> superblocks extend far into the partition, or do they always stop
RSS Feed