[linux-lvm] Cannot unmount logical volume to reduce it

Dan White ygor at comcast.net
Tue Nov 8 20:05:11 UTC 2011


Thanks Joe.  That was a great suggestion.

Here's what I did (for the benefit of others trying to do this):

Boot into the rescue CD, did NOT mount the file systems.

At the prompt:
    lvm vgscan

This created /dev/volgrp01

Then:
    lvm vgchange -ay

This created /dev/volgrp01/usrVol /dev/volgrp01/varVol etc

These are the volume group and logical group names I gave the original OS installation.

Then, using /dev/volgrp01/usrVol as an example, to be resized to 10 gigabytes:
    e2fsck -pvf /dev/volgrp01/usrVol
    resize2fs -f /dev/volgrp01/usrVol 10g
    lvm lvresize -v -L 10g /dev/volgrp01/usrVol

The system warns and whines aboiut the last step, but I did not mess up my file systems.

“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)

----- Joe Pruett <joey at q7.com> wrote:
> when you use the rescue disk, you need to tell it to skip the mounting
> of the drives.  and i hope you know that you need to shrink the file
> system first before you reduce the lv.  i don't know if the appropriate
> tools will be available on the rescue disk without mounting the main
> system drive, though.  using a livecd might be needed.
> 
> On 11/08/2011 10:00 AM, Dan White wrote:
> > RHEL5.7 x86_64
> > I want to reduce the size of the logical volumes on a server.
> > The two giving me trouble are mounted on /var and /usr
> >
> > I cannot unmount them to reduce them.  Even tried booting into a rescue disc.
> >
> > Any suggestions ?
> >
> > “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
> > Bill Waterson (Calvin & Hobbes)
> >
> > _______________________________________________
> > linux-lvm mailing list
> > linux-lvm at redhat.com
> > https://www.redhat.com/mailman/listinfo/linux-lvm
> > read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
> >
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm at redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/




More information about the linux-lvm mailing list