Decrease volume size of EC2

Create a smaller volume

  1. Go to EBS volumes

  2. Click Create Volume

  3. Choose the volume type (same as previous)

  4. Enter size; 30

  5. Choose availability zone, same as the availability zone.

  6. tag, new-volume

Attach the new volume

  1. Right click on the new volume

  2. Click attach volume

  3. Choose instance name

  4. Click attach

ubuntu@ip-172-31-22-162:~$ lsblk
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
xvda    202:0    0  100G  0 disk
└─xvda1 202:1    0  100G  0 part /
xvdf    202:80   0   25G  0 disk
ubuntu@ip-172-31-22-162:~$ sudo file -s /dev/xvdf
/dev/xvdf: data
ubuntu@ip-172-31-22-162:~$ sudo mkfs -t ext4 /dev/xvdf
mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 6553600 4k blocks and 1638400 inodes
Filesystem UUID: 21d004ce-5bc7-426c-9a0d-ef465b97e0f7
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

ubuntu@ip-172-31-22-162:~$

Check gitlab installation

Run the gitlab with

Increase EC2 volume size

Last updated

Was this helpful?