Increase or Decrease the Size of Static Partition in Linux

Gayathri Priya
3 min readMar 14, 2021

How to resize the static partition in Linux with the help of the resize2fs command. The basic prerequisite for this task is Linux partition.

Linux Partition:

A hard disk can be divided into several partitions. Each partition functions as if it were a separate hard disk. There are several reasons why we create the partition:

  • multiple operating systems on the same disk.
  • different file systems on different partitions.
  • more efficient disk space management.
  • different security settings on different partitions.
  • easier backup procedure.

What is a static partition?

Static(Fixed) Partitioning:
->According to geek for geeks

This is the oldest and simplest technique used to put more than one process in the main memory. In this partitioning, a number of partitions (non-overlapping) in RAM is fixed but the size of each partition may or may not be the same. As it is a contiguous allocation, hence no spanning is allowed. Here partition is made before execution or during system configure.

As illustrated in the above figure, the first process is only consuming 1MB out of 4MB in the main memory.
Hence, Internal Fragmentation in the first block is (4–1) = 3MB.
Sum of Internal Fragmentation in every block = (4–1)+(8–7)+(8–7)+(16–14)= 3+1+1+2 = 7MB.

Suppose process P5 of size 7MB comes. But this process cannot be accommodated in spite of available free space because of contiguous allocation (as spanning is not allowed). Hence, 7MB becomes part of External Fragmentation.

Increasing or Decreasing the size of Partition is very easy in Linux, we just need to do some simple steps, but we first need to create a partition in it.

Step 1:- Attach a Virtual Hard Drive in Linux OS.

Step 2:- Create a Partition in the Hard Drive…

Step 3:- Formatting the Partition

Step 4:- Mounting the Partition to a folder

Step 5:- Creating a File

Step 6:- Unmounting it and creating a New Partition to the existing Partition

Step 7:- Resizing and mounting it to check if we have all the files inside.

This shows that we can resize the static partition without damaging the files and it is also very easy to do it…

Thank you for reading the article…🤗

Keep Learning💫Keep Sharing🤝🏻

--

--