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



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

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

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


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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy