SCIENTIFIC-LINUX-USERS Archives

December 2014

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
David Sommerseth <[log in to unmask]>
Reply To:
Date:
Sat, 20 Dec 2014 04:22:07 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (76 lines)
On 19/12/14 16:30, Stephen Berg (Contractor) wrote:
[...snip...]
> Here's the %pre section of my kickstart.  I thought using the partprobe at the
> end would get anaconda aware of the new layout but it doesn't seem that's
> working.  How can finish the pre-install section so anaconda will see this new
> partition layout and continue on with the install?
>
>   %pre --interpreter /bin/bash --log=/root/preinstall.log
>
> dd if=/dev/zero of=/dev/sda bs=1M count=500
> dd if=/dev/zero of=/dev/sdb bs=1M count=500
> echo "Probing sda"
> partprobe -s /dev/sda
> echo "Probing sdb"
> partprobe -s /dev/sdb
>
> partprobe
>
> parted -s -- /dev/sda mklabel gpt
> parted -s -a minimal -- /dev/sda unit MB mkpart primary 0 1
> parted -s -a minimal -- /dev/sda unit MB mkpart primary 1 501
> parted -s -a minimal -- /dev/sda unit MB mkpart primary 501 16886
> parted -s -a minimal -- /dev/sda unit MB mkpart primary 16886 103686
> parted -s -a minimal -- /dev/sda unit MB mkpart primary 103686 -0
> parted -s -- /dev/sda set 1 bios_grub on
> parted -s -- /dev/sda set 2 raid on
> parted -s -- /dev/sda set 3 raid on
> parted -s -- /dev/sda set 4 raid on
> parted -s -- /dev/sda set 5 raid on
[...snip...]

I think this is the wrong approach.  I've done this by using anaconda's 
built-in support for partitioning, which also works via kickstarts.

Here's an extract from one of my (KVM) boxes with SL 6.x.  I'm using LVM, but 
I'll guide you quickly through it.

-----------------------
clearpart --all --drives=vda --initlabel

part /boot --fstype=ext4 --asprimary --size=512
part swap --size=512
part pv.253003 --grow --size=6656
volgroup vgsys --pesize=32768 pv.253003
logvol /home --fstype=ext4 --name=home --vgname=vgsys --size=4096
logvol / --fstype=ext4 --name=root --vgname=vgsys --size=4096
logvol /tmp --fstype=ext4 --name=tmp --vgname=vgsys --size=1024
-----------------------

clearpart basically does the same as your 'dd' lines.  You might find 
'zerombr' interesting as well.

The three 'part' lines creates partitions, they end up as vda1, vda2 and vda3. 
  The mount points is also given.  The last one have --grow, which means "as 
large as possible".  The 'pv.253003' is just a temporary label used in the 
next line, but IIRC the pv prefix tells anaconda it is a physical LVM volume.

volgroup declares a new volume group named 'vgsys' on the partition 'pv.253003'.

The last three logvol lines creates the logical volumes and declares the mount 
points.

You'll find more information about these features in the RHEL 6 Installation 
guide: 
<https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-kickstart2-options.html>

Another interesting source is also the copy of the "kickstart" anaconda saves 
in /root/anaconda-ks.cfg on installed servers.  You'll see all the 
partitioning commented out there too.  That might give even more clues too.


--
kind regards,

David Sommerseth

ATOM RSS1 RSS2