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 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
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.
If you do not know whether the VM uses MBR or GPT partitions, log into the VM as
rootand 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/xvdaWelcome to fdisk (util-linux2.27.1).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Command (mforhelp): pDisk /dev/xvda:9GiB,9663676416bytes,18874368sectorsUnits: sectors of1*512=512bytesSector size (logical/physical):512bytes /512bytesI/O size (minimum/optimal):512bytes /512bytesDisklabel type: dosDisk identifier:0xe5c7298cgdisk -l /dev/xvda. For GPT partitions, the GPT field in the Partition Label Scan section will display "present".# gdisk -l /dev/xvdaGPT fdisk (gdisk) version0.8.6Partition table scan:MBR: protectiveBSD: not presentAPM: not presentGPT: presentFound valid GPT with protective MBR; using GPT.
If the disk contains MBR partitions, use
Example:fdiskto create the boot partition and reboot the VM.# fdisk /dev/xvdaWelcome to fdisk (util-linux2.27.1).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Command (mforhelp): pDisk /dev/xvda:9GiB,9663676416bytes,18874368sectorsUnits: sectors of1*512=512bytesSector size (logical/physical):512bytes /512bytesI/O size (minimum/optimal):512bytes /512bytesDisklabel type: dosDisk identifier:0xe5c7298cDevice Boot Start End Sectors Size Id Type/dev/xvda1 *204816777182167751358G83LinuxCommand (mforhelp): nPartition typep primary (1primary,0extended,3free)e extended (containerforlogical partitions)Select (defaultp): pPartition number (2-4,default2):First sector (16777183-18874367,default16777216):Last sector, +sectors or +size{K,M,G,T,P} (16777216-18874367,default18874367):Created anewpartition2of type'Linux'and of size1GiB.Command (mforhelp): wThe partition table has been altered.Calling ioctl() to re-read partition table.Re-reading the partition table failed.: Device or resource busyThe kernel still uses the old table. Thenewtable will be used at the next reboot or after you run partprobe(8) or kpartx(8).# rebootWhen the VM has finished rebooting, proceed to Step 5.
If the disk contains GPT partitions, use
gdiskto 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
Example:fdiskto create the boot partition. If you usegdisk, the VM will become unusable and all data will be lost. If you have MBR partitions, return to Step 3.# gdisk /dev/xvdaGPT fdisk (gdisk) version0.8.6Partition table scan:MBR: protectiveBSD: not presentAPM: not presentGPT: presentFound valid GPT with protective MBR; using GPT.Command (?forhelp): xExpert command (?forhelp): eRelocating backup data structures to the end of the diskExpert command (?forhelp): mCommand (?forhelp): pDisk /dev/xvda:211812352sectors,101.0GiBLogical sector size:512bytesDisk identifier (GUID): F27664E9-0E9F-434A-9AB6-62C730E0F0DFPartition table holds up to128entriesFirst usable sector is34, last usable sector is211812318Partitions will be aligned on2048-sector boundariesTotal free space is2099166sectors (1.0GiB)Number Start (sector) End (sector) Size Code Name1204840951024.0KiB EF0224096209715166100.0GiB0700Command (?forhelp): nPartition number (3-128,default3):First sector (34-211812318,default=209715200) or {+-}size{KMGTP}:Last sector (209715200-211812318,default=211812318) or {+-}size{KMGTP}: +800MCurrent type is'Linux filesystem'Hex code or GUID (L to show codes, Enter =8300):0700Changed type of partition to'Microsoft basic data'Command (?forhelp): cPartition number (1-3):3Enter name:Command (?forhelp): pDisk /dev/xvda:211812352sectors,101.0GiBLogical sector size:512bytesDisk identifier (GUID): F27664E9-0E9F-434A-9AB6-62C730E0F0DFPartition table holds up to128entriesFirst usable sector is34, last usable sector is211812318Partitions will be aligned on2048-sector boundariesTotal free space is460765sectors (225.0MiB)Number Start (sector) End (sector) Size Code Name1204840951024.0KiB EF0224096209715167100.0GiB07003209715200211353599800.0MiB0700Command (?forhelp): wFinal checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTINGPARTITIONS!!Do you want to proceed? (Y/N): YOK; writingnewGUID partition table (GPT) to /dev/xvda.Warning: The kernel is still using the old partition table.Thenewtable will be used at the next reboot.The operation has completed successfully.# rebootLog back into the VM as
rootand run the scriptaws-prepare-boot.shthat is installed as part of the Entrust 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- 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.