Menu
Amazon Elastic Compute Cloud
User Guide for Linux Instances

SSD Instance Store Volumes

The following instances support instance store volumes that use solid state drives (SSD) to deliver very high random I/O performance: C3, G2, HI1, I2, M3, and R3. For more information about the instance store volumes support by each instance type, see Instance Store Volumes.

To ensure the best IOPS performance from your SSD instance store volumes on Linux, we recommend that you use the most recent version of the Amazon Linux AMI, or another Linux AMI with a kernel version of 3.8 or later. If you do not use a Linux AMI with a kernel version of 3.8 or later, your instance will not achieve the maximum IOPS performance available for these instance types.

Like other instance store volumes, you must map the SSD instance store volumes for your instance when you launch it, and the data on an SSD instance volume persists only for the life of its associated instance. For more information, see Add Instance Store Volumes to Your EC2 Instance.

Instance Store Volume TRIM Support

The following instances support SSD volumes with TRIM: I2, R3.

With instance store volumes that support TRIM, you can use the TRIM command to notify the SSD controller when you no longer need data that you've written. This provides the controller with more free space, which can reduce write amplification and increase performance. For more information about using TRIM commands, see the documentation for the operating system for your instance.

Instance store volumes that support TRIM are fully trimmed before they are allocated to your instance. These volumes are not formatted with a file system when an instance launches, so you must format them before they can be mounted and used. For faster access to these volumes, you should specify the file system-specific option that skips the TRIM operation when you format them. On Linux, you should also add the discard option to your mount command or /etc/fstab file entries for the devices that support TRIM so that they use this feature effectively. On Windows, use the following command: fsutil behavior set DisableDeleteNotify 1.

To make an instance store volume with TRIM support available for use on Linux

  1. Map the instance store volume when you launch the instance. For more information, see Add Instance Store Volumes to Your EC2 Instance.

  2. From the instance, list the available devices using the lsblk command or view the instance store volumes using instance metadata.

  3. Verify that your operating system and device support TRIM using the following command (replacing xvdb with the name of your device):

    [ec2-user ~]$ sudo cat /sys/block/xvdb/queue/discard_max_bytes
    322122547200

    If this command returns a value other than 0, then your operating system and device support TRIM.

  4. Format the volume with the file system of your choice.

    • (EXT4) To format the volume with the ext4 file system, use the following command (replacing xvdc with the name of your device):

      [ec2-user ~]$ sudo mkfs.ext4 -E nodiscard /dev/xvdc
    • (XFS) To format the volume with the xfs file system, use the following command (replacing xvdb with the name of your device):

      [ec2-user ~]$ sudo mkfs.xfs -K /dev/xvdb

      Note

      You might need to install XFS file system support on your operating system for this command to work. For Amazon Linux, use the sudo yum install -y xfsprogs command.

  5. Mount the device using the discard option. Be sure to specify the device name of the volume. You can select an existing directory or create a new one using the mkdir command.

    [ec2-user ~]$ sudo mount -o discard /dev/xvdb /mnt/my-data
  6. (Optional) If you want the device to mount at boot time, you can add or modify an entry in the /etc/fstab file with the discard option.

    /dev/xvdb   /mnt/xvdb   xfs    defaults,nofail,discard   0   2
    /dev/xvdc   /mnt/xvdc   ext4   defaults,nofail,discard   0   2

    Important

    After you edit the /etc/fstab file, verify that there are no errors running the sudo mount -a command. If there are any errors in this file, the system may not boot properly or at all.