<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">You can use a pre script to detect if
      is previously partitioned or not and then use something similar
      to:<br>
      <br>
      %pre <br>
      #!/bin/sh<br>
      <br>
      Discover condition<br>
      <br>
      if condition; <br>
      then<br>
          echo "part /boot --fstype ext3 --size=100 --ondisk=$DISCO"
      >> /tmp/part-include<br>
          echo "part pv.100000 --size=1 --grow --ondisk=$DISCO"
      >>  /tmp/part-include<br>
          echo "volgroup Merca --pesize=32768 pv.100000" >>
      /tmp/part-include<br>
          echo "logvol swap --fstype swap --name=Swap --vgname=Merca
      --size=2047" >> /tmp/part-include<br>
          echo "logvol  / --fstype ext4 --name=root --vgname=Merca
      --size=2048" >> /tmp/part-include<br>
          echo "logvol /home --fstype ext4 --size=1000 --name=home
      --vgname=Merca" >> /tmp/part-include<br>
      else<br>
          echo "part /boot --fstype ext3 --size=100 --ondisk=$DISCO"
      >> /tmp/part-include<br>
          echo "volgroup Merca --pesize=32768 --useexisting --noformat"
      >> /tmp/part-include<br>
          echo "logvol swap --fstype swap --name=Swap --vgname=Merca
      --size=2047 --useexisting --noformat" >> /tmp/part-include<br>
          echo "logvol  / --fstype ext4 --name=root --vgname=Merca
      --size=2048 --useexisting --noformat" >> /tmp/part-include<br>
          echo "logvol /home --fstype ext4 --size=1000 --name=home
      --vgname=Merca --useexisting --noformat" >>
      /tmp/part-include<br>
      fi<br>
      <br>
      Later in the partitioning section use %include /tmp/part-include<br>
      <br>
      Hope this helps to you :)<br>
      <br>
      <pre class="moz-signature" cols="72">--
Francisco Javier Lloreda
Red Hat Consultant
( RHCA , RHCDS , RHCVA ) #110-651-718
<a class="moz-txt-link-abbreviated" href="mailto:flloreda@redhat.com">flloreda@redhat.com</a>
Mobile: 0034 600 48 39 73

c/ Jose Bardasano Baos, No. 9
Edificio Gorbea 3
Madrid, 28016 SPAIN </pre>
      El 21/01/13 08:29, Fred van Zwieten escribió:<br>
    </div>
    <blockquote
cite="mid:CALVifsZ0W9J_sxzEg=9v3Ozs-AhF-XqAGXJgFMjd=v=WnWbzrQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi there,
        <div><br>
        </div>
        <div>Is there a possibility in the kickstart syntax to
          partition/format a device, but only if it's not already
          partitioned/formatted.</div>
        <div><br>
        </div>
        <div>Use case: I have a server with a data disk. First time
          deployment it should be partitioned and formatted. Second
          time, the data partition must be left as is and only mounted.</div>
        <div><br>
        </div>
        <div>I now about --noformat, but how to make that conditional?</div>
        <div><br>
        </div>
        <div>If not possible, I must use %post. Any examples on how to
          do this there using bash or python?<br clear="all">
          <div><br>
            Regards,</div>
          <div><br>
          </div>
          <div style="">Fred</div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kickstart-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kickstart-list@redhat.com">Kickstart-list@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/kickstart-list">https://www.redhat.com/mailman/listinfo/kickstart-list</a></pre>
    </blockquote>
    <br>
  </body>
</html>