Re: Don't delete a partition, if it doesn't exist...create it.

Mike Marion <[email protected]> Fri, 25 Jul 2014 16:26:33 -0700
Newsgroups gmane.linux.suse.autoinstall
Message-ID <[email protected]>
On Wed, Jul 23, 2014 at 04:11:31PM +0200, Daniel Spannbauer wrote:

> we only have two cases:
> 
> 1. Disk is completley empty or a system without rescue-partition is
> installed......simply erease the whole disk an prepare it, but now with
> rescue-partition
> 
> 2. Disk already has a rescue partition: leave the rescue partition
> untouched, with the other partitions do what you have to do
> 
> But I thin you are right...that couldn't be done by autoyast....

Not easily, but using pre scripts and modifying your autoyast file you
could probably do it.  I have stuff to handle cases where if an existing
host is being rejumped and matches some validation (some basic
"security" features) and has valid partitions, then the autoyast file
has the <partitioning-advanced> bits and re-uses partitions, else it
uses regular <partitioning> logic and wipes/initializes the disk.

So, in theory, you could do a pre-script to look for existing
partitions, and if you see one (and I'd validate it by mounting any
visible partitions and looking for (a) specific file(s) to make sure it
is a rescue partition, unless it uses a different partition type, then
that's easy to check) and have the resulting xml written based on seeing
said valid rescue partition or not.

But I also do a lot of pre-processing of the xml in our current imaging
process.

-- 
Mike Marion-Unix SysAdmin/Sr. Staff IT Engineer-http://www.qualcomm.com
Homer (Singing to Chumbawumba's "Tubthumping"): "I get knocked down.  I get, knocked
down again.  You're never gonna knock me down." ... "I take a whiskey drink, I take
a chocolate drink, and when I have to pee, I use the kitchen sink.  I sing the song 
that reminds me I'm a urinating guy.  Left, right, left, right..." => Simpsons
-- 
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]