Error installing drive

I created an instance of Amazon EC2 (ubuntu) and created the volume from an available snapshot. The volume is successfully bound to my instance as /dev/sdf .

I ran the following command: done: mkdir /space

When I try to execute the following command: sudo mount /dev/sdf1 /space

I get this message: mount: special device /dev/sdf1 does not exist

How can I solve this problem?

+8
amazon-ec2
source share
2 answers

Try installing the device "/ dev / sdf" instead of "/ dev / sdf1".

If this still does not work, try installing it as "/ dev / xvdf" or "/ dev / xvda1", for example:

 sudo mount /dev/xvda1 /space 

An explanation of this name mismatch can be found in the Attach Volume dialog box on the EC2 control screen:

Note. Newer Linux kernels can rename your devices to / dev / xvdf via / dev / xvdp internally, even if the device name entered here (and shown in detail) is / dev / sdf via / dev / sdp.

+18
source share

In the UserData CloudFormation section, I had an attach-volume command and the mount command was executed sequentially without delay. I entered a 5 second delay between the attach-volume command and the mount command, and it solved the problem.

 aws ec2 attach-volume --volume-id $volumeId --instance-id $instanceId --device /dev/xvdf sleep 5 mount /dev/xvdf /db -t ext4 
+1
source share

All Articles