Mailinglist Archive: opensuse-autoinstall (79 mails)

< Previous Next >
RE: [suse-autoinstall] Anas Nashif: Mounting before Installation?
  • From: "Neruda, Steve (SCI TW)" <Steve_Neruda_TW@xxxxxxxxxxxx>
  • Date: Thu, 7 Nov 2002 19:55:44 +0000 (UTC)
  • Message-id: <D037B3982A54D611BA5E000629383540B40FA4@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
I'm not sure why thos partitions aren't be deleted. I had a problem with
LVM partitions because the volume groups get activated and therefore can't
be properly reformated since the kernel already has the lvm info. To get
around it I wrote this slash and burn pre-script that nukes the volume
groups and the erases the partition table using dd.

Note: it does not reboot automatically as I wish it did and has no way of
returning a message because no useful utilities such as "init", "reboot", or
even "halt" are available at this point. I do have a machine language 60
byte reboot code that a friend was able to hack together in x86 assembler
that I've though of including but it hasn't been tested.

--- use at your own risk ---


<pre-scripts config:type="list">
<script>
<filename>nukepart.sh</filename>
<interpreter>shell</interpreter>
<source>
<![CDATA[#!/bin/sh
#Nuke all existing logical volumes and volume groups
# The machine will report not enough room for installation and
# require a manual reboot but at least this takes care of the
# tedious task of deleting them before installation
had2nuke=0
for invg in `vgscan | grep "inactive volume group" | tr "\"" " " | awk
'{print $
7}'`; do
vgchange -a y $invg;
done
for acvg in `vgscan | grep "active volume group" | tr "\"" " " | awk
'{print $7}
'`; do
for lv in `lvscan | grep "ACTIVE" | tr "\"" " " | awk '{print $4}'`;
do
lvremove -f $lv;
done;
vgchange -a n $acvg;
vgremove $acvg;
had2nuke=1
done
dd if=/dev/zero of=/dev/sda bs=512 count=10
if [ $had2nuke -eq 1 ] ; then
reboot won't work anyway cause no userful binaries to cause a reboot
are installed yet...sigh
fi
]]>
</source>
</script>
</pre-scripts>

< Previous Next >