Shrink ext3 Partitions (Centos 5/RHEL 5 way)
NOTE : This article come with ABSOLUTELY NO WARRANTY about any data loss.
Rember to do a FULL BACKUP of your filesystem every time you need to expand/shrink them.
Here you are an how-to for shrink ext3 partitions.
NOTE : You can’t perform on-line shrink, so the filesystem must be unmounted. If you can unmount your filesystem, do this and go to step 2.
STEP 1
If you can’t unoumt your filesystem (eg. root filesystem), you need to boot from the installation CD, and type linux rescue at the boot prompt.
NOTE : You can select your preferred language, don’t turn up ethernet link, don’t scan for filesystem.
When you are at the prompt, simply type this commands :
lvm vgscan -v
lvm vgchange -a y
NOTE : The first command perform a scan of the LVM , trying to find the VolumeGroup, with the second command you activate it.
STEP 2:
Suppose you are about to resize the Logical Volume LogVol00 inside the Volume Group VolGroup00 for a size of 10 GigaBytes
Resize the filesystem, using this command :
e2fsck -f /dev/VolGroup00/LogVol00
resize2fs /dev/VolGroup00/LogVol00 10G
STEP 3:
If you need to retrive the space in the LVM (why not ?) , run this :
lvm lvresize /dev/VolGroup00/LogVol00 -L 10G













1 Trackback or Pingback for this entry
11 January 2010 on 6:30 PM
[...] Read more from the original source: Shrink ext3 Partitions (Centos 5/RHEL 5) – Crippa Andrea [...]