Providing Elasticity To Static Partition

Vivek Singare
3 min readMar 14, 2021

Providing elasticity to static partition so that we can increase or decrease the size without losing data

In dynamic partition we can have elasticity using LVM (Logical Volume Management) but in case (like hadoop cluster ) if we have requirement to make static partition elastic we can do it!

First attach external hard disk to VM, here I have attached 10 GB volume

Check disks:

as above external disk /dev/sdb of 10 GB is attached but in order to use it we must create partition and format it.

Out of 10GB here I created one partition of 5GB

It is created successfully! Let’s use it.

Attached that partition to /mydata directory so whatever we store in that directory it will get stored in that externally attached disk.

One file hello.txt is stored in that directory. And now let’s increase the size of that mounted partition.

In order to increase the size, we have to unmount that partition because unlike dynamic partition on the go we can’t do it, this is the drawback of static partition.

Unmounted partition but data we stored in that directory is missing.

Delete previous partition and create new one with required size out of the total size

here is have created new partition of 8GB

Now partition size is increased but we don’t want to lose previous data on that disk. Check it with e2fsck for previous data inode table. And with resize2fs, resize the partition with previous inode table including new one

Now mount this partition to /mydata directory and check for our data.

We have successfully increases size of static partition without losing data!

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

--

--

Vivek Singare
Vivek Singare

No responses yet

Write a response