Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I'm trying to stop /dev/md127 on my Ubuntu 12.10 box. It was set up as RAID1, but I'm trying to move everything (well, rename) to md0. I read that renaming isn't possible, so I'm trying to remove the drives and put them into a new array as md0. I've been able to remove one drive (sdb) by using --fail and --remove, but sdc isn't responding, nor will md127 respond to --stop --force.

I've run fuser and lsof, and neither show anything using md127. I was running LVM on top of md127, but I've umounted the LVs and I've done "{lv,vg}change -an vg_Name".

I'm at a loss for what to try next. And for those who want to know why I want to rename/move, I'm a little OCD over things like that.

If it's relevant, here are the exact commands I've used, though the stop/fail/remove commands have been tried multiple times:

mdadm --stop --force /dev/md127 # this failed with the error message "mdadm: Cannot get exclusive access to /dev/md127:Perhaps a running process, mounted filesystem or active volume group?"
fuser /dev/md127 # no output
lsof /dev/md127 # no output
mdadm --fail /dev/md127 /dev/sdb # succeeded
mdadm --remove /dev/md127 /dev/sdb # succeeded
mdadm --fail /dev/md127 /dev/sdc # this failed - "device or resource busy"
mdadm --remove /dev/md127 /dev/sdc # this failed - "device or resource busy"
lvchange -an vg_Name
vgchange -an vg_Name
share|improve this question
What is printed when you run mount? – sparticvs Oct 29 '12 at 0:38

If all you're trying to do is change the device number, add the array to your config file with the device number of our choice using the following command:

    echo "ARRAY /dev/md0 level=raid1 num-devices=2 UUID=$(blkid -s UUID -o value /dev/md127) devices=/dev/sdb,/dev/sdc" >> /etc/mdadm.conf

Once you've put your raid in /etc/mdadm.conf, just reboot and the raid should automatically reassemble using the device number you've specified. This has the added benefit of ensuring that your raid will be built with the same device name at every boot.

share|improve this answer

Can you please paste the output of the following commands?

mdadm -D /dev/md127

mdadm -E /dev/sdc

cat /proc/mdstat

Please note that it is possible to "rename" the raid. Renaming in this case is depending on the superblock version your raid is using.

To rename a superblock 0.90 raid you should use the following command: mdadm -A /dev/md0 -U super-minor -u <uuid of the array>

To rename a superblock 1.X raid you should use the following command: mdadm -A /dev/md0 -U name -N <new name> -u <uuid of the array>

As i didn't understand it, can you please explain why you want to rename it? The node name md127 is assembled by your initramfs scripts, as these are starting from md127. As far as i know you can change the preferred minor number, but the initramfs scripts will regardless of the minor number start with assembling the node 127.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.