đź”…Increase or Decrease the Size of Static Partition in Linux.

Rishabh
3 min readNov 3, 2020

--

There are two Memory Management Techniques: Contiguous, and Non-Contiguous. In Contiguous Technique, the executing process must be loaded entirely in the main memory. Contiguous Technique can be divided into:

  1. Fixed (or static) partitioning
  2. Variable (or dynamic) partitioning

We are here going to look upon how we going to make static partition a dynamic one:

STEP1:

Add a physical storage to achieve the partition
We have created a 8gb sdb .

STEP2:

>>Creating a partition on sdb disk to use the storage.

>>Creating a 4-GB partition which we will later increase dynamically without deleting the data.

>>Checking the New Partition and storage.

>>Formatting the Partition to Use the sdb storage.

>>Mounting the sdb storage to the /static directory.

>>Creating a file to check later for security purpose.

STEP3:

>>Unmounting the sdb1 to resize the storage and without loosing the Data

STEP4:

>>Deleting the old partition and will be creating new partition of +7GB

STEP4:

>>Using e2fsck : The e2fsck command is used to check the ext2/ext3/ext4 family of file systems. For ext3 and ext4 filesystems that use a journal, if the system has been shut down uncleanly without any errors, normally, after replaying the committed transactions in the journal, the file system should be marked as clean.

>>Increasing the size of sdb1

STEP5:

>>Mounting again to se the storage:

>>As we can see here Size is increased but alos “t.txt” file is not formatted i.e. We have increased the storage without Formatting the Whole Static Storage.

SUMMARY:

1)First created a 4G partition
2)vim t.txt ===> “dvjknskvnn lvccsdjds”
3)df -h ===> sdb1==4G
4)umount /dev/sdb1
5)e2fsck -f /dev/sdb1

6)Creating new partition only
6(a)fdisk /dev/sdb
6(b)d
6(c)n
6(d)p
6(e)+7G
**Important**6(f) N(do not delete ext4 signature)

7)resize2fs /dev/sdb1 +7G
8)mount /dev/sdb1 /ld

9)cat /t.txt ===> “dvjknskvnn lvccsdjds”
10)lsblk ===> sdb1==7G
11)df -h ===> sdb1==7G

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Rishabh
Rishabh

Written by Rishabh

Student from B.tech 2nd Year, A proud ARTH learner, love new technologies, Curious about many thing, likes to explore places, love eating pizza and much more.

No responses yet

Write a response