Link to home
Start Free TrialLog in
Avatar of jpquonce
jpquonceFlag for United States of America

asked on

How to add 2nd hard drive to Linux for additional storage, CENT OS 4 and it Virtual Server

I need help and I need it ASAP as this is actually critical for a mail server running out of space.

This is a Virtual Server on VMWARE. All I want to do it add a 20 GB hard drive to this linux server.

Also if it makes it any easier I do have Webmin installed on this server as well.

Thanks in advance.
Avatar of hugetoon
hugetoon
Flag of France image

Your question is not copletely cllear.
Do you need to add an additional virtual disk to a virtual machine or do you want to install a real hard disk in a real server that runs a vmware server?

Avatar of jpquonce

ASKER

Sorry in my head it sounded right. I am adding a Virtual Disk to the VM.

Right now it has a 20GB virtual disk and I want to add an additional 20GB virtual disk.
If you want to add space to a VM and you have enougth space on the host system,  you may just grow the existing vmdk.
to grow an existing vmdk you can use  vmware-vdiskmanager

for example if your vmdk is 100G and you want it to be 120G and is named disk.vmdk:

vmware-vdiskmanager -x120GB disk.vmdk

/!\ Pay attention to the fact that you specify the NEW size, NOT the amount to be added /!\

Then inside the VM you have to grow the partition and the filesystem inside

The particular sequence is dependent on your partition layout and if you use LVM.

Of course all this is DANGEROUS and you should have a working backup before starting
On which VMware Product is the Cent OS Server hosted ? VMware Workstation, VMware Server or VMware ESX
Creating an additional virtual disk in a VM is rather simple using the GUI: just edit the VM settings and add a hard disk. To do so (aswell as growing an existing one) you'll have to shutdown the VM
It is ESX 3x.

I have added a virutal disk via Virtual Center but I am having trouble getting linux to see it properly.

I don't care if I expand it or get linux to see another Hard Drive. I need more space and I am having trouble with the linux part of it.

Also I just tried to run vmware-vdiskmanager -x30GB dis.vmdk and it can not find vmware-vdiskmanager
Did you add an SCSI or an IDE disk ?
what you get when you do

cat /proc/partitions

in the VM ?
SCSI and this is the output


[root@clone ~]# cat /proc/partitions
major minor  #blocks  name

   8     0   20971520 sda
   8     1     104391 sda1
   8     2   20860402 sda2
   8    16   20971520 sdb
 253     0   19759104 dm-0
 253     1    1048576 dm-1

So I am guessing sdb is the new one but what do I need to do now.

Thanks again I really appriciate your help.
fdisk -l commands lists the currently connected hdds to your VM.

Go through this doc to create your partitions - http://tldp.org/HOWTO/html_single/Partition/
ASKER CERTIFIED SOLUTION
Avatar of hugetoon
hugetoon
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Alternatively you seem to have an LVM setup
 so may be it would be better to add /dev/sdb1 as a phisical volume instead of an independent filesystem
Thanks for the quick responses and the help.