Saturday, January 13, 2018

ubuntu - How to set or change the 2.2 GiB size of AWS instance-store backed root volume?

I've just launched an AWS EC2 r3.large instance with Ubuntu. r3.large has 32GB SSD for instance store with it. My problem is that the size of the root volumne /dev/xvda is too small and I can't find an effective way to use all 32GB in my instance-store backed EC2 instance.



  1. If I don't Add Storage when Launching an Instance, I get an /dev/xvda of 10 GB, which I understand is the maximum possible for instance-store root volumes.


  2. If I do Add Storage when Launching an Instance, I get an even smaller /dev/xvda of only 2.2 GB as shown by sudo fdisk -l below.




Disk /dev/xvda: 2.2 GiB, 2361393152 bytes, 4612096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xef20d59b


Device     Boot Start     End Sectors  Size Id Type
/dev/xvda1 * 2048 4610047 4608000 2.2G 83 Linux
Disk /dev/xvdb: 30 GiB, 32212254720 bytes, 62914560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


My questions are:



  1. How can I get an 10GB root and use the rest of the instance store for /dev/xvdb ? (instead of having a tiny root volume and everything else in /dev/xvdb)


  2. Is there a way to use the space in /dev/xvdb seamlessly in the root volume?



-- UPDATE --


The output of lsblk is:


$ sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 2.2G 0 disk
└─xvda1 202:1 0 2.2G 0 part /
xvdb 202:16 0 30G 0 disk

Also, now I tried to launch new instances without specifying any additional storage (i.e. leaving it as the default), but I can't even get back the 10GB /dev/xvda. EC2 somehow consistently create the 2.2G root, which isn't going to hold the packages I'm going to install.

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...