Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I had recently partitioned my SDCARD to work with my phone. Added an EXT4 and FAT32 partitions. After a power failure the data got corrupted. I can still see it but it's not the same as before. I've tried the following programs:
dd
fsck:

# fsck /dev/sdd
fsck from util-linux-ng 2.17.2
e2fsck 1.41.11 (14-Mar-2010)
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdd

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>
# fsck -b 8193 /dev/sdd
fsck from util-linux-ng 2.17.2
e2fsck 1.41.11 (14-Mar-2010)
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdd

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>

That was the output when tried to fsck the whole sd card. ^
Trying to fsck the broken partition.

# fsck /dev/sdd2
fsck from util-linux-ng 2.17.2
e2fsck 1.41.11 (14-Mar-2010)
/dev/sdd2: recovering journal
fsck.ext4: unable to set superblock flags on /dev/sdd2

fsck.ext4 Tries to recover journal and fails. If i try to delete the journal it does so, fixes all of the issues but after plugging the card in and out the problem persists. Here's the output after all of the fixes it says it does.:

fsck.ext4 /dev/sdd2
e2fsck 1.41.11 (14-Mar-2010)
/dev/sdd2: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
Run journal anyway<y>? no

Clear journal<y>? yes

/dev/sdd2 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
fix fix fix ....
Restarting e2fsck from the beginning...
/dev/sdd2: recovering journal
fsck.ext4: unable to set superblock flags on /dev/sdd2


or if i say yes to run journal :

fsck.ext4 /dev/sdd2
e2fsck 1.41.11 (14-Mar-2010)
/dev/sdd2: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
Run journal anyway<y>? yes

fsck.ext4: unable to set superblock flags on /dev/sdd2


palimpset:

Error calling fsync(2) on /dev/sdd1 : I/O Error

Or when deleting the ext4 partition:

Error erasing: helper exited with exit code 1: In part_del_partition: device_file=/dev/sdd, offset=6744729600
Entering MS-DOS parser (offset=0, size=7822376960)
MSDOS_MAGIC found
looking at part 0 (offset 32256, size 6744697344, type 0x0b)
new part entry
looking at part 1 (offset 6744729600, size 1077511680, type 0x83)
new part entry
looking at part 2 (offset 0, size 0, type 0x00)
new part entry
looking at part 3 (offset 0, size 0, type 0x00)
new part entry
Exiting MS-DOS parser
MSDOS partition table detected
got it
got disk
got partition - part->type=0
committed to disk
Error calling fsync(2) on /dev/sdd: Input/output error
Cannot scrub filesystem signatures at offset=6744729600 and size=1077511680


gparted -- Attempt to write sectors 128-128 outside of partition on /dev/sdd

So my question is. What can i use to make it work again. Any low-level formatting tools? Can my card be somehow in R/O mode?

EDIT: Also ClockworkMod Recovery seems to not be able to partition/format it. It just says it completed the operation but nothing changes.

EDIT : DMESG | tail when insterted the card :

[11648.890236] sd 6:0:0:2: [sdd] CDB: Write(10): 2a 00 00 d9 02 3c 00 00 10 00
[11648.890257] end_request: I/O error, dev sdd, sector 14221884
[11649.270320] sd 6:0:0:2: [sdd] Unhandled sense code
[11649.270327] sd 6:0:0:2: [sdd]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[11649.270336] sd 6:0:0:2: [sdd]  Sense Key : Medium Error [current]
[11649.270345] sd 6:0:0:2: [sdd]  Add. Sense: Write error - auto reallocation failed
[11649.270357] sd 6:0:0:2: [sdd] CDB: Write(10): 2a 00 00 e5 04 7c 00 00 18 00
[11649.270378] end_request: I/O error, dev sdd, sector 15008892
[11649.272333] JBD2: recovery failed
[11649.272342] EXT4-fs (sdd2): error loading journal


It seems the superblock/journal failure affected only the EXT4 partition, i can successfully mount the FAT32 partition.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.