3

I'm quite new in the world of Linux and software-raid but I encountered a problem in which I hope you guys can help me.

Few days ago the system was not shutdown properly and when I booted the mdadm software raid wouldn't mount anymore and I got an error which stated that /dev/sdb1 (which is part of my raid 0 array) has a bad superblock. I decided to ignore mounting the since my system doesn't depend on it. So i could login and do some tests.

My array contains two disks (sdb1 and sde1) which are set in RAID0. Both drives are identical.

When i run fsck /dev/sdb1 I get the error that my superblock has more blocks then the physical drive.

$ fsck /dev/sdb1
fsck from util-linux 2.20.1
e2fsck 1.42 (29-Nov-2011)
The filesystem size (according to the superblock) is 488380672 blocks
The physical size of the device is 244190390 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? 

My other drive seemed to be OK, but now I get the following error, i assume it has to do with sdb1 missing

$ fsck /dev/sde1
fsck from util-linux 2.20.1
fsck: fsck.linux_raid_member: not found
fsck: error 2 while executing fsck.linux_raid_member for /dev/sde1

In fdisk all seems to be okay, or at least as they we're before..

$ fdisk -l

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders, total 390721968 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a091a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   390721535   195109889    5  Extended
/dev/sda5          501760   390721535   195109888   8e  Linux LVM

Disk /dev/mapper/Server1-root: 193.6 GB, 193646821376 bytes
255 heads, 63 sectors/track, 23542 cylinders, total 378216448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/Server1-root doesn't contain a valid partition table

Disk /dev/mapper/Server1-swap_1: 2143 MB, 2143289344 bytes
255 heads, 63 sectors/track, 260 cylinders, total 4186112 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/Server1-swap_1 doesn't contain a valid partition table

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
78 heads, 63 sectors/track, 397542 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000300

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  1953525167   976761560   fd  Linux raid autodetect

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
24 heads, 63 sectors/track, 1292014 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048  1953525167   976761560   83  Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sdd'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdd: 500.1 GB, 500107862016 bytes
81 heads, 63 sectors/track, 191411 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048   976773167   488385560   83  Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sde'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sde: 1000.2 GB, 1000204886016 bytes
78 heads, 63 sectors/track, 397542 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000300

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1            2048  1953525167   976761560   fd  Linux raid autodetect

When i run dumpe2fs /dev/sdb1 i get:

dumpe2fs 1.42 (29-Nov-2011)
Filesystem volume name:   <none>
Last mounted on:          /media/raid0
Filesystem UUID:          52e0e3eb-40d7-49fa-9b35-be6513a782d2
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash 
Default mount options:    (none)
Filesystem state:         not clean with errors
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              122101760
Block count:              488380672
Reserved block count:     4883806
Free blocks:              166355414
Free inodes:              121871448
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      907
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
RAID stride:              128
RAID stripe width:        256
Flex block group size:    16
Filesystem created:       Sun Apr 22 21:57:36 2012
Last mount time:          Thu May  3 00:01:08 2012
Last write time:          Tue May  8 20:33:15 2012
Mount count:              24
Maximum mount count:      35
Last checked:             Sun Apr 22 21:57:36 2012
Check interval:           15552000 (6 months)
Next check after:         Fri Oct 19 21:57:36 2012
Lifetime writes:          1809 GB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:           256
Required extra isize:     28
Desired extra isize:      28
Default directory hash:   half_md4
Directory Hash Seed:      54b59b52-4cfc-4bea-8c5a-5fc730317f4f
Journal backup:           inode blocks

And a whole bunch of these:

Group 0: (Blocks 0-32767) [ITABLE_ZEROED]
  Checksum 0x6848, unused inodes 0
  Primary superblock at 0, Group descriptors at 1-117
  Reserved GDT blocks at 118-1024
  Block bitmap at 1025 (+1025), Inode bitmap at 1041 (+1041)
  Inode table at 1057-1568 (+1057)
  23517 free blocks, 8182 free inodes, 1 directories

When i run cat /proc/mdstat i get:

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md0 : inactive sdb[0](S)
      976761560 blocks super 1.2

md127 : inactive sde1[1](S)
      976760536 blocks super 1.2

unused devices: <none>

So all of the sudden I have two raid arrays now...

I've tried the method mentioned in this topic where they suggest to use backup sectors. But no luck, the error about a superblock larger then the physical drive persists.

Can you guys help me? I'm quite scared I lost my data now..

Edit: contents of mdadm.conf file added

# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
# MAILADDR

# definitions of existing MD arrays
#ARRAY /dev/md/0 metadata=1.2 UUID=7658dc76:c33da511:d40c5dee:c5d5143d name=Server1:0

# This file was auto-generated on Fri, 27 Apr 2012 18:38:03 +0200
# by mkconf $Id$
ARRAY /dev/md/0 metadata=1.2 UUID=7658dc76:c33da511:d40c5dee:c5d5143d name=Server1:0
ARRAY /dev/md/0 metadata=1.2 UUID=3720f7a5:ae73fb52:deee0813:677105ae name=Server1:0
3
  • What are you trying to achieve with running fsck and dumpe2fs on the RAID members? They just contain half of the data each, unless you're mixing up level 0 and level 1. Disassemble those arrays and try to reassemble the array containing both drives, if you're lucky this will work.
    – LiveWireBT
    May 8, 2012 at 21:46
  • fschk doesn't check partitions, it checks filesystems. Since you don't have a filesystem at /dev/sdb1 it would freak out. You need to use gnu parted, or gparted to verify the partition table. What is in your mdadm.conf file? Have you tried update-initramfs -u as root?
    – Chris
    May 8, 2012 at 21:48
  • Thanks for your replies, i've updated my post above with the mdadm.conf file contents. I've disassembled the arrays and reassembled the array but now I still can't mount it. Getting wrong fs type, bad option, bad superblock on /dev/md0 May 8, 2012 at 22:30

1 Answer 1

1

Stop running fsck on the raid members, there's not supposed to be a filesystem there and you could easily destroy the RAID superblock that is there.

There's something really wrong with your RAID setup to begin with, this is what your partition table should look like.

root@mark21:~# fdisk -l

Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000ffc4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048  1240233983   620115968   fd  Linux raid autodetect

It looks like you formatted the SD device with a filesystem after you made it part of a RAID set, that's completely broken. You're supposed to format and use the MD device.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .