On Wed, 2 Feb 2005 16:01:40 -0800, Carl Lowenstein
<[EMAIL PROTECTED]> wrote:
> On Wed, 2 Feb 2005 09:57:20 -0800, Tracy R Reed <[EMAIL PROTECTED]> wrote:
> > On Tue, Feb 01, 2005 at 10:28:21PM -0800, Carl Lowenstein spake thusly:
> > > Presumably I want to shrink the 149GB LV and start setting up some
> > > smaller partitions, so that  I can separate /var and /tmp and /usr and
> > > /usr/local and /home and /data, to cite my usual partition scheme.  I
> > > get confused by the man pages for lvreduce and lvresize and resize2fs.
> > >  Especially because they should be used on an unmounted file system,
> > > and my root file system is part of this LV.
> >
> > Yes, this is a problem. I suspect you will need to boot into single user
> > mode, mount / read-only, and then reduze the size of the filesystem and
> > then reduce the size of the LV. Being read-only may be sufficient to let
> > you resize. And of course make sure you reduce them both by the exact same
> > amount. ext3 can be extended while mounted but not shrunk. I think reiser4
> > is the only fs that can be shrunk while mounted.
> 
> Thanks, Tracy.  I hadn't thought about read-only.  You did recognize
> the problem that there is initially no free space on this physical
> volume in which to create another logical volume.  Maybe I'll work on
> it tonight.

Today I have spend more time finding ways that do not work to solve
the problem of resizing a Logical Volume that happens to contain your
root file system.  I would have been better off with the brute-force
approach of archiving all local data to an external disk (20min),
reinstalling the OS from the CDs (20min), downloading and installing
all the updates (60min), and restoring the local data (20min).

Things that do not work, in approximately the order that I tried them:
1) reboot to single-user mode, remount the root file system read-only,
and run resize2fs.
    "can't resize mounted file system"

2) boot Fedora Core 3 Rescue disk
# note -- I am typing this with a variable-width font because that's
what gmail has.
#  so column alignment won't be very good.

    # df -h   # gives the following interesting results
/dev/VolGroup00/LogVol00  149G 4.9G 136G 4%  /mnt/sysimage
/dev/sda2                            99M  25M   60M 27% /mnt/sysimage/boot
/dev/root.old                          6M  3.5M  2.0M 65% /mnt/sysimage/dev
   # cat /proc/swaps
/dev/VolGroup00/LogVol01    4G  0            # size, used

So I have to unmount things.
# umount /mnt/sysimage/dev
# umount /mnt/sysimage/boot
# umount /mnt/sysimage
Device or resource busy              # maybe the swap partition needs
to be unmounted
# swapoff /dev/VolGroup00/LogVol01
# umount /mnt/sysimage
Device or resource busy               # that wasn't the problem
# lsof +D /mnt/sysimage
          tells me that the only file in use is
            /mnt/sysimage/usr/sbin/lsof           # yeah but what else
makes it busy
# /sbin/resize2fs -p /dev/mapper/VolGroup00-LogVol00 10G
Can't resize mounted fs

3) boot Knoppix.  Use 2.6 kernel because it should understand LVM.
> boot knoppix26 2       # text-only mode
Learn that while Knoppix does not mount the file systems it finds,
unlike Fedora Rescue, it also does not contain any tools for working
with LVM.  It doesn't even recognize that the physical disk partition
on which the LVM stuff resides contains anything useful.

This is not a complete log of what I have done during some 6 hours
today, but it is the high points.

    carl
-- 
    carl lowenstein         marine physical lab     u.c. san diego
                                                 [EMAIL PROTECTED]
-- 

KPLUG-List mailing list
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to