Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon EC2 m3.large with only 8GB in root volume

I bought a m3.large but when create instance, I only see 8GB, should change that value to 32 GB? I want use this SSD storage for MySQL. and i need it in root partition

Sorry for my english. Thanks.

The instance description:

Instance Type   ECUs    vCPUs   Memory (GiB)    Instance Storage (GiB)  EBS-Optimized Available Network Performance
m3.large        6.5       2         7.5                1 x 32                           -            Moderate

The storage description:

Type        Device          Snapshot        Size (GiB)  Volume Type   IOPS  Delete on Termination
Root        /dev/sda1       snap-67620582       8       standard       N/A    Yes
ephemeral0  /dev/sdb        N/A                N/A        N/A          N/A    N/A
like image 430
pelli23 Avatar asked Mar 02 '14 22:03

pelli23


Video Answer


2 Answers

If you want to use it as root partition, you need to launch an instance store version of your AMI.

The SSD volume is corrently mapped to /dev/sdb. You can mount that at any location on your filesystem. Like to /var/mysql.

If you are not using replication, you will loose the data stored on the ephemeral volume if the instance is stopped or fails for any reason.

like image 50
datasage Avatar answered Oct 14 '22 07:10

datasage


The 8GB that you see is basically your EBS volume mounted as the root drive.

You can find the instance store version of your AMI just like @datasage suggested or you can simply make a link to where you want to store your mysql files:

$ mkfs.ext4 /dev/sdb  # This creates the filesystem on the ephemeral storage
$ mkdir -p /mnt/sdb
$ mount /dev/sdb /mnt/sdb
$ ln -s /var/lib/mysql /mnt/sdb/mysql

Keep in mind just like @datasage mentioned you will lose all this data once you shutdown the instance since it's ephemeral storage.

like image 24
Rico Avatar answered Oct 14 '22 06:10

Rico