[KLUG Members] Re: How do I resize a root LV?

Bob Kanaley members@kalamazoolinux.org
Fri, 20 Feb 2004 09:46:15 -0500


Adam et. Bruce

Thanks for the help. I hadn't found the steps to activate a VG from a
non-hard disk boot. Most of my LVM boxes are Suse and use ext2/3 for the
/boot and root file systems.

The Suse whitepaper on LVM only discusses resizing LV's with ext2/3 and
Reiser file systems. With Reiser you can grow the partition while mounted,
but in both cases you have to unmount the file system to shrink it before
you shrink the LV. Although the white paper is a couple of years old the
omission of XFS in this document led me to believe that Suse doesn't support
XFS on VG's. Maybe XFS is something I should look into if you can shrink
file systems while mounted.

On a similar note, the Suse install doesn't support booting LV's with GRUB.
You have to choose LILO if you want LVM support. Go figure. I haven't tried
going back after the install and switching from LILO to GRUB to see if it
works. I presume that Suse has a good reason for not using GRUB with LV's.
Same logic with the choice of file systems on my LV's.

Thanks again for the help.

Bob

Robert V. Kanaley
Manager Information Systems
Agdia, Inc.
rvk@agdia.com
http://www.agdia.com


> -----Original Message-----
> > I want to shrink a LV mounted as root. I have no problems
> resizing non-root
> > LV's, but to resize the root fs and LV the root file system
> needs to be
> > unmounted. I tried to do this in single user mode, but no dice. Root
> > partition is still in use.
>
> We are talking about ext2/3?  What your hitting is a filesystem
> limitation that they can't be resized online.  If using XFS
> see the xfs
> utilites as XFS can be resized online.
>
> > When I boot with a BBC or Knoppix CD, the LV info on the
> hard disk is never
> > read. The kernel loaded from the CD just sees the hard disk
> as having a
> > small /boot partition and a bunch of unallocated type 83
> sectors. How do I
> > get the kernel loaded from the CD to recognize the LVM
> structure on the hard
> > disk so I can resize the unmounted root LV?
>
> Does it provide the vg.../lv... utilities?
>
> You need to run "vgscan" to probe the physical devices attached to the
> system for LVM data.  You can then 'activate' a volume group
> by doing a
> "vgchange -ay"  - 'Vary On' "A"ll volume groups and assume
> "Y"es to all
> prompts.
>
> From: Bruce Smith <bruce@armintl.com>
> > > I want to shrink a LV mounted as root ....
> >
> > If using XFS see the xfs utilites as XFS can be resized online.
>
> Can you _shrink_ an XFS volume?
>
> xfs_growfs(1) talks about growing but not shrinking,
> and no other utility jumps out at me to do XFS shrinking.
>
>  - BS