Highlighted
Enthusiast
Enthusiast

Resize Linux root partition

I'm running a SUSE Enterprise Linux 9 VM on ESX 3.5 and my root partition is filling up. I've expanded a Windows boot partition before on ESX, but not a Linux root partition. Can I use something line QTParted to resize the linux root partition? I'm assuming I use the same vmkfstools command to make the virtual drive bigger. I'm wondering what the steps are to make the Linux VM see the bigger root drive.

Thanks.

Tags (3)
0 Kudos
12 Replies
Highlighted
Immortal
Immortal

You can expand the "disk" by using vmkfstools, but it depends on your guests root partition file system if and how you can reflect the larger disk there. Check if VMare Converter can help you here. It is often suggested as an appropriate tool to expand or shrink guest partitions.

AWo

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
0 Kudos
Highlighted
Enthusiast
Enthusiast

I used the mount command on my Linux VM and it says the root partition is reiserfs.

0 Kudos
Highlighted
Enthusiast
Enthusiast

Once the volume has been resized run 'resize_reiserfs /dev/devname' to resize the reiserfs filesystem.






RHCE, VCP

Blog: http://computing.dwighthubbard.info

RHCE, VCP Blog: http://computing.dwighthubbard.info
0 Kudos
Highlighted
Enthusiast
Enthusiast

The "man" page for resize_reiserfs says it enlarges or shrinks an un mounted reiserfs filesystem. I need to do this to the root partition. Do I have to mount the virtual disk for the root partition onto another Linux VM?

0 Kudos
Highlighted
Enthusiast
Enthusiast

It's been a while since I've done a reiserfs resize. But I remember

it allowing you to increase the filesystem size while it's mounted,

but required dismounting the filesystem if you needed to shrink it.

So you should be able to boot up and resize the root filesystem while

it is being used.

RHCE, VCP Blog: http://computing.dwighthubbard.info
0 Kudos
Highlighted
Immortal
Immortal

Did you use LVM when you configured your OS? If not, did you partition your drive so as to break up a disk into smaller partitions? If you partitioned a disk, remember, that using vmkfstools adds space to the end of the drive. If your / drive is not at the end of the drive, meaning the last partition, you will not be able to extend the space, unless you move all of the other partitions over. If you used LVM, then the process is a MUCH SIMPLER.

Extend the disk using vmkfstools. Create a new physical volume. Extend the volume group that your root volume is on with the new physical volume. Then increase your logical volume. Then increase your filesystem.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
0 Kudos
Highlighted
Enthusiast
Enthusiast

I didn't use LVM when I installed the OS. Can I boot the VM from a Knoppix CD and use QTParted to move the partitions and increase the root partition?

0 Kudos
Highlighted
Immortal
Immortal

You should be able to use your SuSE guest installation media.

AWo

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
0 Kudos
Highlighted
Immortal
Immortal

I know parted can do it by itself. If the options are available in qtparted/gparted, I believe so, but don't know for sure. But as long as you move the drives over and expand the partition, you will be able to resize the filesystem to encompas that partition as others have already pointed out. I would strongly recommend using LVM in the future, though.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
0 Kudos
Highlighted
Virtuoso
Virtuoso

Try the systemrescuecd and qtparted. I always make a clone first before modifying partitions.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

http://blog.mr-vm.com

http://www.vmprofessional.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-=-=-=-=-=-=-=-=-=- http://blog.mr-vm.com http://www.vmprofessional.com -=-=-=-=-=-=-=-=-=-=-=-=-=-=-
0 Kudos
Highlighted
Enthusiast
Enthusiast

the reiser resize tools should do it, you can do it while it's mounted since you add space, there's no need to unmount it.

However, remember that if your root (/) partition is not the last, it may not be optimal since it will be separated in two parts...

On the other hand, it's a virtual disk so you don't have to bother about the disk i/o...

I would try it...

If it don't work, create another vm and use the Ghost for Linux(G4L) tool to ghost your partitions to the new host, with a bigger / (root)

0 Kudos
Highlighted
Contributor
Contributor

Hi,

I wanted to install a Oracle Virtual Machine on a linux host. After initial configuration settings, when I run the installer, installation is getting aborted, getting following errors:

=========================================================

Starting install...

Traceback (most recent call last):

File "/usr/sbin/virt-install", line 497, in ?

main()

File "/usr/sbin/virt-install", line 461, in main

dom = guest.start_install(conscb)

File "/usr/lib/python2.4/site-packages/virtinst/ParaVirtGuest.py", line 221, in start_install

(self.kernel, self.initrd) = self._get_paravirt_install_images()

File "/usr/lib/python2.4/site-packages/virtinst/ParaVirtGuest.py", line 97, in getparavirt_install_images

nfsmntdir = tempfile.mkdtemp(prefix="xennfs.", dir="/var/lib/xen")

File "/usr/lib/python2.4/tempfile.py", line 328, in mkdtemp

_os.mkdir(file, 0700)

OSError: No space left on device: '/var/lib/xen/xennfs.OEtz1N'

#

=========================================================

With ref to last error: I checked the disk size by ruuning the command:

  1. df -h

Filesystem Size Used Avail Use% Mounted on

/dev/hda2 3.0G 3.0G 0 100% /

/dev/hda3 145G 27G 119G 19% /OVS

/dev/hda1 99M 24M 70M 26% /boot

tmpfs 272M 0 272M 0% /dev/shm

/OVS/iso_pool/Enterprise-R4-U5-x86_64-disc3.iso

638M 638M 0 100% /media/iso

As per the above details it is confirmed that ther is no space at all in "/dev/hda2". But there is enough space in "/dev/hda3" --> 119 GB. I guess because of this reason installion is is failing.

Could there be any other reason for the failure of installation?

If non availability of the space is the reason,Is it possible to incresae the space in "/dev/hda2" ?

Any Help please?

Regards,

Vinay.

0 Kudos