I have a Virtual Host (CentOS 6.4) running on VMware. Hard disk of this PC is 100GB but I want to expand it to 500GB.

I tried to expand the Hard Disk (SCSI) to 500GB.

It's ok, no errors. But another PC (Windows 7) connected to this PC (CentOS 6.4) via samba, just shows "9GB free of 100GB". It means the PC (CentOS 6.4) has not expanded the disk.

I used an external HDD (500 GB) to run this PC (CentOS 6.4).

What did I do wrong?
Did I missed something?

  • You increased the disk size but you neither resized the partition nor allocated the added space to a new partition. – Shadur Dec 17 '13 at 15:12
  • Could you please provide a df -h? In this way we can help understanding what you need to do. – ludiegu Dec 18 '13 at 9:09

I don't know if vmware will edit the partition table for you, but You need to also expand the file system. if you are using ext2/3/4 the tool to do this is resise2fs. read its man page for details. Some other file systems have similar tools. those that do not will need a reformat.

  • 1
    He will need to resize the partition in addition to the filesystem, or if he is using LVM, add another partition to the VG and extend. – jordanm Dec 17 '13 at 4:05
  • 3
    I would be careful with any resizing one attempts to do on a filesystem. If you don't know what you're doing you can wreck your data. I would suggest setting a sacrificial instance up identical to the real one and do a dry run with it 1st. – slm Dec 17 '13 at 4:31
  • Thank you, but i can't format my data... So sorry. I found that my SDA: 483gb, SDA1: 300GB, SDA2: 105gb. So i think that SDA and SDA1 have not mounted to SDA2. Could you please help me how to mounted? – Thomas Dec 19 '13 at 7:54

Just increasing the virtual 'physical' disk size does not magically enlarge the size of the mounted partition.

If you check with fdisk -l /dev/diskname (probably sdb but make sure you have the right one first) you'll see a 100G partition /dev/diskname1 and 400 gigabyte unallocated.

The smoothest way to do this, especially if you're unfamiliar with the various ins and outs, is using gparted on a live image -- go here and download the iso into the vmware datastore, then tell vmware to mount the image and boot into BIOS setup on next launch.

Reboot, then in the virtual BIOS change boot order to try the CD first so it'll launch the gparted ISO. Follow the instructions to resize your drive, then once you've shut down unmount the ISO in vmware and restart.

This method has worked flawlessly for me with every system I've used it on so far.

  • Thank you so much. But is there any tutorial how to mount sda and sda1 to sda2? Please help me. – Thomas Dec 19 '13 at 7:54

Here is a howto tutorial on adding hard disk to centos6. Click here

Also you have to mkfs.ext3 /dev/sdb or mkfs.ext4 /dev/sdb to format to ext3 or ext4 file system. Then you have to mount that partition, mount /dev/sdb /tmp/test.

Now you have to share this /tmp/test folder in samba server so that you can use that 500gigs HD from a remote system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.