From 13d9eab6f9e7b64739a6849e9d2e36b6a76d8a5e Mon Sep 17 00:00:00 2001 From: Gabriele Giacone <1o5g4r8o@gmail.com> Date: Sat, 26 Jul 2014 15:40:14 +0200 Subject: Create LVM physical volume if not already done. --- update_jdn.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/update_jdn.sh b/update_jdn.sh index 574080ec..f2a87062 100755 --- a/update_jdn.sh +++ b/update_jdn.sh @@ -4,6 +4,8 @@ # released under the GPLv=2 BASEDIR=/root/jenkins.debian.net +PVNAME=/dev/vdb # LVM physical volume for jobs +VGNAME=jenkins01 # LVM volume group explain() { echo @@ -122,3 +124,16 @@ sudo chown jenkins /var/cache/pbuilder/result echo rgrep FIXME $BASEDIR/* | grep -v "rgrep FIXME" | grep -v echo +# +# creating LVM volume group for jobs +# +if [ "$PVNAME" = "" ]; then + figlet Error + explain "Set \$PVNAME to physical volume pathname." + exit 1 +else + if ! sudo pvs $PVNAME >/dev/null 2>&1; then + sudo pvcreate $PVNAME + sudo vgcreate $VGNAME $PVNAME + fi +fi -- cgit v1.2.3-70-g09d2