Question

I ran df -h and got:

/dev/xvde1            6.0G  1.9G  4.1G  32% /
none                  828M     0  828M   0% /dev/shm

and cat /etc/fstab:

LABEL=_/   /         ext4    defaults        1 1
/dev/xvdb  /mnt      ext3    defaults,context=system_u:object_r:usr_t:s0  0 0
none       /proc     proc    defaults        0 0
none       /sys      sysfs   defaults        0 0
none       /dev/pts  devpts  gid=5,mode=620  0 0
none       /dev/shm  tmpfs   defaults        0 0
/dev/sda3       none    swap    sw,comment=cloudconfig  0       0

output of lsblk:

NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
xvde1 202:65   0    6G  0 disk /
xvde3 202:67   0  896M  0 disk [SWAP]

I suppose /dev/xvdb to be my instance storage of around 160 GB. However, I do not see this device when I run ls -a on /dev/.

Does any one know how I can get this instance storage mounted?

thanks so much

Was it helpful?

Solution 2

If you upgraded from a micro instance (or any instance that only has EBS storage), it won't be included by default. In any case, you can add it by creating a snapshot of your instance and relaunching. You can add it on the Snapshot page, or in the Launch wizard when launching from an existing AMI.

  1. Open EC2 Web Admin Console.
  2. Click on Instances on the left, select your instance, click the "Actions" dropdown, then select "Create Image".
  3. On the snapshot page enter a name and description. You can add the Instance Store here if you like or later when you launch the AMI. Click the Add Volume button. Select "Instance Store 0" as the type, and whatever device path you like. Then click "Create Image".
  4. Go to AMIs under the images section on the left site of the EC2 Admin Console.
  5. Wait for the AMI status of your new image to be "available".
  6. Select the new AMI, click Launch at the top and go through the launch wizard (go through the steps, so you can set it up with the same security group and key pair as your current server).
  7. On step 4 you have a chance to modify the volumes again. Make sure "Instance Store 0" is listed as the second volume.
  8. Finish wizard and wait for launch. When you login df -h will show the volume.

Some recommend stopping the instance before the snapshot, but I've never had a problem. In my experience (using an ELB in front) the server is usually unavailable for up to 10 minutes while the snap is made.

[ec2-user@ABCD ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      7.9G  2.3G  5.6G  29% /
tmpfs           829M     0  829M   0% /dev/shm
/dev/xvdb       147G  188M  140G   1% /media/ephemeral0

More info here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#Using_AddingDefaultLocalInstanceStorageToAMI

OTHER TIPS

So,

Your lsblk output shows that your instance does not have an extra drive attached. So what you see is correct.

m1.small support attaching an extra instance drive of 160 GB. but that does not mean that will be attached automatically when you provision a m1.small instance.

While provisioning an instance you have to Manually select the option to attach the drive.

In your case, you seem to have skipped this step. Hence the instance got provisioned but it does not have 160 Gb drive.

On a side note, you cannot attach these drives once the instance is provisioned. So, In other words, either you can create and attach an EBS volume, OR just Create a new instance and select to attach this drive while creating this instance.

Please check the screen shot below to understand what I am talking about:

enter image description here

As shows in above screen shot, you have to click on "Add New Volume" button while provisioning the instance.

Once you click on that, you will see your 160GB drive being added as below:

enter image description here

Make sure you select "Instance Store 0" under "Type" column as the Volume in question that you are looking for is an "Instance Store" Volume.

Once the instance is provisioned, run lsblk again and you will notice your new volume listed there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top