Something happened when I was copying files to a ext3 drive (via network, mounted by samba) and I lost ability to write anything to this HDD. After I used dmesg command it is explained:
db: Current: sense key=0x3
ASC=0x0 ASCQ=0x0
Info fld=0xa2fce10
end_request: I/O error, dev sdb, sector 170905104
EXT3-fs error (device sdb2): read_block_bitmap: Cannot read block bitmap - block_group = 644, block_bitmap = 21102592
Aborting journal on device sdb2.
ext3_abort called.
EXT3-fs error (device sdb2): ext3_journal_start_sb: Detected aborted journal
Remounting filesystem read-only
EXT3-fs error (device sdb2) in ext3_prepare_write: IO failure
__journal_remove_journal_head: freeing b_committed_data
__journal_remove_journal_head: freeing b_committed_data
__journal_remove_journal_head: freeing b_committed_data
__journal_remove_journal_head: freeing b_committed_data
__journal_remove_journal_head: freeing b_committed_data
__journal_remove_journal_head: freeing b_committed_data
I investigated problem further and found out tha the journal is probably corrupted. It was suggested that I should: unmount drive, remove journal from filesystem using tune2sf, use e2fsck to scan drive and lastly recreate journal using tune2fs. That's the tricky part becouse the drive is flagged as needs_revocery and the journal could'nt be deleted (even when I force delete in e2fck it won't allow it). I try to change flag using debugfs but the program fails every time:
Can't read an block bitmap while reading block bitmap
I'm 99% sure that data on drive are not corrupted, and when I use e2fsck before I delete the journal it will definitley corrupt some data.
Any ideas how to remove needs_recovery flag from that drive so I will be able to delete journal?