• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Corrupted filesystem just after mkfs?  (Read 5416 times)
paulo_raca
Newbie
*

Karma: 0
Posts: 5


View Profile
« on: October 15, 2009, 08:39:52 PM »

Hi folks!
I'm having some issues with my SD storage.

I've formatted it with ext3. Didn't do anything with it, simply tried to mount, dmesg says:
JBD: no valid journal superblock found
EXT3-fs: error loading journal.


If I try to fsck it, I get
Superblock has an invalid journal (inode 8 ).
Erase<y>?


At first I though it was a bad card, but I've already tried 3 different SDs. Doing the same with a USB drive works OK.

My fdisk partitions:
Disk /dev/sdb: 16.5 GB, 16525033472 bytes
224 heads, 56 sectors/track, 2572 cylinders
Units = cylinders of 12544 * 512 = 6422528 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               8        2572    16087680   83  Linux


The command I used to mkfs:
mkfs.ext2 /dev/mmcblk0p1 -m 0 -b 4096 -j -J size=16 -L SD

Have anyone faced this problem? Any ideas?
Logged

dattaway
Jr. Member
**

Karma: 5
Posts: 91



View Profile WWW
« Reply #1 on: October 15, 2009, 09:01:15 PM »

mkfs.ext3

Simple, yet effective alternative command compared to forcing mkfs.ext2 to create a journal.
Logged

paulo_raca
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #2 on: October 15, 2009, 09:07:44 PM »

Tried that, too =(
Logged

adapted.cat
Newbie
*

Karma: 0
Posts: 12


View Profile
« Reply #3 on: October 15, 2009, 09:10:09 PM »

Unless you have a typo in you mkfs line, you're formatting with EXT2 and mounting with EXT3. That might cause some problems! Adding the journal options to mkfs.ext2 obviously isn't working.

Think of EXT3 as EXT2 with added journal data. If you mount an EXT3 partition as EXT2, it should work, but going the other way won't.

In any case, on an SD card, the card itself has an internal journal for the purpose of wear-levelling. Formatting with a journalling filesystem such as EXT3, JFS or XFS is both unnecessary and bad for performance. What you should be using on an SD card is either FAT or EXT2. Both of those are mature and stable in Linux.

Try formatting and mounting with plain EXT2, and see if that fixes the problem. For performance reasons don't fotget to put "noatime" in the mount options (in /etc/fstab, or after "-o" at the command line).

You might also want to reset the partition table. See http://plugcomputer.org/plugwiki/index.php/SD_Card_As_Root_File_System for details.

PS: XFS has serious usability problems with the plug even on USB HD partitions, which lead to log/superblock corruption almost immediately after filesystem creation - avoid it until they fix that.
Logged

paulo_raca
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #4 on: October 15, 2009, 09:33:08 PM »

I am able to mount it after formatting with ext2, but fsck makes me uneasy:

First run of fsck:
$ sudo fsck /dev/sdb1 -f
fsck from util-linux-ng 2.16
e2fsck 1.41.9 (22-Aug-2009)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Padding at end of block bitmap is not set. Fix<y>? yes


SD: ***** FILE SYSTEM WAS MODIFIED *****
SD: 11/1009856 files (0.0% non-contiguous), 73230/4032889 blocks


Second run:
$ sudo fsck /dev/sdb1 -f
fsck from util-linux-ng 2.16
e2fsck 1.41.9 (22-Aug-2009)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -(1968505--1998847) -(2001273--2031615) -(2034041--2064383) -(2066809--2097151) -(2099577--2129919) -(2132345--2162687) -(2165113--2195455) -(2197881--2228223) -(2230649--2260991) -(2263417--2293759) -(2296185--2326527) -(2328953--2359295) -(2361721--2392063) -(2394489--2424831) -(2427257--2457599) -(2460025--2490367) -(2492793--2523135) -(2525561--2555903) -(2558329--2588671) -(2591097--2621439) -(2623865--2654207) -(2689401--2719743) -(2722169--2752511) -(2754937--2785279) -(2787705--2818047) -(2820473--2850815) -(2853241--2883583) -(2886009--2916351) -(2918777--2949119) -(2951545--2981887) -(2984313--3014655) -(3017081--3047423) -(3049849--3080191) -(3082617--3112959) -(3115385--3145727) -(3148153--3178495) -(3180921--3211263) -(3213689--3244031) -(3246457--3276799) -(3279225--3309567) -(3311993--3342335) -(3344761--3375103) -(3377529--3407871) -(3410297--3440639) -(3443065--3473407) -(3475833--3506175) -(3508601--3538943) -(3541369--3571711) -(3574137--3604479) -(3606905--3637247) -(3639673--3670015) -(3672441--3702783) -(3705209--3735551) -(3737977--3768319) -(3770745--3801087) -(3803513--3833855) -(3836281--3866623) -(3869049--3899391) -(3901817--3932159) -(3934585--3964927) -(3967353--3997695) -(4000121--4030463)
Fix<y>? yes


SD: ***** FILE SYSTEM WAS MODIFIED *****
SD: 11/1009856 files (0.0% non-contiguous), 73230/4032889 blocks


Running it more times result in the same output as the last one.
Logged

DamonHD
Full Member
***

Karma: 4
Posts: 169


View Profile WWW
« Reply #5 on: October 15, 2009, 11:59:58 PM »

Silly question: did you fdisk and then mount the correct partition?

I have formatted two SD cards (8GB ad 32GB) and a USB 128GB flash drive, each with multiple partitions without problems:

http://www.earth.org.uk/note-on-SheevaPlug-setup.html#storage

Rgds

Damon
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #6 on: October 16, 2009, 12:49:23 PM »

In other words, show the entire log starting with mkfs - not just the fsck output.
Logged

paulo_raca
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #7 on: October 16, 2009, 08:10:14 PM »

Thanks for the help, guys.
DamonHD, I actually was using your page as my reference Wink

I've now formatted it as vfat, which doestn't give any error. To check if things were ok, I copied the same file to it 4 times, and used md5sum to check if it was OK. The first copy had the correct checksum, but the other 3 got corrupted:
Quote
$ md5sum *
c660c7998006aa113dc66978c489b346  SACRED_PLANET_1.ISO
5619a1ca23934c4bf5a4e24cc4709919  SACRED_PLANET_2.ISO
ad38abb71e390e0e0e83b59ac66738b6  SACRED_PLANET_3.ISO
0cacdfeecd582f3779ae525ac118a007  SACRED_PLANET_4.ISO


I have now tried formatting my pendrive as ext3. Used exactly the same commands I was using for memory cards, except that, with it, everything works!
No fsck errors, no corrupter files, all good. =)
After that, I've tried with a MemoryStick Duo and had exactly the same errors described with the SD cards. =(

This is output of mkfs:
Quote
$ sudo mkfs.ext2 /dev/sdb1
mke2fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1009856 inodes, 4032889 blocks
201644 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4131389440
124 block groups
32768 blocks per group, 32768 fragments per group
8144 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
Quote
$ sudo fsck /dev/sdb1 -f -C
fsck from util-linux-ng 2.16
e2fsck 1.41.9 (22-Aug-2009)
Pass 1: Checking inodes, blocks, and sizes
Inode 661073 has EXTENTS_FL flag set on filesystem without extents support.
Erase<y>? yes

Inode 661074 has EXTENTS_FL flag set on filesystem without extents support.
Erase<y>? yes

Inode 661075 has EXTENTS_FL flag set on filesystem without extents support.
Erase<y>? yes

Inode 661076 has EXTENTS_FL flag set on filesystem without extents support.
Erase<y>? yes

Inode 661077 is in use, but has dtime set.  Fix<y>? yes

Inode 661077 has a extra size (22912) which is invalid
Fix<y>? yes

Inode 661078 has EXTENTS_FL flag set on filesystem without extents support.
Erase<y>? yes

Inode 661079 is in use, but has dtime set.  Fix<y>? yes

Inode 661079 has a extra size (35855) which is invalid
Fix<y>? yes

Inode 661080 is in use, but has dtime set.  Fix<y>? yes

Inode 661080 has a extra size (64965) which is invalid
Fix<y>? yes

Inode 661081 is in use, but has dtime set.  Fix<y>? yes

Inode 661081 has imagic flag set.  Erase<y>?
..........Continues forever, zillions of errors.......


Actually, I'm starting to get suspicious about all those memory cards. Maybe I should stop buying brandless stuff.
« Last Edit: October 16, 2009, 08:12:38 PM by paulo_raca » Logged

Pages: [1]
Print
Jump to: