Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed a centos in vm, then expand the volume of hard disk by the setting of vm.

How to resize the hard disk without re-install?

I do not set lvm in the frist install

share|improve this question

migrated from May 31 '11 at 16:55

This question came from our site for professional and enthusiast programmers.

Install GPartEd, and open it. Once it's been loaded, click the partition you wich to expand. Click the Move/Resize button in the toolbar and set the new size of the partition. Once you're done, click the Apply button in the toolbar.

share|improve this answer
I think the partition you're trying to expand should be unmounted so you could try by booting the VM with a gparted livecd ISO – DrNoone May 31 '11 at 20:06

It depends on the filesystem you used. You can resize reiserfs and xfs online (resize_reiserfs and xfs_grow are the commands, IIRC), and you can grow ext2/3/4 using resize2fs. In most all cases, you just follow the command with the path to the device (ie, resize2fs /dev/sda2) and it'll grow to fill the current size of the device - which is apparently what you want to do in this case.

If you partitioned your drive, you'll need to resize the partition as well; you can do that with parted from the command line, but you need to be very careful. Rebooting and bringing the system up with gparted, as RobinJ suggested, is much easier and safer. You'll have to dismount the device so the partiotn tables will be reread anyway, and if this is the root filesystem, that means you'll have to reboot.

share|improve this answer

You must log in to answer this question.