- 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.
Asked
Active
Viewed 280 times
1

Nani
- 165
- 1
- 2
- 7
-
2You 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 01: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 01: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 01: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
1 Answers
0
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

Nic Cottrell
- 1,302
- 16
- 32