<div dir="ltr">maybe you can try clearpart before create partition table</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 14, 2013 at 11:00 PM,  <span dir="ltr"><<a href="mailto:kickstart-list-request@redhat.com" target="_blank">kickstart-list-request@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send Kickstart-list mailing list submissions to<br>
        <a href="mailto:kickstart-list@redhat.com">kickstart-list@redhat.com</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://www.redhat.com/mailman/listinfo/kickstart-list" target="_blank">https://www.redhat.com/mailman/listinfo/kickstart-list</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:kickstart-list-request@redhat.com">kickstart-list-request@redhat.com</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:kickstart-list-owner@redhat.com">kickstart-list-owner@redhat.com</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Kickstart-list digest..."<br>
<br>Today's Topics:<br>
<br>
   1. Initializing disk with kickstart and parted (Bernd Nies)<br>
<br><br>---------- Forwarded message ----------<br>From: Bernd Nies <<a href="mailto:bernd.nies@gmail.com">bernd.nies@gmail.com</a>><br>To: <a href="mailto:kickstart-list@redhat.com">kickstart-list@redhat.com</a><br>
Cc: <br>Date: Tue, 14 May 2013 15:38:25 +0200<br>Subject: Initializing disk with kickstart and parted<br>Hi,<br><br>We're using the following kickstart pre script to create partitions in the order we want on VMware ESX. By default the swap partition is put as the last partition which makes it difficult to resize the root partition on ESX server. But now kickstart always complains that drives must be initialized. Can't use the clearpart --initlabel in that case because this will destroy the partition table. <br>

<br>Any ideas how to do this with parted or tell kickstart to do the initlable with out deling partition table?<br><br>Thanks in advance.<br><br>Regards,<br>Bernd<br><br><br><br><br> %pre<br>PATH="/bin:/sbin:/usr/bin:/usr/sbin"<br>

set $(list-harddrives)<br>let numd=$#/2<br>disk0=$1<br><br>case $(dmidecode -s system-product-name) in<br><br>VMware*)<br>        # Overwrite Master Boot Record<br>        dd if=/dev/zero of=/dev/${disk0} bs=512 count=1<br>

<br>        # Partition must start at sector that is multiple of 8.<br>        # 8 * 1 Sector (512 Bytes) = 4096 Bytes (Netapp Block Size) <br>        parted -s /dev/${disk0} mklabel msdos<br>        parted -s /dev/${disk0} mkpart primary ext4     2048s 1023999s<br>

        parted -s /dev/${disk0} mkpart primary ext4  1024000s 17801215s<br>        parted -s /dev/${disk0} mkpart primary ext4 17801216s      100%<br><br>        # Don't use LVM. It's not supported by gparted.<br>

        # Don't put swap as last partition. Makes resizing vmdk easier.<br>        cat >/tmp/partitions.ks <<-==EOF==<br>        bootloader --location=mbr<br>        partition /boot --onpart=${disk0}1 --fstype=ext4<br>

        partition swap  --onpart=${disk0}2 --fstype=swap<br>        partition /     --onpart=${disk0}3 --fstype=ext4<br>        ==EOF==<br>        ;;<br><br>*)<br>        # Office Workstations and rest<br>        cat >/tmp/partitions.ks <<-==EOF==<br>

        zerombr<br>        ignoredisk --only-use=${disk0}<br>        bootloader --location=mbr<br>        clearpart --all --drives=${disk0} --initlabel<br>        partition /boot/efi --ondisk=${disk0} --asprimary --fstype=vfat --size=200<br>

        partition /boot     --ondisk=${disk0} --asprimary --fstype=ext4 --size=500<br>        partition swap      --ondisk=${disk0} --asprimary --fstype=swap --recommended <br>        partition /         --ondisk=${disk0} --asprimary --fstype=ext4 --size=4096 --grow<br>

        ==EOF==<br>        ;;<br><br>esac<br>%end<br><br>
<br>_______________________________________________<br>
Kickstart-list mailing list<br>
<a href="mailto:Kickstart-list@redhat.com">Kickstart-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/kickstart-list" target="_blank">https://www.redhat.com/mailman/listinfo/kickstart-list</a><br></blockquote></div><br></div>