Re: shrinking lvm

From: Paul Howarth (paul_at_city-fan.org)
Date: 03/21/05

  • Next message: Paul Howarth: "Re: why are X and firefox sucking up all the CPU?"
    Date: Mon, 21 Mar 2005 11:50:28 +0000
    To: For users of Fedora Core releases <fedora-list@redhat.com>
    
    

    gaurav wrote:
    > Hi Paul,
    > I think logical partition will suffice for oracle installation,

    I think you're confusing "Logical Volume" with "Logical Partition". See
    http://www.tldp.org/HOWTO/LVM-HOWTO/ for an explanation of LVM.

    > Here is info you asked for
    >
    > # vgdisplay
    > --- Volume group ---
    > VG Name VolGroup00
    > System ID
    > Format lvm2
    > Metadata Areas 1
    > Metadata Sequence No 3
    > VG Access read/write
    > VG Status resizable
    > MAX LV 0
    > Cur LV 2
    > Open LV 2
    > Max PV 0
    > Cur PV 1
    > Act PV 1
    > VG Size 38.16 GB
    > PE Size 32.00 MB
    > Total PE 1221
    > Alloc PE / Size 1220 / 38.12 GB
    > Free PE / Size 1 / 32.00 MB
    > VG UUID xmHw2k-SVQS-lnIQ-u0z5-8E9E-vHAy-YEYXj4

    Right, so there's virtually no free space in your existing LVM setup,
    which means you'll need to shrink an existing volume.

    > # lvscan
    > ACTIVE '/dev/VolGroup00/LogVol00' [37.12 GB] inherit
    > ACTIVE '/dev/VolGroup00/LogVol01' [1.00 GB] inherit
    >
    > # df
    > Filesystem 1K-blocks Used Available Use% Mounted on
    > /dev/mapper/VolGroup00-LogVol00
    > 38317560 14124468 22246676 39% /
    > /dev/hda1 101086 9125 86742 10% /boot
    > none 257336 0 257336 0% /dev/shm
    > //172.28.62.169/m 31312896 17075712 14237184 55% /opt/music

    A fairly simple setup then, with just a "/" volume that has 22GB free.

    What I would suggest is the following:

    1. Boot using the rescue CD and do not mount your system's partitions
    (or unmount them afterwards).

    2. Shrink your existing root filesystem using resize2fs. I would suggest
    shrinking it to a size of around 16GB (i.e. just bigger than the amount
    of space you're actually using).

    3. Shrink your root logical volume (/dev/mapper/VolGroup00-LogVol00)
    using lvreduce to the size you actually want it to be (i.e. 37.12GB less
    the space you're going to allocate for Oracle). The size should be
    greater than the size you shrunk the root filesystem to in step 2.

    3. Grow your existing root filesystem back to the full size of the
    volume it lives on, using "resize2fs /dev/mapper/VolGroup00-LogVol00".

    At this point you will have a reduced size root partition, with extra
    space left in VolGroup00 that can be used to create logical volumes for
    Oracle's use.

    You can use lvcreate to create the two additional volumes you require.
    What filesystems, if any, do you want to use for the two new volumes?

    Look at the man pages for each of the commands referenced above and
    write down the commands you intend to use. Be sure that you understand
    what you're doing, as a mistake can trash your system, requiring a
    re-install.

    Paul.

    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Paul Howarth: "Re: why are X and firefox sucking up all the CPU?"

    Relevant Pages

    • Re: I give up! Help on avc message for dev dm-0
      ... The first device mapper device, which might be your root filesystem if you're using LVM or RAID. ... 255 heads, 63 sectors/track, 30401 cylinders ... This looks to be one of your LVM physical volumes and it's not expected to contain a partition table. ...
      (Fedora)
    • Re: Wheres ext2online?
      ... saying it couldn't unmount the root filesystem. ... the executable lvm is, which can do all those things. ... you will get a new prompt, where you type lvm commands. ... I was able to resize the mounted filesystem without going into rescue mode. ...
      (Fedora)
    • Re: Need help re LVM setup...<repost>
      ... > I am looking at installing the lvm layer on my file server, ... > won't be including that in the lvm). ... I do not use lvm for the root filesystem. ...
      (Debian-User)
    • grub and rootfs as LVM
      ... Error happens when the kernel tried to mount the root filesystem: ... I setup /boot as a seperate disk parition. ... The rest is for LVM. ... initrd, adding all dm-* modules to the initrd. ...
      (Debian-User)