Difference between revisions of "LVM2"

From CBLFS
Jump to navigationJump to search
(Bootscript)
(Bootscript)
Line 94: Line 94:
 
   
 
   
 
  case "${1}" in
 
  case "${1}" in
start)
+
        start)
boot_mesg "Running vgscan mknodes..."
+
                boot_mesg "Running vgscan mknodes..."
/sbin/vgscan --mknodes
+
                /sbin/vgscan --mknodes
evaluate_retval
+
                evaluate_retval
;;
+
                ;;
*)
+
        *)
echo "Usage: ${0} {start}"
+
                echo "Usage: ${0} {start}"
exit 1
+
                exit 1
;;
+
                ;;
 
  esac
 
  esac
 
   
 
   

Revision as of 17:46, 16 March 2010

Download Source: ftp://sources.redhat.com/pub/lvm2/LVM2.2.02.43.tgz

Introduction to LVM2

Logical Volume Manager v2 is the updated version of LVM which supports +256 volumes and +2TB logical size.

Project Homepage: http://sourceware.org/lvm2/

Dependencies

Non-Multilib

Compile the package:

./configure --enable-cmdlib -enable-fsadm \
    --enable-dmeventd --disable-selinux &&
make

Install the package:

make install

Multilib

32Bit

Compile the package:

CC="gcc ${BUILD32}" ./configure --mandir=/usr/share/man \
    --enable-cmdlib --enable-fsadm \
    --enable-dmeventd --disable-selinux &&
make

Install the package:

make install

N32

Compile the package:

sed -i "/usrlibdir/s:/lib:&32:" configure && 
CC="gcc ${BUILDN32}" ./configure --mandir=/usr/share/man \
    --enable-cmdlib --enable-fsadm \
    --enable-dmeventd --libdir=/lib32 \
    --disable-selinux &&
make

Install the package:

make install

64Bit

Compile the package:

sed -i "/usrlibdir/s:/lib:&64:" configure && 
CC="gcc ${BUILD64}" ./configure --libdir=/lib64 \
    --mandir=/usr/share/man --enable-dmeventd \
    --enable-cmdlib --enable-fsadm \
    --enable-dmeventd --disable-selinux &&
make

Install the package:

make install

Confuration

Bootscript

The following bootscript is only needed in a very specific situation, If you use an initramfs or some other early userspace to initialize lvm2 device nodes. This script only runs vgscan --mknodes and reports the status of the command on start. If you need this functionality, install the bootscript with the following command:

cat > /etc/rc.d/init.d/lvm2 << "EOF"
#!/bin/bash
########################################################################
# Begin $rc_base/init.d/lvm2
#
# Description : Creates lvm2 nodes that may have been created in an
#               early userspace.
#
# Authors     : Joe Ciccone <jciccone@gmail.com>
#
# Version     : 00.01
#
# Notes       :
#
########################################################################

. /etc/sysconfig/rc
. ${rc_functions}

case "${1}" in
        start)
                boot_mesg "Running vgscan mknodes..."
                /sbin/vgscan --mknodes
                evaluate_retval
                ;;
        *)
                echo "Usage: ${0} {start}"
                exit 1
                ;;
esac

# End $rc_base/init.d/lvm2
EOF
chmod 751 /etc/rc.d/init.d/lvm2
ln -s ../init.d/lvm2 /etc/rc.d/rcsysinit.d/S16lvm2
Retrieved from "?title=LVM2&oldid=19960"