#!/bin/sh #---------------------------------------------------------------------------- # /etc/init.d/lvm - lvm start script # # Creation : 2009-04-21 holbru # Last update: $Id$ # # Copyright (c) 2001-@@YEAR@@ the eisfair team, team(at)eisfair(dot)org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- # # ln -s /etc/init.d/lvm /etc/rc2.d/S05blvm # ln -s /etc/init.d/lvm /etc/rc2.d/K95lvm # # read functions . /etc/init.d/functions sbindir=/usr/sbin VGCHANGE=${sbindir}/vgchange VGSCAN=${sbindir}/vgscan MOUNT=/usr/bin/mount UMOUNT=/usr/bin/umount GREP=/usr/bin/grep SYNC=/usr/bin/sync # --------------------------------------------------------------------------- # usage # --------------------------------------------------------------------------- usage() { cat </dev/null boot_mesg " * Activating LVM volume groups ..." loadproc ${VGCHANGE} -a y --ignorelockingfailure } # --------------------------------------------------------------------------- # stop lvm # --------------------------------------------------------------------------- lvm_stop() { volume="$(${MOUNT} | ${GREP} 'dev/mapper')" if [ -n "${volume}" ] then echo "${volume}" | while read dev on point type typ options do ${UMOUNT} ${dev} done boot_mesg " * Deactivating LVM volume groups ..." loadproc ${VGCHANGE} -a n --ignorelockingfailure ${SYNC} fi } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- while [ "${#}" -gt 0 ] do case "${1}" in -q|--quiet) _quiet=true shift ;; *) _action="${1}" shift ;; esac done case "${_action}" in start) lvm_start ;; stop) lvm_stop ;; *) usage exit 1 ;; esac exit 0 # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------