I have been using a raid.sh script  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 .
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!
#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;
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