[debian-lan-devel] [debian-lan] 01/04: Add hook to remove old partition tables before installation.

Andreas B. Mundt andi at moszumanska.debian.org
Fri Apr 4 15:44:52 UTC 2014


This is an automated email from the git hooks/post-receive script.

andi pushed a commit to branch master
in repository debian-lan.

commit 6ec616245569c7a2bd98a3d668b9d9ec39a23241
Author: Andreas B. Mundt <andi at debian.org>
Date:   Sun Mar 30 16:06:22 2014 +0200

    Add hook to remove old partition tables before installation.
---
 fai/config/hooks/partition.DEFAULT | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT
new file mode 100755
index 0000000..e99ce80
--- /dev/null
+++ b/fai/config/hooks/partition.DEFAULT
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+#  Wipe old partition table.
+#
+
+set -e
+
+# FIXME:  This is needed because of #693701
+
+VG=$(vgscan | grep -o '".*"' | sed "s/\"//g")
+if [ -n "$VG" ] ; then
+    echo "Deactivating volume group \"$VG\"."
+    lvchange -a n $VG
+fi
+
+for DEV in $(lsblk -n -o NAME,TYPE | grep disk | cut -d ' ' -f 1) ; do
+    echo "Wiping MBR of /dev/${DEV}."
+    parted -s /dev/${DEV} mklabel msdos
+done

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/debian-lan.git



More information about the debian-lan-devel mailing list