Unless otherwise noted, articles © 2005-2008 Doug Spencer, SecurityBulletins.com. Linking to articles is welcomed. Articles on this site are general information and are NOT GUARANTEED to work for your specific needs. I offer paid professional consulting services and will be happy to develop custom solutions for your specific needs. View the consulting page for more information.

Resizing Linux Root Volume Group

From SecurityBulletins.com

Jump to: navigation, search

The following is a description of how to reduce a swap logical volume and add the space to root. This was tested on CentOS 4, but should work with many other Linux distributions. Non-root logical volumes are similar, except they can be resized without booting from CD-ROM.

swapoff -a
lvreduce -L 16G /dev/VolGroup00/SwapVol00
mkswap /dev/VolGroup00/SwapVol00
swapon -a
lvresize -L 10G /dev/VolGroup00/RootVol00

reboot from the CD-ROM as "linux rescue", mount the items as read-only. At the prompt, unmount all filesystems in syslinux, then:

resize2fs  /dev/VolGroup00/RootVol00 9G

Personal tools