Creating a Boot Partition on the AWS Root Volume

If a Linux VM is running in Amazon Web Services (AWS), we recommend that you create a boot partition on the existing AWS root volume and then boot from the root volume. Because the root volume will be larger than a new volume created exclusively as a boot volume, AWS will assign more IOPS (Input/Output Operations per Second) to the root volume than to a new volume. This usually results in faster encryption speeds due to the higher number of IOPS available.

Alternatively, if you do not want to create a boot partition on your existing root volume, you can create a new volume that will become the boot partition. For details, see Creating a Boot Partition on a New AWS Volume.

Important: The following method cannot be used for VMs running CentOS 6.x, RHEL 6.x, or Amazon Linux. For these VMs you must create a boot partition on a new AWS volume.

Before You Begin 

Make sure the VM is powered on and is accessible. You cannot perform this procedure if the VM is powered off.

Procedure 

  1. Log into the EC2 console, make sure the VM is powered on, then increase the size of the root volume by 1 GB.

    Important: Do not reboot the VM at this point. If you do, RedHat will auto-extend the root file system to fill the new disk space. You must create the boot partition before you reboot the VM.

  2. If you do not know whether the VM uses MBR or GPT partitions, log into the VM as root and enter one of the following commands.

    • fdisk -l /dev/xvda. For MBR partitions, the operating system will be shown in the Disklabel type field.

      # fdisk -l /dev/xvda
      
      Welcome to fdisk (util-linux 2.27.1).
      Changes will remain in memory only, until you decide to write them.
      Be careful before using the write command.
      
      Command (m for help): p
      Disk /dev/xvda: 9 GiB, 9663676416 bytes, 18874368 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: 0xe5c7298c
      
    • gdisk -l /dev/xvda. For GPT partitions, the GPT field in the Partition Label Scan section will display "present".

      # gdisk -l /dev/xvda
      
      GPT fdisk (gdisk) version 0.8.6
      Partition table scan:
        MBR: protective
        BSD: not present
        APM: not present
        GPT: present
      
      Found valid GPT with protective MBR; using GPT.
      
  3. If the disk contains MBR partitions, use fdisk to create the boot partition and reboot the VM.

    When the VM has finished rebooting, proceed to Step 5.

  4. If the disk contains GPT partitions, use gdisk to create the boot partition and reboot the VM. During this process you must relocate the backup data structures to the end of the disk in order to create the required free space, as highlighted in the following example.

    Important: If the disk contains MBR partitions, you must use fdisk to create the boot partition. If you use gdisk, the VM will become unusable and all data will be lost. If you have MBR partitions, return to Step 3.

  5. Log back into the VM as root and run the script aws-prepare-boot.sh that is installed as part of the HyTrust DataControl Policy Agent package. For example, if you add a new device named /dev/xvda3, you would enter:

    # /opt/hcs/bin/aws-prepare-boot.sh /dev/xvda3

  6. Reboot the VM.

What to Do Next 

Verify the configuration as described in Verifying the Current VM Configuration and then encrypt the boot device as described in Encrypting Linux System Devices.