linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Cannot unmount logical volume to reduce it
@ 2011-11-08 18:00 Dan White
  2011-11-08 18:16 ` Joe Pruett
  0 siblings, 1 reply; 5+ messages in thread
From: Dan White @ 2011-11-08 18:00 UTC (permalink / raw)
  To: linux-lvm

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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Cannot unmount logical volume to reduce it
  2011-11-08 18:00 [linux-lvm] Cannot unmount logical volume to reduce it Dan White
@ 2011-11-08 18:16 ` Joe Pruett
  2011-11-08 18:52   ` Dan White
  2011-11-08 20:05   ` Dan White
  0 siblings, 2 replies; 5+ messages in thread
From: Joe Pruett @ 2011-11-08 18:16 UTC (permalink / raw)
  To: LVM general discussion and development

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@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Cannot unmount logical volume to reduce it
  2011-11-08 18:16 ` Joe Pruett
@ 2011-11-08 18:52   ` Dan White
  2011-11-09  9:44     ` James Hawtin
  2011-11-08 20:05   ` Dan White
  1 sibling, 1 reply; 5+ messages in thread
From: Dan White @ 2011-11-08 18:52 UTC (permalink / raw)
  To: LVM general discussion and development

Thanks.  I'll try it and see what I get.
I may be able to customize a rescue disc.

----- Joe Pruett <joey@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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Cannot unmount logical volume to reduce it
  2011-11-08 18:16 ` Joe Pruett
  2011-11-08 18:52   ` Dan White
@ 2011-11-08 20:05   ` Dan White
  1 sibling, 0 replies; 5+ messages in thread
From: Dan White @ 2011-11-08 20:05 UTC (permalink / raw)
  To: LVM general discussion and development

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@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@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@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Cannot unmount logical volume to reduce it
  2011-11-08 18:52   ` Dan White
@ 2011-11-09  9:44     ` James Hawtin
  0 siblings, 0 replies; 5+ messages in thread
From: James Hawtin @ 2011-11-09  9:44 UTC (permalink / raw)
  To: LVM general discussion and development

Dan White wrote:
> Thanks.  I'll try it and see what I get.
> I may be able to customize a rescue disc.
>   
IF you don't mount the disks, you may need to so a pvscan and a vgchange 
-a y

the other alturnative when you use a rescue disk is to just inmount the 
filesystems, you will not have a problem as the disks are not in use.

The third alturnative is to take out the disks from the fstab, and use 
grub to boot the machine single user however, newer OS like centos 6 
will not like this rather than dropping to a shell will just throw a 
wobbly and reboot.

James

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-11-09  9:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 18:00 [linux-lvm] Cannot unmount logical volume to reduce it Dan White
2011-11-08 18:16 ` Joe Pruett
2011-11-08 18:52   ` Dan White
2011-11-09  9:44     ` James Hawtin
2011-11-08 20:05   ` Dan White

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).