Increase or Decrease the Size of Static Partition in Linux.
We have mainly two types of partitions:
- LVM partitions
- Standard partitions
LVM partitions are created with the concept of logical volumes. They are also called as dynamic partitions because to resize these partitions we don’t need to unmount folder or directory. On the contrary in Standard partitions we need to unmount that’s why Standard partitions are also called static partitions.
Now coming to our main topic: Increase or decrease the size of static partition.
listing the storage devices with lsblk command.

I have 10GB /dev/xvdf device. In this device i have a partition of size 6GB which is mounted on a folder fold.

Above you can see in the fold folder i have some data. If my data remains untouched means i have increased or decreased the static partition successfully.
Increasing the partition size from 6GB to 10GB.
- Unmount the fold folder or directory if you will not then you will get errors in the next steps.

- Now to create a partition of size 10GB use the following command:
fdisk “device name”

d: for deleting partition, n: for creating a new partition, p: for primary partition, e: for extended partition.
When we press n it asks for partition type i went for default by pressing enter key. Then fdisk asks for range of partition in sectors i have gone for default range by pressing enter key three times. The default covers the entire disk. it shows the warning of format signature of partition which is ext4(extended4) . I want to keep the format signature or filesystem that’s why pressed N.
To save all the operations finally press w.
- Now checking the errors in the partition with following command.
e2fsck -f "device partition"
here f option is for forcefully check.

- resizing the format table of partition from 6G to its extended size. We are resizing so that our old format table didn’t erase.

- Mounting the directory with following commad:
mount partition_name directory_name

- Checking the files in fold folder or directory.

Our data remains untouched hence we have successfully increased the static partition.
Now decreasing the partition.
- Unmounting the directory fold.

- Checking errors in the partition.

- Resizing the partition from 10G to 5G.

- Deleted partition of 10GB and created a new partition of 5GB.

I deleted partition with d option and then for creating new partition press n. Then press enter key three times for creating primary partition from the 2048 sector. Pressed +5G to create partition of 5GB.
Finally saved the all operations by pressing w.
- listing the storage devices.

- Checked errors in partition.

- Mounted the partition.

- Checked the files of fold directory or folder.

Above also our data remains untouched hence we have successfully decreased the static partition.
Conclusion:
Static partitions or standard partitions are bootable while the Dynamic partitions are not. Each partition type has its own uses. For Dynamic partition you can follow this link https://pshobhitsingh01.medium.com/integrating-lvm-with-hadoop-and-providing-elasticity-to-datanode-storage-13ca9a18b1e8.
I hope you got something useful form this story.