-   Linux - Server (
-   -   mdadm: no md superblock (

shamgar03 07-31-2008 12:50 PM

mdadm: no md superblock
So I seriously screwed up. I am reinstalling gentoo on my system and during the install I tried to create my software raid using the following:

mdadm --assemble /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1

the correct syntax would have been:
mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
which now tells me that one or more drives is missing its superblock

which is of course is the WRONG syntax. I then proceeded to run that same command with different drives at the front of the list, which appears to erased the superblocks on all my drives. The last time I ran examine I got the following:

Magic : a92b4efc
Version : 00.90.00
UUID : c362e3fb:514a460d:26f3c1cd:393ff9ac
Creation Time : Thu Oct 18 05:18:43 2007
Raid Level : raid5
Used Dev Size : 488383488 (465.76 GiB 500.10 GB)
Array Size : 1465150464 (1397.28 GiB 1500.31 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 0

Update Time : Thu Jul 31 15:54:06 2008
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Checksum : caeb45fd - correct
Events : 0.331696

Layout : left-symmetric
Chunk Size : 1024K

Number Major Minor RaidDevice State
this 2 8 33 2 active sync /dev/sdc1

0 0 8 1 0 active sync
1 1 8 49 1 active sync
2 2 8 33 2 active sync /dev/sdc1
3 3 8 17 3 active sync

Of course now running mdadm -E /dev/sdc1 returns
mdadm: No md superblock detected on /dev/sdc1.
Same for all the others. Is there a way to recreate the superblocks with this information?

I know there are other postings similiar to this, but considering this is loads of my data I would sort of like assurance that I won't screw things up (more).

mostlyharmless 07-31-2008 01:00 PM

Erggh - I did that once, but only to one of my drives fortunately, allowing me to rebuild.

shamgar03 07-31-2008 02:02 PM

So I found this:

but when I when I run:
mdadm --create /dev/md0 --chunk=1024 --verbose --level=5 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1

I get:

mdadm: layout defaults to left-symmetric
mdadm: /dev/sda1 is too small: 0K
mdadm: /dev/sdb1 is too small: 0K
mdadm: /dev/sdc1 is too small: 0K
mdadm: /dev/sdd1 is too small: 0K
mdadm: create aborted

Any idea on that?

mostlyharmless 07-31-2008 02:40 PM

Unfortunately, the only solution I know of is to rebuild the whole shooting match from backup.

shamgar03 07-31-2008 04:48 PM

Hmm, I think the file descriptors are just messed up. For instance any attempts to access the sda1/b1/c1/d1 device files results in unable to read. Obviously I wouldn't actually want to fdisk /dev/sda1 but it should open the tool at least when I try to. Instead I get:

livecd gentoo # fdisk /dev/sda1

Unable to read /dev/sda1

We'll see what happens when I reboot (after I finish the gentoo install).

shamgar03 07-31-2008 09:29 PM

So turns out I didn't erase the superblocks, I just destroyed the device files in /dev. If I had erased the superblock then the create method above would have fixed it, instead a reboot did the trick.

mostlyharmless 08-01-2008 12:20 PM

That's good to know; I'll try to remember that next time I forget the /dev/md0...

All times are GMT -5. The time now is 04:36 AM.