LVM Bootscript

Devan Lippman devan.lippman at gmail.com
Sat Apr 2 11:23:02 PST 2005


I didn't see an LVM bootscript for LFS out there so I wrote this one
real quick, its my first shot at making a "real" bootscript that does
more than just run a set of shell commands (pretty sure I did the
return values wrong).
At any rate it sets up my LV so fstab is ready to mount it with a
symbolic link /etc/rc.d/rcsysinit.d/S21lvm

Thanks,
Devan

#!/bin/sh
# Begin $rc_base/init.d/lvm

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Devan Lippman - devan at lippman.net

#$LastChangedBy: dl $
#$Date: 2005-04-02 22:00:58 -0600 (Sat, 02 Apr 2005) $

. /etc/sysconfig/rc
. $rc_functions

case "$1" in
        start)

                echo "Starting LVM..."
                vgscan
                vgchange --ignorelockingfailure -ay
                evaluate_retval
                error_value=$?

                if [ "$error_value" != 0 ]
                then
                        print_status warning
                fi

                if [ "$error_value" = 0 ]
                then
                        print_status success
                fi

                ;;

        stop)
                echo "Stopping LVM..."
                vgchange -an
                ;;

        restart)
                $0 stop
                sleep 1
                $0 start
                ;;

        *)
                echo "Usage: $0 {start|stop|restart}"
                exit 1
                ;;
esac

# End $rc_base/init.d/LVM



More information about the blfs-dev mailing list