From 4edf0d6d3c725b0a5a9709b1f827870ce8b73c44 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Tue, 4 Nov 2008 12:20:44 +0100 Subject: more cleaner disk stuff --- unofficial/modules/dieter/procedures/automatic | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'unofficial/modules/dieter/procedures') diff --git a/unofficial/modules/dieter/procedures/automatic b/unofficial/modules/dieter/procedures/automatic index 09269b5..2ccec68 100644 --- a/unofficial/modules/dieter/procedures/automatic +++ b/unofficial/modules/dieter/procedures/automatic @@ -39,6 +39,9 @@ worker_prepare_disks () modprobe -q aes-x86-64 || modprobe aes-i586 || die_error "Cannot modprobe aes-x86-64 or aes-i586" # Cleanup whatever state the disk is in (that includes previous, failed runs of this script) + umount /dev/mapper/cryptpool-* 2>/dev/null + vgremove -f cryptpool 2>/dev/null + pvremove /dev/mapper/sda2_crypt 2>/dev/null cryptsetup luksClose sda2_crypt 2>/dev/null dd if=/dev/urandom of=/dev/sda bs=512 count=1 @@ -47,6 +50,7 @@ worker_prepare_disks () ,10,L,* ,,L EOF + #TODO: when sfdisk is done, i still have an invalid partition table? cryptsetup --batch-mode -c aes-xts-plain -y -s 512 luksFormat /dev/sda2 cryptsetup luksOpen /dev/sda2 sda2_crypt pvcreate /dev/mapper/sda2_crypt -- cgit v1.2.3-54-g00ecf