Objective
Demonstrate how to resize the root partition after initialize the OpMon’s instance of on Amazon, this documentation is indicate for the cases where the configuration defined by default was changed.
Target audience
Administrator and user who after change the size of the disk space, need apply this change on file system.
Requirements
The following setting must be run using root privileges
Performing partition resize
You must run the following commands as root:
a) Make the reboot instance of OpMon,
[root@opmon ~]# reboot
b) After reboot, run the following command to verify that the partition size change has been applied:
[root@opmon ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 220G 0 disk └─xvda1 202:1 0 220G 0 part /
In the above example the size of the partition that was 200GB was increased to 220GB.
c) However, when querying the file system size, using the command shown below, it is observed that the increase was not applied to it:
[root@opmon ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda1 197G 4.7G 183G 3% / tmpfs 1.9G 0 1.9G 0% /dev/shm
d)To apply the increase to the file system, you must execute the resize2fs command applied to the respective file system, according below:
[root@opmon ~]# resize2fs /dev/xvda1
e) After run the resize2fs command we can again check the size of the file system with the purpose of validating the changes:
[root@opmon ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda1 217G 4.7G 201G 3% / tmpfs 1.9G 0 1.9G 0% /dev/shm