• created two EBS volumes using cloud formation template.
  • attached EBS volumes using aws ec2 attach volume
  • trying to stripe two volumes using - mdadm --create --verbose /dev/md0 --level=0 --name=InfluxRaid --raid-devices=2 /dev/xvdb /dev/xvdc\n and i am getting error /dev/xvdb is not found.
  • 2
    You have a mismatch between the device names that you are specifying and the actual ones. To help solve this complete the following steps: In the AWS EC2 console, what devices names is AWS assigning for these volumes? Inside the EC2 instance what are the device names? – John Hanley Dec 13 '17 at 1:34
  • device names are correct, i am thinking when mdadm is looking for devices they are still in the attaching state or not yet attached because mdadm works when i attach the volumes using block device mapping in the cloud formation template – Nani Dec 13 '17 at 1:54
  • @Nani I really wouldn't be too sure of that. Some instance types call them strange names, like (iirc) xvdca, xvdcb, etc. The volumes should attached by the time the script runs. – Michael - sqlbot Dec 14 '17 at 1:05
  • when i am attaching the volumes using device mappings i am able to stripe the volumes with same names but when i am attaching volumes from user script i am not able to stripe them – Nani Dec 14 '17 at 19:59

While it's hard to say without more details, I suspect it's related to a delay in attaching the volumes to your instance during startup. See this forum post for more details, but I think you might want to add some wait in your UserData script, like:

# Wait for the EBS volume to show up
while [ ! -e /dev/sdh ]; do echo Waiting for EBS volume to attach; sleep 5; done
| improve this answer | |

Your Answer

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

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