Skip to content

Instantly share code, notes, and snippets.

@rocket-ron
Created August 3, 2015 05:21
Show Gist options
  • Save rocket-ron/bf7d7ce3e5b8b7cd9197 to your computer and use it in GitHub Desktop.
Save rocket-ron/bf7d7ce3e5b8b7cd9197 to your computer and use it in GitHub Desktop.

Revisions

  1. rocket-ron created this gist Aug 3, 2015.
    32 changes: 32 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    This is a resize of the actual EBS volume as opposed to adding additional disks using LVM
    1. Follow the steps here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/storage_expand_partition.html
    2. Use the instructions for gdisk further down the page to set the new partition table, not gparted or fdisk.
    3. Reboot the instance once the partition table is written.
    4. On the instance, execute:

    sudo pvresize /dev/xvda2 (or whatever the device name is)

    sudo pvdisplay

    the pvdisplay command should show the larger volume size now for PV Size

    sudo vgdisplay

    the vgdisplay should also show the new volume size

    sudo lvdisplay

    look for the LV Path. It should be something like /dev/VolGroup/lv_root

    sudo lvextend -r -l +100%FREE /dev/VolGroup/lv_root

    this will extend the logical volume and kick off the resize step.
    otherwise resize2fs doesn't work as expected from the command line.
    the file system resize will take a few minutes to complete.

    df -h

    should show the new file system size