Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I had my raid5 with 6 drives running and was going to copy some stuff from an old ide disk so i plugged my ide to usb adapter to it and plugged the disk to a molex in the computer, then i heard a disk stop spinning and checked if the raid was okay but it said i had 2 fault removed, so i checked the /dev/ and 2 disks hadd changed names from /dev/sdc to /dev/sdh and /dev/sdf to /dev/sdi i originally had sdb sdc sdd sde sdf sdg , so i un plugged the usb ide adapter from my computer and rebooted, tought that it would help for some reason and then they had the old names again sdc and sdf so i tried to add them to the raid but it ended up looking like this

http://pastie.org/private/ggfy02gicdv4mwruwcy1ug

http://pastie.org/private/ibg0kprjcxx4c9ohkz9ca

sdc is supposed to be number 1 and sdf number 4

I have been searching for an answer for about 6 hours and no luck, someone please help me

share|improve this question

migrated from stackoverflow.com Apr 18 '11 at 2:30

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

Its strange for the kernel to change the drive letters while the drive is in use but either way.

if possible a reboot will rescan for raids and then assemble them regardless of the drive letters as the raid information is stored at the start of every hdd and it assembles a raid based on that information and not configs stored on system.

If its common that you want to plug in extra drives and this screws up the raid then i would suggest you write some udev drive rules to /dev/raid5disk1 or something.

probably too late for this but a dmesg output of the event would be nice

share|improve this answer
add comment

In my experience, a RAID5 array where two drives get marked as failed has required creating a new array. This is obviously risky and you need to make sure you have everything setup correctly before any writes or a resync occurs. Thus if someone else can suggest away to get it going without creating a new array you should probably try that first :)

But what I would do is stop the old array (mdadm --stop /dev/md0), and create a new array in a degraded state. HOWEVER the command I've given here assumes that the drive position hasn't changed, you need to know which disk goes where as the order is critical:

mdadm --verbose --create /dev/md1 --level=5 --raid-devices=6 /dev/sdb /dev/sdc /dev/sdd /dev/sde missing /dev/sdg

It should give you a warning the drives are part of another array, make sure the timestamps are identical (if not stop and try with the other failed drive missing instead).

This is enough to get the array started, so check the partition layout is what you expect with fdisk -l /dev/md1, then mount the file system read only (mount -r /dev/md1) to check your data. If it's corrupted I would try again with /dev/sdc missing, i.e.:

mdadm --verbose --create /dev/md1 --level=5 --raid-devices=6 --chunk=64 /dev/sdb missing /dev/sdd /dev/sde /dev/sdf /dev/sdg

(if your chunk size is not the default of 64K you need to specify that with --chunk=###)

Once you're happy that your data's intact, add the last drive back in and it'll resync:

mdadm -a /dev/md1 /dev/sdf

I have created a degraded RAID5 array with the drives in the wrong order before and it didn't destroy the data but YMMV.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.