Increase or Decrease the Size of Static Partition in Linux.

Increase or Decrease the Size of Static Partition in Linux.

The steps to increase the size of static Partition in Linux are as follows:

Step1: Create a partition (say of 2Gb)

Step2: Format(ext4) it and mount a folder (say lw) to it

Step3: Create file and store in that partition.

Step4: Unmount folder

Step5: Delete the created partition and save the settings

 Step6: Create new partition of size bigger than that of previous one(say 4Gb)

Step7: Now use “e2fsck -f /dev/sdb1”

This command checks the filesystem(ext2,ext,3,ext4), if error is there like OS shutdown abruptly then, it will resolve it by replaying the committed transactions in the journal. Hence our transaction of creating a file will be redone. 

Step8: Now use “resize2fs /dev/sdb1”

This command format(create filesystem like ext4) the remaining volume added to the partition i.e. 4-2=2.

Step9: Now mount the previously mounted folder i.e. lw.

We will see that our previously created file and its data is present in it..!!!

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image



Ayush Ganatra

AWS Solutions Architect Professional | Certified Kubernetes Security Specialist | Certified Kubernetes Administrator | Azure Administrator

4y

💯

To view or add a comment, sign in

More articles by Shrishti Kapoor

Insights from the community

Others also viewed

Explore topics