Learned a bit the hard way about linux s ... / 2012-04-16

2012-04-16 Learned a bit the hard way about linux s ... 7 years ago
Learned a bit the hard way about linux software raid. The first raid I set up had a disk /dev/sdc first giving errors and later removing itself from the array. Sounds like something the raid system should be able to deal with. Shutdown system, remove failed disk, add new disk of the same size, reboot, resync array, done.

Well it wasn't like that, trying to activate the array after reboot kept giving errors like:
# mdadm --assemble /dev/md0
mdadm: /dev/sdc has no superblock - assembly aborted
After trying a lot of variants, I gave up on those superblocks and tried the method described in Mdadm entry in Wikipedia: Recovering from a loss of raid superblock. But I made an error: I did not use the missing keyword for the new disk. Which created a raidset with 3 disks and happily started syncing sdb+sdc to sdd. I aborted that config when I found out, redid it with missing in the right place and got a quite corrupted filesystem. After a 4 hour filesystem check all files (left..) were in lost+found.

Solution for my next software raid (I checked one I built later) and fixed in this one: use the UUID of the created array in mdadm.conf, don't describe the original components. So I made the change to:
# ARRAY /dev/md0 devices=/dev/sdb,/dev/sdc,/dev/sdd
ARRAY /dev/md0 UUID=1103091b:8bc35717:7d583786:8f0370bf
This will come up, even in degraded mode (with a warning about that). And later I added the new /dev/sdc with mdadm --add /dev/md0 /dev/sdc and the wished resync started. Easiest way to get this data in the right format:
# mdadm --detail --brief /dev/md0
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=00.90 UUID=f16f06e4:456974f1:07f865a5:07e04d1c

Tags: , ,

, reachable as koos+website@idefix.net. PGP encrypted e-mail preferred.

PGP key 5BA9 368B E6F3 34E4 local copy PGP key 5BA9 368B E6F3 34E4 via keyservers pgp key statistics for 0x5BA9368BE6F334E4 Koos van den Hout
RSS
Other webprojects: Camp Wireless, wireless Internet access at campsites, The Virtual Bookcase, book reviews
This page generated in 0.003768 seconds.