VMware Cloud Community
TheVMinator
Expert
Expert
Jump to solution

Expand Hard Drive on Linux

I'm out of free space on my Oracle Linux 6 VM with only one hard disk.  Is it possible to obtain more space in Oracle Linux by expanding the size of existing virtual disk?  Or do I need to add an additional virtual disk, then extend the existing partition on to the newly added virtual disk?

Reply
0 Kudos
1 Solution

Accepted Solutions
Texiwill
Leadership
Leadership
Jump to solution

Hello,

0th item, answer this question: Are you Satisfied with your backup?

Then, two approaches.....

1) determine if LVM is in use for the partition in question, if so add a new disk (do not expand) and use LVM to add the new disk to the existing volume

2) if LVM is not in use then you need to know the filesystem involved. If it is an ext? type filesystem then resize2fs will work after you resize the partition. If XFS, there is another way, if another filesystem you need to find its resize tools. Steps would be:

     make disk bigger

     resize partition to GREATER than what it is (never smaller)

     use appropriate resize fs tool

I tend to make all my VMs, LVM VMs just to make this aspect of disk management so much easier.

Best regards,

Edward L. Haletky

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill

View solution in original post

Reply
0 Kudos
6 Replies
siddjayy
Enthusiast
Enthusiast
Jump to solution

Hi dude,

I recently faced this issue and managed to expand the space by adding new hard drive, attaching a document that  I created. See if it helps

TheVMinator
Expert
Expert
Jump to solution

I guess my question is – in windows you don't have to add a new virtual desk to increase the size of an existing partition. You just expand the virtual disk in VMware, then expand the partition in windows.

is it possible to do anything like this in oracle Linux? Or do you have to add another virtual disk if you are going to expand a partition?

Reply
0 Kudos
siddjayy
Enthusiast
Enthusiast
Jump to solution

I think you should be able to do with gparted by following the method in the document,but to increase the size at VM level you need to turn off the VM.

Let me know if you were able to do it.

TheVMinator
Expert
Expert
Jump to solution

Unfortunately don't have permissions to try it - can anyone else verify if this works?

Reply
0 Kudos
Texiwill
Leadership
Leadership
Jump to solution

Hello,

0th item, answer this question: Are you Satisfied with your backup?

Then, two approaches.....

1) determine if LVM is in use for the partition in question, if so add a new disk (do not expand) and use LVM to add the new disk to the existing volume

2) if LVM is not in use then you need to know the filesystem involved. If it is an ext? type filesystem then resize2fs will work after you resize the partition. If XFS, there is another way, if another filesystem you need to find its resize tools. Steps would be:

     make disk bigger

     resize partition to GREATER than what it is (never smaller)

     use appropriate resize fs tool

I tend to make all my VMs, LVM VMs just to make this aspect of disk management so much easier.

Best regards,

Edward L. Haletky

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
Reply
0 Kudos
TheVMinator
Expert
Expert
Jump to solution

ok thanks again - much appreciated.

Reply
0 Kudos