1 (edited by ap0 2015-05-24 15:59:55)

Topic: MicroSD corrupt?

Hello.

I am using a 8 GB MicroSD card which holds the OS that I am using in a Cubox.

Everytime I open the MicroSD with GParted it shows me a warning sign.
When I right-click and few the information it tells me that there is a bad magic number in the superblock.

After searching for a little while I have found out I could try to restore it like this:

sudo mke2fs -n /dev/xxx
# will display block numbers where superblock backups are
sudo e2fsck -b block_number /dev/xxx

I have tryed every block number but for every one I got an error.
Is the SD Card broken?

And if backup the content of the sd card with dd, will this error be transported to the new card?

Edit: this however doesn not happen if I create a partition table in windows and format is as fat32. as soon as I delete the fat32 partition and create a new one with gparted, the warning sign returns.

sudo fsck -r /dev/mmcblk0 
fsck from util-linux 2.26.1
e2fsck 1.42.12 (29-Aug-2014)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/mmcblk0

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
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>
 or
    e2fsck -b 32768 <device>

/dev/mmcblk0: status 8, rss 2536, real 0.015498, user 0.000000, sys 0.000000

2

Re: MicroSD corrupt?

Are you using the latest version of GParted Live and associated libraries and file system tools?

One of the best ways to use GParted is by booting from media containing the latest version of GParted Live.

3

Re: MicroSD corrupt?

I am using GParted under Arch Linux. The Version is 0.22.0-1.

4 (edited by gedakc 2015-05-25 19:26:39)

Re: MicroSD corrupt?

My initial thought is that there is likely at least one block/sector that is bad on the SD card.

Different file systems use different structures to store data.  Hence the ext2 file system most likely stores meta data in a different way on the disk device than fat32.  You might also discover other file systems that work initially, but might fail later due to the bad block.

The command that GParted uses to format an ext2 file system is:

mkfs.ext2 -F -L "mylabel" /path-to-partition-or-devices

where the command is executed with root privilege.

From your first post, it appears that you are comparing using an ext2 file system without a partition table (device named /dev/mmcblk0) to a fat32 file system in a partition (partition named /dev/mmcblk0p1).

Are you intending to use the SD card with or without a partition table?

If with a partition table, then you would need to create the partition table first before formatting the SD card partition with an ext2 file system.

EDIT:
Regarding if the SD card hardware is failing, I would recommend copying the files from the SD card as opposed to using dd.

5

Re: MicroSD corrupt?

I always created a partition table (msdos) before creating an actual partition.

After more research I think that the micro SD is really faulty and I should replace it.

Thank you for your help.

6

Re: MicroSD corrupt?

'Glad to help.  :-)