You can Watch all our Tutorials and Training Videos for Free on ourYouTube Channel

Extending Linux Partition or Filesystem without LVM

extending partition linux without lvm, linux extend non lvm partition, resize linux partition without lvm, resize partition without lvm
There may be a scenario come to us to extending linux partition or filesystem that is not configured with LVM. This post will help you with How to extend linux partition or filesystem without LVM.

If you are interested in learning, Request you to go through the below recommended tutorial.

DevOps Full Course Tutorial for Beginners - DevOps Free Training Online
Docker Full Course Tutorial for Beginners - Docker Free Training Online
Kubernetes Full Course Tutorial for Beginners - Kubernetes Free Training Online
Ansible Full Course Tutorial for Beginners - Ansible Free Training Online
Openstack Full Course Tutorial for Beginners - Openstack Free Training Online
Learn Linux, DevOps and Cloud

I’m going to take the example of a Linux guest under VMware Workstation though this should apply to most hypervisors and flavors of Linux.

Prequisites before extending linux partitions

If your guest VM is critical, we strongly recommended to take a backup to prevent the accidental damages.

We don’t have LVM, Our only option is to increase the size of the hard disk and then expand the partition containing the filesystem we wish to expand.

Consider the example that we have a disk of 5GB for a testing purpose it has some data. We will extend that partition to another 5GB. SO totally we will have a 10GB Partition finaly.

Extending Linux Partition or Filesystem without LVM

This procedure is 100% working method for How to extend Linux Partition or Filesystem:

1. Ensure the disk number, size, cylinders and sectors of the disks to extend using the fdisk command as below.

extending linux partition

In our example, our disk is /dev/sdb which has 5GB size, 10485760 Sectors and mounted in the directory /data

2. Extend the required size 10GB in Hypervisors such as vmware esx, vmware workstation and Microsoft Hyper-V before carrying out the activity.

3. Reboot the server and check again the disks detected using the fdisk command. Now we will see newly extended size as below screenshot.

extend linux partition without lvm

4. Now extend the existing /dev/sdb1 partition to the end cylinder available as shown in the screenshot below.

How to Extend Linux Partition on Linux 

Short description as shows in the above screenshot in steps,

a. fdisk /dev/sdb

b. p (to view partition details)

c. d (to delete the partition)

d. 1 (to select the second partition)

e. n (to create new partition) and select the partition type whether Primary or Extended Partition

f. 1 (to create it as partition 1)

g. Get the first block from the partition details earlier i.e. 2048. Enter this block as start value.

h. Press enter to accept the default as the last block.

i. p (to to list the partition and confirm)

Finally re-read the partition table (partprobe) and resize the extended partition  using the below command,
[root@server1 ~]# partprobe
[root@server1 ~]# resize2fs /dev/sdb1

Thats it.
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.
whatsapp logo