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

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


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

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

commit 2372ca104889192109c6ae7ac16816657d08efb8
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.
    
    (cherry picked from commit 6ec616245569c7a2bd98a3d668b9d9ec39a23241)
---
 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