An error occurred (InvalidBlockDeviceMapping) when calling the RunInstances operation: Invalid device name C:/Program Files/Git/dev/sda1

0

I am trying to run a shellscript on my local which launches an ec2 instance .when I try to run the script this error comes up. An error occurred (InvalidBlockDeviceMapping) when calling the RunInstances operation: Invalid device name C:/Program Files/Git/dev/sda1, what should be done. the blockdevicemapping is already mapped in the script. I have awscli installed in my device, access keys configured.

Kiran
질문됨 일 년 전375회 조회
2개 답변
4

Ref: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html

the device name is obviously invalid since C:/Program Files/Git/dev/sda1 it merges two os path into a single one (windows and Linux)

Use the run-instances AWS CLI command with the --block-device-mappings option to specify a block device mapping for an instance at launch and check the block device mapping path

and update your script accordingly.

profile picture
전문가
답변함 일 년 전
  • Hey thanks @sdtslmn for taking time for help, The output name shown here is the error message the terminal gives me, the device name that is mapped in the script is correct which meant to be /dev/sda1. I think there should be some other issue with my git configuration or something? Because the same script were successfully executed by my colleague .

1

Try prepending MSYS_NO_PATHCONV=1 to the beginning of your command-line. See Git for Windows: Known Issues.

ennui
답변함 일 년 전
  • Hi @ennui Hope you are doing well. Thanks for taking time to help .This is actually a correct answer, but can you narrow down it to the exact answer what should be the permanent solution for this? I tried editing the path in script to --block-device-mappings "DeviceName=//dev\sda1 instead of --block-device-mappings "DeviceName=/dev/sda1 which originally was in the script and it worked for me. The solution you suggested is correct but I need to know what exactly I should do to avoid this error without modifying the path.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠