How to extend the volume size on ec2 instance aws

    Posted in Amazon Cloud Services, Linux Servers on Oct 30, 2018


    1. Confirm the kernel.

      # uname -r


    1. Confirm the initial allocated size

      # df -h

      Filesystem Size Used Avail Use% Mounted on

      /dev/xvda1 7.9G 797M 6.7G 11% /

      tmpfs 498M 0 498M 0% /dev/shm

      # lsblk

      NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 15G 0 disk └─xvda1 202:1 0 8G 0 part /

    2. Install EPEL6 Repo

      # wget
      # rpm -ivh epel-release-6-8.noarch.rpm
    3. Install the dracut & cloud-utils growpart modules-growroot

      # yum install -y dracut-modules-growroot cloud-utils-growpart
    4. The initrd need...

    [Read more...]

    How to recover key file for aws instance

    Posted in Amazon Cloud Services on Jun 05, 2018


    If you lose the private key for an EBS-backed instance, you can regain access to your instance. You must stop the instance, detach its root volume and attach it to another instance as a data volume, modify the authorized_keys file, move the volume back to the original instance, and restart the instance. For more information about launching, connecting to, and stopping instances, see Instance Lifecycle.

    This procedure isn't supported for instance store-backed instances. To determine the root device type of your instance, open the Amazon EC2 console, choose Instances, select the instance, and c...

    [Read more...]