Kickstart-list Digest, Vol 110, Issue 2

Rangsan A rangsan.au at gmail.com
Wed May 15 12:16:24 UTC 2013


maybe you can try clearpart before create partition table


On Tue, May 14, 2013 at 11:00 PM, <kickstart-list-request at redhat.com> wrote:

> Send Kickstart-list mailing list submissions to
>         kickstart-list at redhat.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://www.redhat.com/mailman/listinfo/kickstart-list
> or, via email, send a message with subject or body 'help' to
>         kickstart-list-request at redhat.com
>
> You can reach the person managing the list at
>         kickstart-list-owner at redhat.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Kickstart-list digest..."
>
> Today's Topics:
>
>    1. Initializing disk with kickstart and parted (Bernd Nies)
>
>
> ---------- Forwarded message ----------
> From: Bernd Nies <bernd.nies at gmail.com>
> To: kickstart-list at redhat.com
> Cc:
> Date: Tue, 14 May 2013 15:38:25 +0200
> Subject: Initializing disk with kickstart and parted
> Hi,
>
> 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.
>
> Any ideas how to do this with parted or tell kickstart to do the initlable
> with out deling partition table?
>
> Thanks in advance.
>
> Regards,
> Bernd
>
>
>
>
>  %pre
> PATH="/bin:/sbin:/usr/bin:/usr/sbin"
> set $(list-harddrives)
> let numd=$#/2
> disk0=$1
>
> case $(dmidecode -s system-product-name) in
>
> VMware*)
>         # Overwrite Master Boot Record
>         dd if=/dev/zero of=/dev/${disk0} bs=512 count=1
>
>         # Partition must start at sector that is multiple of 8.
>         # 8 * 1 Sector (512 Bytes) = 4096 Bytes (Netapp Block Size)
>         parted -s /dev/${disk0} mklabel msdos
>         parted -s /dev/${disk0} mkpart primary ext4     2048s 1023999s
>         parted -s /dev/${disk0} mkpart primary ext4  1024000s 17801215s
>         parted -s /dev/${disk0} mkpart primary ext4 17801216s      100%
>
>         # Don't use LVM. It's not supported by gparted.
>         # Don't put swap as last partition. Makes resizing vmdk easier.
>         cat >/tmp/partitions.ks <<-==EOF==
>         bootloader --location=mbr
>         partition /boot --onpart=${disk0}1 --fstype=ext4
>         partition swap  --onpart=${disk0}2 --fstype=swap
>         partition /     --onpart=${disk0}3 --fstype=ext4
>         ==EOF==
>         ;;
>
> *)
>         # Office Workstations and rest
>         cat >/tmp/partitions.ks <<-==EOF==
>         zerombr
>         ignoredisk --only-use=${disk0}
>         bootloader --location=mbr
>         clearpart --all --drives=${disk0} --initlabel
>         partition /boot/efi --ondisk=${disk0} --asprimary --fstype=vfat
> --size=200
>         partition /boot     --ondisk=${disk0} --asprimary --fstype=ext4
> --size=500
>         partition swap      --ondisk=${disk0} --asprimary --fstype=swap
> --recommended
>         partition /         --ondisk=${disk0} --asprimary --fstype=ext4
> --size=4096 --grow
>         ==EOF==
>         ;;
>
> esac
> %end
>
>
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list at redhat.com
> https://www.redhat.com/mailman/listinfo/kickstart-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20130515/3c62a83c/attachment.htm>


More information about the Kickstart-list mailing list