Increase or Decrease the Size of Static Partition in Linux!!!

Kanishka Shakya
3 min readMar 11, 2021

Disk Partitioning in Linux??

large storage devices are divided into separate sections called partitions. Partitioning also allows you to divide your hard drive into isolated sections, where each section behaves as its own hard drive.

⭐Increase the static partition in Linux

To perform this practical you need basic knowledge of Linux partitions so in this part, we will increase our static storage.

Let’s get started

Step1:- Provide LVM Attached a Hard Disk in the Virtual Machine.

I added a Hard Disk of 30 GB storage for data node and mount in one directory.

Step2:- Creating Partition Formatting and Mounting

when we creating new partition it by default selects primary type.So we have now storage devices sdb.

So,new partition has been created .we can check with the another command.

Step3:- Now, that we have created a Partition we have to Format the partition that we have created.

Step4:- Creating the mount disk

After creating the directory we have to mount the created partition to the directory and we can see our all drive device partitions.

⭐Decrease the static partition in Linux

Step5:- We need to Unmounted the device.

Step6:- After unmount the device we have to delete that partition and create or extend new partition .

d: to delete partition in the device

w: to save all settings

Step7:- So,we delete the partition and now we have to create the new partition.

n: for the new partition

p: for primary partition

e: for extended partition

w: to save all settings

Step8:-Repair my partition table.

Now, we have to check the device using “e2fsck -f” this command checking the file system.

Step9:- Now, we have to resize the file system.

Step10:- Now, Mount the new partition.

now, we can see that the data we had created for testing remains safe and there is no data loss even if we delete the partition.The size of the partition also gets increased or decreased.

Finally, Increased or Decreased the size of Static Partition in linux is Successfully Accomplished!!!

THANK YOU 🌟!!!

--

--

Kanishka Shakya

Aviatrix Certified Engineer | DevOps | Python | Big Data | RHCSA 8 | AWS-CSA | AWS-DEVELOPER | Ansible | Docker | CKA & CKAD | GIT & GITHUB |