How to Increase or Decrease the Size of Static Partition in Linux Operating System

Monil Goyal
3 min readMar 14, 2021

Attaching Virtual hard disk on Virtual OS

1. Creating a Virtual Hard Disk On Virtual machine

2. Attaching Virtual HardDisk to the Virtual OS.

select the HardDisk and click on choose

Use the following command to know your hard Disks has been connected successfully.

fdisk -l
All the Mount Positions

Creating Static Partition And Mounting To A Folder

→ Create a partition on Hard disk

fdisk  Disk_name

→ list the Disk

fdisk Disk_name -l

→ Format the Partition

mkfs.ext4 Disk_name

→ Mount the partion

mkdir  mount_point
mount Disk_name mount_point
df -h → to check

Increasing the Size of Static Partition

To increase the partition size you need to delete old partion and create new partition.

→ Unmount the partition first

umount mount_point

→ Delete the partion

→ Create New partition an remove old signature during creation

It is asking to remove old signature because I put the data in hard disk and I deleted the partition. It is usefull to recover data back.

Increased partition

→ Now, we need to repair Inode table

e2fsck -f Partion_name

→ Format the part of partion in which data is not present.

resize2fs Partion_name

→ Mount the partition

Now see our data is already present in new partition.

Thanks, Everyone for reading…

Keep Learning Keep Sharing !!!

--

--

No responses yet