• We did not send an email asking for donations - please read this post.

Expand partition of CentOS 6.5

garvind25

New Member
Joined
Oct 7, 2022
Messages
7
Reaction score
0
Credits
70
Hi,



I am new to CentOS and Virtual Machines. I got a CentOS 6.5 VM on the internet and wanted to try it out. Hope someone can help me in its usage.



I loaded the guest OS (CentOS 6.5) on VMWare Workstation 10. The HDD for CentOS distribution was 35GB. I needed to increase it to 60GB. So I shut down the guest OS, went to the corresponding settings of VM Ware and expanded its HDD to 60GB. When I restarted the guest OS, I logged in as admin and ran the command fdisk /dev/sda. I was able to create a new partition sda3. Pls see the screenshot below:

merge_partition.jpg


My problem is that I want to merge sda3 into sda1 (sda1 is boot partition) so that the size of sda1 increases. How to do so pls? Do note that the partition type of sda1 and sda3 is Linux (not Linux LVM).



I look forward to your kind response.



Thanks and Regards,

Arvind Gupta
 


forester

Active Member
Joined
Mar 5, 2022
Messages
443
Reaction score
244
Credits
3,153
Please submit a screenshot of the drive's partitions in Gparted
 
OP
G

garvind25

New Member
Joined
Oct 7, 2022
Messages
7
Reaction score
0
Credits
70
Please submit a screenshot of the drive's partitions in Gparted
Thanks for your response. I could not install Gparted in the guestOS (CentOS 6.5) as it does not have any web browser ( and no internet connectivity). However I managed to take snapshots from the Disk Utility. Hope this works for you.

Screenshot_1.png



Screenshot_2.png


As you may see in both the snapshots there is dev/sda1 and dev/sda3. I want to merge the space of /dev/sda3 into /dev/sda1.

Thanks again,
Arvind Gupta.
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
7,457
Reaction score
6,447
Credits
60,440
You need to boot to a live instance (just like when you installed it - which means selecting the boot device, which is F12 on VirtualBox but I dunno what it is on VMware) and then grow your partition to take up that space.

You could do that with the disk utility you have there, or you could do it with GParted. You just need a distro with GParted already installed.

It's the same way you'd do it in real life. In real life, you'd start your computer, select booting to a live DVD/USB, and then use the tools on that disk to adjust the partitions. You can't adjust a partition that's mounted, so you can't do it from within the OS when you're working on the same disk (virtual or real) that the OS is installed on.
 
OP
G

garvind25

New Member
Joined
Oct 7, 2022
Messages
7
Reaction score
0
Credits
70
You need to boot to a live instance (just like when you installed it - which means selecting the boot device, which is F12 on VirtualBox but I dunno what it is on VMware) and then grow your partition to take up that space.

You could do that with the disk utility you have there, or you could do it with GParted. You just need a distro with GParted already installed.

It's the same way you'd do it in real life. In real life, you'd start your computer, select booting to a live DVD/USB, and then use the tools on that disk to adjust the partitions. You can't adjust a partition that's mounted, so you can't do it from within the OS when you're working on the same disk (virtual or real) that the OS is installed on.
Ok. How to merge the sda3 to sda1 using the Disk Utility pls? I am new to Linux and virtual machine. I will deeply appreciate a step by step guide pls.

Thanks in advance.
Arvind Gupta.
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
7,457
Reaction score
6,447
Credits
60,440
You can follow these directions:


I don't do it often enough to have it committed to memory.
 
OP
G

garvind25

New Member
Joined
Oct 7, 2022
Messages
7
Reaction score
0
Credits
70
You can set up a GParted Live USB using the information here.

https://gparted.org/livecd.php

Wizard
Thanks for your reply. Since I am using CentOS as a guest OS in windows (through VMWare Workstation), I am not sure how to use a GParted Live USB in it (for Windows, GParted Live USB will work easily).

Anyways, I tried to load GParted directly in my CentOS guest OS. I downloaded the latest Linux based version of GParted in Windows and transferred it to CentOS. When I tried to install it, there were certain files missing. Next, I checked the release date of CentOS 6.5 (the CentOS version installed at my end). It was released in Nov 2013. I then downloaded the GParted version released before this date and tried to install it. It also showed certain files as missing.

In a nutshell, since the guest OS does not have direct internet connectivity and space in it, I am unable to use GParted and increase the size of the disk in CentOS.
 
OP
G

garvind25

New Member
Joined
Oct 7, 2022
Messages
7
Reaction score
0
Credits
70
You can follow these directions:


I don't do it often enough to have it committed to memory.
This method seems to be for cloud servers. I need to unmount the drive which I need to expand. Since I want to expand the Boot drive of the Guest OS, this may not be possible while I am logged in to the Guest OS (unless I am missing something here - I am not an expert of Linux).
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
7,457
Reaction score
6,447
Credits
60,440
This method seems to be for cloud servers.

It's the same process, minus logging in.

I need to unmount the drive which I need to expand.

That is correct. That's why you do it outside the OS with an ISO that has GParted on it.

this may not be possible while I am logged in to the Guest OS

Correct, it is not possible. You must be outside the OS, so that's why you boot to the live environment. During the boot process for the VM, there should be a way to boot to an ISO. I don't use VMware enough to know, but it's F12 with VirtualBox. (I do this every day with VBox.)
 
OP
G

garvind25

New Member
Joined
Oct 7, 2022
Messages
7
Reaction score
0
Credits
70
It's the same process, minus logging in.



That is correct. That's why you do it outside the OS with an ISO that has GParted on it.



Correct, it is not possible. You must be outside the OS, so that's why you boot to the live environment. During the boot process for the VM, there should be a way to boot to an ISO. I don't use VMware enough to know, but it's F12 with VirtualBox. (I do this every day with VBox.)
Thanks for the description. I created a Live GParted disk using UNetBootIn and GParted Live ISO (using the latest i686 aka 32 bit option - I formatted the 16 GB pen drive in Fat32 format; Win7 does not have Fat 16/ Fat option). I then entered the BIOS of the VM Workstation from the options VM > Power > Power on from BIOS. Here I could see in the Boot section that 'Removable devices' already has the highest priority. However when I rebooted the VM Workstation, the GParted was not getting loaded (the guest OS was getting loaded every time I tried).

In a nutshell, the GParted Live option is not working for me. Unless I am using the wrong GParted Live version, is there any other way/ alternate of GParted available to extend the HDD of the guest OS pls?

Arvind Gupta.
 
OP
G

garvind25

New Member
Joined
Oct 7, 2022
Messages
7
Reaction score
0
Credits
70
Don't burn it to USB, just select the .iso to boot from. There's no reason to use hardware for this, as it's all virtualized.
Thanks for your reply. I tried this as well. I formatted the pen-drive and copied the GParted live ISO in it. Entered the BIOS of VM Work Station and ensured that the ‘Removable Devices’ has the highest priority. Connected the pen drive to the PC and rebooted the Virtual Machine. Tried several times but the GParted Live CD did not boot the VM. (once CentOS booted I could however see the pen-drive getting detected by the guest OS)

Any other pointers pls?
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
7,457
Reaction score
6,447
Credits
60,440
Again, you shouldn't need to do anything in the physical world. In the VMware settings, find the optical disk drive settings and point it at the .iso that's located on your computer. Start VMware and enter the boot configuration. Pick the optical drive, whatever that's called.

Scroll down on this page to the Extend Your Partition bit...


That looks about right, but I am not a VMware user. You don't do anything with physical devices.

You don't use any extra hardware for this. You don't need a USB drive. You just need to tell VMware to boot to the .iso that's already on your computer.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Latest posts

Top