Increase root file system size ...

Hello Admins,

I am running a redhat linux 5 on vmware workstation.

I need to increase or add some more space to my root (/) partition. I don't have any LVM configured..

Please suggest.

[root@localhost /]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             3.8G  3.1G  556M  85% /
tmpfs                 506M     0  506M   0% /dev/shm
/dev/sda3             8.9G   21M  8.4G   1% /home

Or How can I allocate the extra space available for "/home" to "/" ..?

Short answer is.... you cannot.

You would need more space. However, since you are using VMware, you can do the following. Create a new virtual machine and allocate a new disk. You can then add the existing virtual disk to the new machine and then use another copy of linux to dd the existing vmdk to the new vmdk. Then you can expand the root partition via a live/rescue disk with tools such as resize2fs.

1 Like

Okay...How about LVM...

Can I mirror the root slice using LVM and then add slice to it like solaris 10?

LVM doesn't work on a slice philosophy the way Solaris did. It works on a PV > VG > LV system, where PV is physical volume (a disk or partition), VG is a volume group, the logical construct of one or more PVs, and LV is a section of a VG, made up of extents.

You can add multiple PVs into a VG, even migrating old PVs out and adding new ones in, moving the data around. However, you can't add the existing root volume to a VG without losing the data, as technically, the partition type changes and the data is not encapsulated.

You CAN try to migrate to LVM, but it is not fool proof and if something goes wrong, the data can be destroyed. It is not as safe as I would like to recommend.

http://www.linuxweblog.com/blogs/sandip/20071007/convert-root-filesystem-lvm
http://tldp.org/HOWTO/LVM-HOWTO/upgraderoottolvm.html

  • sorry my / disk is under lvm

check the below KB its usefull for increase the size of vmdk
i was done this for one of vm under ESX4.1i

VMware KB: Increasing the size of a virtual disk

  1. shutdown the VMmachine
    2.edit the vmsettings
    3.increase the vmdisk size
  2. boot the vm create the new slice
    5.extend the vg then lvextend