Instance Storage
Every instance includes a fixed amount of storage space on which you can store data. Within this document, it is referred to as the "instance store" as it is not designed to be a permanent storage solution.
If an instance reboots (intentionally or unintentionally), the data on the instance store will survive. If the underlying drive fails or the instance is terminated, the data will be lost.
We highly recommend backing up important data to Amazon S3.
Storage Locations
Storage is exposed on the instance types as described in the following table.
Location | Description |
---|---|
/dev/sda1 | Formatted and mounted as root (/) on all Linux and UNIX instance types. Formatted and mounted as C:\ on all Windows instance types. |
/dev/sda2 or xvdb (Windows) | Formatted and mounted as /mnt on m1.small and c1.medium instances. Formatted and mounted on small Windows instance types. |
/dev/sda3 | Formatted and mounted as /swap on m1.small and c1.medium instances on all Linux and UNIX instance types. Not available on Windows instances. |
/dev/sdb or xvdb (Windows) | Formatted and mounted as /mnt on m1.large, m1.xlarge, and c1.xlarge Linux and UNIX instances. Formatted and mounted on m1.large, m1.xlarge, and c1.xlarge Windows instances. |
/dev/sdc or xvdc (Windows) | Available on m1.large, m1.xlarge, and c1.xlarge Linux and UNIX instances. Formatted and mounted on m1.large, m1.xlarge, and c1.xlarge Windows instances. |
/dev/sdd or xvdd (Windows) | Available on m1.xlarge and c1.xlarge Linux and UNIX instances. Formatted and mounted on m1.xlarge and c1.xlarge Windows instances. |
/dev/sde or xvde (Windows) | Available on m1.xlarge and c1.xlarge Linux and UNIX instances. Formatted and mounted on m1.xlarge and c1.xlarge Windows instances. |
Making Instance Stores Available
Inside the instance, instance stores are exposed as normal block devices and can be formatted as any file system and mounted.
Linux and UNIX
Depending on the instance type, some instance stores are not mounted or formatted. To mount and format
an instance store, use the Linux and UNIX mount
and mkfs
commands.
For added security and safety, we recommend using an encrypted file system.
Windows
To initialize a volume
-
Log in to your instance using Remote Desktop.
-
On the taskbar, click Start, and then click Run.
-
Type
diskmgmt.msc
and click OK. The Disk Management utility opens. -
Right-click the Amazon EBS volume, select Initialize, and follow the on-screen prompts.
Note If the Initialize option does not appear, select Format.
Disk Performance Optimization
Due to how Amazon EC2 virtualizes disks, the first write to any location on an instance's drives performs slower than subsequent writes. For most applications, amortizing this cost over the lifetime of the instance is acceptable. However, if you require high disk performance, we recommend initializing drives by writing once to every drive location before production use.
To initialize the stores, use the following commands on the m1.large, m1.xlarge, and c1.xlarge instance types:
dd if=/dev/zero of=/dev/sdb bs=1M dd if=/dev/zero of=/dev/sdc bs=1M dd if=/dev/zero of=/dev/sdd bs=1M (m1.xlarge only) dd if=/dev/zero of=/dev/sde bs=1M (m1.xlarge only)
To perform the initialization on all drives at the same time, use the following command:
dd if=/dev/zero bs=1M|tee /dev/sdb|tee /dev/sdc|tee /dev/sde > /dev/sdd
Note | |
---|---|
Make sure to unmount the drive before performing this command.. Initialization can take a long time (about 8 hours for an extra large instance). |
RAID Configuration
Configuring drives for RAID initializes them by writing to every drive location. When configuring software-based RAID, make sure to change the minimum reconstruction speed:
echo $((30*1024)) > /proc/sys/dev/raid/speed_limit_min
Note | |
---|---|
You cannot use iostat (part of the sar System Activity Reporting package) to watch performance. You also cannot watch 'cat /proc/mdstat'. |