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 have been using a raid.sh script [1] for over a year now and has never gave me trouble. I recently started moving from Ubuntu 10.04 machines on AWS to Ubuntu 11.10. I updated the raid.sh script from the old sdF style drive names to xvdF. Since doing that, while attaching my 4 EBS drives, mdadm is getting a "device is busy" error on some of my drives (say 1 of 4) when using brand new drives, and on all 4 of 4 drives when trying using volumes created from a snapshot. I have attached the errors below as well [2].

After trying this, and the device being shown as "busy", when I properly make sure everything is unmounted and stopped via mdadm and detach the volume using AWS web console, the drives will be stuck on detaching and sometimes even say "busy" forever.

Any light on the situation would be greatly appreciated, thanks!

[1]

#mdadm == Raiding software
#xfsprogs == XFS filesystem creator/manager

sudo apt-get install -y mdadm xfsprogs;

sudo mdadm --create /dev/md0 --level 0 --chunk=256 --metadata=1.1 --raid-devices=4 /dev/xvdf /dev/xvdg /dev/xvdh /dev/xvdi;
echo DEVICE /dev/xvdf /dev/xvdg /dev/xvdh /dev/xvdi  | sudo tee /etc/mdadm/mdadm.conf;
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf;

sudo mkfs.xfs /dev/md0;
echo "/dev/md0 /raiddrive xfs noatime 0 0" | sudo tee -a /etc/fstab;

sudo mkdir /raiddrive;
sudo mount /raiddrive;

sudo blockdev --setra 65536 /dev/md0;

df -h /raiddrive;

sudo chown ubuntu:ubuntu /raiddrive;

[2]

mdadm: super1.x cannot open /dev/xvdf: Device or resource busy
mdadm: /dev/xvdf is not suitable for this array.
mdadm: super1.x cannot open /dev/xvdg: Device or resource busy
mdadm: /dev/xvdg is not suitable for this array.
mdadm: super1.x cannot open /dev/xvdh: Device or resource busy
mdadm: /dev/xvdh is not suitable for this array.
mdadm: super1.x cannot open /dev/xvdi: Device or resource busy
mdadm: /dev/xvdi is not suitable for this array.
mdadm: create aborted
DEVICE /dev/xvdf /dev/xvdg /dev/xvdh /dev/xvdi
ARRAY /dev/md/ip-10-4-237-174:0 metadata=1.1 name=ip-10-4-237-174:0 UUID=151438b6:98297ef2:e40fb2e3:a1ee73f3
share|improve this question
    
I've been having this same problem. It's been driving me crazy. Currently we just start over and keep trying until it succeeds... eventually. –  rpkelly May 2 '12 at 22:17
    
There is some bug in the Networked Drive -> EBS abstraction where latency delays cause mdmadm to report the drive as busy. @rpkelly is correct, just retry several times until it works. Actual drive performance seems unaffected. I would set a retry limit of 5, it usually takes 1-3 times to succeed. –  Flashman Jul 25 '12 at 17:39

1 Answer 1

This link answers it: http://dev.bizo.com/2012/07/mdadm-device-or-resource-busy.html

share|improve this answer
1  
Welcome to Server Fault! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  Mark Henderson Aug 14 '12 at 22:07

Your Answer

 
discard

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.