Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] ext3: illegal bitmap block(s)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
maxima
Apprentice
Apprentice


Joined: 01 Oct 2004
Posts: 150

PostPosted: Fri Dec 08, 2006 5:46 pm    Post subject: [SOLVED] ext3: illegal bitmap block(s) Reply with quote

hi, I have Gentoo in software raid + lvm2 setup with 2 identical SATA harddrives. This morning one of the hdd decided to go undetected (this happens quite often don't know why, I have to unplug the cables and plug back in to get detected again) forced me to do hard reboot. Usually fsck worked nicely if I had uncleaned shutdown like this but this time it failed. When I run fsck manually I got this:
Code:

Group descriptors looks bad... trying backup blocks...
Block bitmap for group 256 is not in group.  (block 3572396)
Relocate<y>?yes

*snip*

Block bitmap for group 383 is not in group.  (block 0)
Relocate<y>?yes

Inode bitmap for group 383 is not in group.  (block 0)
Relocate<y>?yes

Inode table for group 383 is not in group.  (block 0)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>?yes

fsck.ext3: e2fsck_read_bitmaps: illegal bitmap block(s) for /dev/main/home


My partition layout is the same like Gentoo Software RAID + LVM2 quick install guide. Boot & root partition s are on raid1 and the rest raid0 + lvm2.

I found similar post here https://forums.gentoo.org/viewtopic-t-433796.html but I don't know how to edit hex. I can post my blockfile but I don't know where to host it. Does anyone know where I can host for free and quick. Also found this blog post http://pof.eslack.org/blog/2005/09/20/recuperant-una-particio-ext3/ which I couldn't understand since I don't speak the language.

Any help will be appreciated. Thank you.


Last edited by maxima on Tue Dec 12, 2006 5:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
maxima
Apprentice
Apprentice


Joined: 01 Oct 2004
Posts: 150

PostPosted: Sat Dec 09, 2006 5:35 pm    Post subject: Reply with quote

bump
anyone?
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Sat Dec 09, 2006 11:38 pm    Post subject: Reply with quote

maxima wrote:
I found similar post here https://forums.gentoo.org/viewtopic-t-433796.html but I don't know how to edit hex.

One approach would be: use dd (sys-apps/coreutils) to collect the data to be modified, then use xxd (app-editors/vim-core) to produce a textual representation of the data, then edit the textual representation with your choice of editor, then use xxd to reconvert the text to its binary equivalent, then use dd to place the modified data over the original.
Back to top
View user's profile Send private message
maxima
Apprentice
Apprentice


Joined: 01 Oct 2004
Posts: 150

PostPosted: Sun Dec 10, 2006 5:44 pm    Post subject: Reply with quote

Looks like my problem is not as simple, that post had only one corrupted group and mine from group 256 to 383 so I don't think hex edit is an option for me.

I tried to copy partition to another partition using dd but I got this error
Code:
% dd if=/dev/main/home of=/dev/sda6
dd: reading `/dev/main/home': Input/output error
104704+0 records in
104704+0 records out
53608448 bytes (54 MB) copied, 24.4576 seconds, 2.2 MB/s

% dmesg | tail
ata1: error=0x40 { UncorrectableError }
ata1: translated ATA stat/err 0x51/40 to SCSI SK/ASC/ASCQ 0x3/11/04
ata1: status=0x51 { DriveReady SeekComplete Error }
ata1: error=0x40 { UncorrectableError }
sd 0:0:0:0: SCSI error: return code = 0x8000002
sda: Current: sense key=0x3
    ASC=0x11 ASCQ=0x4
Info fld=0x19f607e
end_request: I/O error, dev sda, sector 27222141
Buffer I/O error on device dm-7, logical block 13088


dd-ing other logical volumes under the same volume group works fine.
Any suggestion?
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Mon Dec 11, 2006 3:31 am    Post subject: Reply with quote

Collect whatever data you can, clever use of dd might allow for the retention of a significant portion of the contents of the partition. Once the data has been archived evaluate the drive, as it appears to be failing. The package sys-apps/smartmontools may be of use in the evaluation.
Back to top
View user's profile Send private message
maxima
Apprentice
Apprentice


Joined: 01 Oct 2004
Posts: 150

PostPosted: Mon Dec 11, 2006 5:39 am    Post subject: Reply with quote

I think you are right my drive is failing, it couldn't finish selftest. Very short-lived, it's only a few months old.
Code:
% smartctl -l selftest -d ata /dev/sda
smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed: read failure       90%      1285         27222142
# 2  Extended offline    Completed: read failure       90%      1285         27222142
# 3  Short offline       Completed without error       00%      1285         -
# 4  Extended offline    Aborted by host               90%      1285         -


% smartctl -i -d ata /dev/sda
smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model:     WDC WD2500JS-00NCB1
Serial Number:    WD-WCANK5494080
Firmware Version: 10.02E02
User Capacity:    250,059,350,016 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   7
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Mon Dec 11 16:14:50 2006 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


Now another test is running on my second hdd. I'm going to test again using WD diagnostic tool later. Meanwhile any tips on how should I backup my data? I still can access other partitions except my home dir. I still have 200 GB unpartitioned space on both /dev/sda and /dev/sdb. Here's my partition layout
Code:
/boot     /dev/md1       RAID-1 mirror (/dev/sda1 & /dev/sdb1)
/         /dev/md3       RAID-1 mirror (/dev/sda3 & /dev/sdb3)
rest      /dev/md5       RAID-0 strip (/dev/sda5 & /dev/sdb5) + LVM2

LVM2 partitions:
  /dev/main/usr
  /dev/main/var
  /dev/main/opt
  /dev/main/tmp
  /dev/main/home
  /dev/main/portage
  /dev/main/distfiles
  /dev/main/vartmp

Oh and how do I use dd cleverly to recover data from my corrupted partition? Thank you very much.
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Tue Dec 12, 2006 5:36 am    Post subject: Reply with quote

Use some other, trusted, storage device with greater free space than the size of the partition being recovered.
Copy data from the partition to the other device until an error occurs.
Retry copying data from the area which raised the error, if it fails skip a small chunk of data from the partition and add a block of empty space to the recovered image.
Proceed in the above manner until either all of the partition has been copied or the drive fails.
Merge the chunks into a single image.
Run fsck against (preferably a copy of) the image of the partition.
Mount the image with the corrected filesystem.
Copy out any files you intend to retain.

The clever part comes in when skipping over sections which induce errors and again when merging the chunks back together, I do not recommend that anyone not intimately familiar with dd try stitching such an image together as it is created. You should keep detailed notes, and read the dd documentation very carefully.

The above process can be storage intensive and has not been tested, proceed at your own risk. That, and it depends on dd working in a fashion which I recall having been patched in some time ago, though I do not know whether that behavior was integrated into the standard coreutils version or not. For reference the behavior just mentioned is to actually skip when instructed to skip instead of reading and discarding when instructed to skip.

maxima wrote:
I think you are right my drive is failing, it couldn't finish selftest. Very short-lived, it's only a few months old.
If it is still under warranty it might be possible to acquire its warranty replacement prior to returning the failing unit, by providing the SMART data.
Back to top
View user's profile Send private message
maxima
Apprentice
Apprentice


Joined: 01 Oct 2004
Posts: 150

PostPosted: Tue Dec 12, 2006 5:00 pm    Post subject: Reply with quote

Good news. I am able to recover almost all my data, I think I only lost 1 album of music but I have them in backup. Here are the steps I did.

1. I was able to dd successfully using this command (dd-ing 50GB took a very very long time).
Code:
dd if=/dev/main/home of=/dev/sdb7 conv=noerror,sync


2. Reinitialize superblock and group descriptors
Code:
 mke2fs -S /dev/sdb7


3. fsck it
Code:
e2fsck -y /dev/sdb7


4. mount /dev/sdb7 and I found my data in lost+found folder

Thanks a lot for your help desultory.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum