mongodb - EC2 Volume Attachment Error (Unix) -
i trying follow 10gen documentation standing mongodb on ec2 instance. encountering error when trying attach newly created volumes instance.
i trying run command
$ ec2-attach-volume vol-dac9c92f -i i-19f359db -d /dev/sdh2
the error receive following
client.invalidparametervalue: value (/dev/sdh2) parameter device invalid. /dev/sdh2 not valid ebs device name.
and relevant part of documentation this
$ (i=0; \ > vol in $(awk '{print $2}' vols.txt); \ > i=$((i+1)); \ > ec2-attach-volume $vol -i i-11eee072 -d /dev/sdh${i}; \ > done)
this command executes (notice absence of id number)
$ ec2-attach-volume vol-dac9c92f -i i-19f359db -d /dev/sdh
if point out may doing wrong appreciative.
-james
the device attached instance mapped different device name based on type of virtualization.
if instance pv (paravirtual), volumes can mapped /dev/sdxy
x
device letter , y
numeric (as used partitions) - can use /dev/sdh2
.
however, hvm instances, y
numeric format not acceptable - needs volume id without partition number naming syntax, i.e. /dev/sdh
, /dev/sdi
, etc.
http://docs.aws.amazon.com/awsec2/latest/userguide/device_naming.html - see "recommended values ebs volumes" column.
* edit * provide bash snippet hvm instances equivalent of:
$ (i=0; \ > vol in $(awk '{print $2}' vols.txt); \ > i=$((i+1)); \ > ec2-attach-volume $vol -i i-11eee072 -d /dev/sdh${i}; \ > done)
you can use letter-based incremental loop (set volmap
set / array of letters f
through i
, iterate through array, instead of incrementing counter)
$ (volmap=({f..i}); i=0; \ > vol in $(awk '{print $2}' vols.txt); \ > ec2-attach-volume $vol -i i-11eee072 -d /dev/xvd${volmap[i++]}; \ > done)
this attach /dev/xvdf
through /dev/xvdi
. have used xvdx
instead of sdx
aws volume attachment matches kernel addressing of devices.
Comments
Post a Comment