|
|
Subject: Re: More customized partitions? - msg#00125
List: linux.redhat.kickstart.general
On Wed, 25 Jun 2003, Matt Fahrner wrote:
> Does anyone know if there's a way, say in the "%pre" to run something
> that could do more customized partitioning than what is supplied by
> generic "kickstart". For instance, perhaps running a Perl script that
> in turn runs "fdisk"?
>
> The reason I ask is because while the kickstart config does offer
> quite a few options, there are a number of things we'd like to do that
> it can't handle. For instance, we'd like to clear all but one
> partition or make a very, very, smart program to auto-partition our
> disks (we have such a wide range, 4 gig to 20 gig, that using "--grow"
> isn't quite sufficient).
>
> Anyone done this before? Is it feasible?
No Perl, but you have a shell available. fdisk is there and works with
piped commands. Many standard *x utilities are available - use this
command for a concise list:
busybox --help
Not all the usua; options are available, but there's enough to do what
you propose. It will hone your shell scripting skills;-)
>
> Thanks in advance,
>
> - Matt
>
>
--
Please, reply only to the list.
Join the "Linux Support by Small Businesses" list at
http://mail.computerdatasafe.com.au/mailman/listinfo/lssb
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
RE: new to kickstart, show me where to start
Tom,
I have a setup similar to yours working "almost" automatically. I have to
manually select NetBoot on my Dell box by F12, then it when it asks for the
kernel parameters, I have it setup such that I have to type
ks=file:/tmp/ks.cfg
In order to do that locate my kickstart file there, I update the kickstart
file and place it in a loopback mounted directory and rebuild the initrd
file (linux.2) as shown in the script found in this document -
http://www.datamodel.co.uk/unix/resources/dmdl-pxe.pdf
Also, look at the back issues of Linux Magazine http://www.linux-mag.com.
Specifically the two part article in January and February 2003 by Forrest
Hoffman. What he has in this 2 part article mostly works. I had to modify
something else based on blksize or MTU or some crap like that based on this
article -
http://www.gctglobal.com/Download/PXE_Server_FIX/pxe_server_fix.html
I never could get the system to automatically find my kickstart file based
on IP address or whatever when running the PXEServer (active server vs
pxelinux.cfg method, which is passive). I don't mind the having to put the
ks=file command as describe above.
Also, it never automatically connects to my NFS server with the Redhat9
install files when it first tries to connect with text-based Redhat install.
It prompts me with a warning that it cannot find my NFS server. If I
immediately select OK (without changing the NFS parameters) from the
text-based install screen about the NFS server, all is well and I can move
on the next machine without babying the install further.
But bottom line, it is almost automatic, and the time to baby-sit the
installation to the NFS server problem is like 2 minutes before I can move
to the next machine. I suppose I could dig deeper to solve these last few
issues, however I don't have that high of throughput of new machines to
install that the time spent (wasted) to debug this further wouldn't pay off
for me.
Bob
Original Message ------------------------
Message: 2
Date: Tue, 24 Jun 2003 19:02:39 -0600
From: Tommy McNeely <tommy.mcneely@xxxxxxx>
Subject: new to kickstart, show me where to start
To: kickstart-list@xxxxxxxxxx
Organization: Sun Microsystems - ITCTO
Reply-To: kickstart-list@xxxxxxxxxx
Hello,
I am new to kickstarting and PXE, and would like to figure out where I
am, and where I have gone wrong, and how to "get there from here" ..
pointers to any *recent* docs are appreciated too :) searches on google
seem to turn up Index of (blah) (the images directory) .. so its not
much help.
I want to be able to kickstart RH9 linux boxes in much the same way one
would "jumpstart" a Sun box. At this point, I have done..
cp images/pxeboot/vmlinuz /tftpboot/X86PC/UNDI/linux-install/linux.1
cp images/pxeboot/initrd.img /tftpboot/X86PC/UNDI/linux-install/linux.2
chkconfig tftp on
chkconfig pxe on
service xinetd reload
service pxe start
*** CANNOT RUN MY OWN DHCP SERVER ON THIS NETWORK
I want to have it jumpstart "automatically" using my ks.cfg (that I
created with redhat-config-kickstart) .. but I don't know what
"next-server" and "filename" translate to on a "Sun" DHCP server
(currently controlling the network). But... I would be extremely happy
if I could even get an "interactive" nfs install running...
I am hitting "F12" during the bootup of a Sun LX50, and it looks like it
tries to boot, it loads the kernel, then it loads the initrd, but then
it just sits there... dumblike... hehe I dont know what to do next...
Any help would be appreciated.
Thanks in advance,
Tommy McNeely
Next Message by Date:
click to view message preview
Re: More customized partitions?
I've seen it mentioned before to have the %pre run a script that is later
read as an `update` or as an `include`. Searching the mailing list archives
for those terms might provide some usefull suggestions :)
----- Original Message -----
From: "Matt Fahrner" <Matt.Fahrner@xxxxxxxx>
To: <kickstart-list@xxxxxxxxxx>
Cc: "Joe Funk" <Joe.Funk@xxxxxxxx>
Sent: Wednesday, June 25, 2003 6:06 PM
Subject: More customized partitions?
> Does anyone know if there's a way, say in the "%pre" to run something
> that could do more customized partitioning than what is supplied by
> generic "kickstart". For instance, perhaps running a Perl script that
> in turn runs "fdisk"?
>
> The reason I ask is because while the kickstart config does offer
> quite a few options, there are a number of things we'd like to do that
> it can't handle. For instance, we'd like to clear all but one
> partition or make a very, very, smart program to auto-partition our
> disks (we have such a wide range, 4 gig to 20 gig, that using "--grow"
> isn't quite sufficient).
>
> Anyone done this before? Is it feasible?
>
> Thanks in advance,
>
> - Matt
>
> --
>
> ---------------------------------------------------------------------
> Matt Fahrner 2 South Park St.
> Manager of Networking Willis House
> Burlington Coat Factory Warehouse Lebanon, N.H. 03766
> TEL: (603) 448-4100 xt 5150 USA
> FAX: (603) 443-6190 Matt.Fahrner@xxxxxxxx
> ---------------------------------------------------------------------
>
>
>
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/kickstart-list
>
Previous Message by Thread:
click to view message preview
Re: More customized partitions?
Hey thanks! That is a good start!
Chris Adams wrote:
Once upon a time, Matt Fahrner <Matt.Fahrner@xxxxxxxx> said:
Does anyone know if there's a way, say in the "%pre" to run something
that could do more customized partitioning than what is supplied by
generic "kickstart". For instance, perhaps running a Perl script that
in turn runs "fdisk"?
I don't think perl is available during %pre (IIRC perl is not in the
install image at all).
Here's what I do in my %pre for partitioning (this may not be as smart
as what you want, but it may give you some ideas). I figure my own swap
size first, then look at the available devices (in this case I know I've
got 4 drives, doing RAID mirroring and LVM striping) to figure out how
much space to use.
I call python to get a couple of things (but I'm not a python person, so
that is just copied from some of the anaconda source), and I use shell
math to do the calculations. It should be easy enough to expand this to
be smarter about other filesystems than /usr/local. It also currently
assumes all drives are the same size as the first drive (only the first
line of output from "list-hardrives" is used) because in my setup, that
is true; a better way would be to use a shell array. The lvcreate
script could also be smarter (use different options based on the device
being used).
************************************************************************
zerombr yes
clearpart --all --initlabel
%include /tmp/part-include
bootloader --location=mbr
%pre
# How much RAM is there (round up to next 16MB)
ram=`python <<EOF
import sys
sys.path.append('/usr/lib/anaconda')
import iutil
sizekB = iutil.memInstalled(1)
print sizekB
EOF
`
ram=$(((($ram + 1023) / 1024 + 15) / 16 * 16))
# Swap should be twice RAM
swap=$(($ram * 2))
if [ "$(($swap > 2048))" = "1" ]; then
# but no more than 2G
swap=2048
fi
# Figure out disk size and partition scheme
list-harddrives | while read dev mb; do
mb=`echo $mb | sed 's/\.[0-9]*//'`
echo "dev=$dev; mb=$mb"
break
done > /tmp/ks-hd-info
. /tmp/ks-hd-info
boot=75
lvm=$(($mb - $boot))
# Since we're going to software stripe, full lvm size will be double
lvm=$(($lvm * 2))
root=250
usr=2500
tmp=750
var=2500
# Leave some empty space for LVM snapshots
empty=750
# Make /usr/local the rest
usrlocal=$(($lvm - $root - $swap - $usr - $tmp - $var - $empty))
# Set the volume based on the hostname
. /tmp/netinfo
if [ "$HOSTNAME" = "" ]; then
vol=vol
else
vol=${HOSTNAME%%.*}
fi
# Cheat: we want lvcreate called with certain options, and Red Hat
# doesn't currently support passing extra options. So, create an
# lvcreate script that uses the options, and bind mount it on top of the
# binary (after copying the binary).
cp /usr/sbin/lvcreate /tmp/lvcreate.bin
cat > /tmp/lvcreate <<EOF
#!/bin/sh
exec /tmp/lvcreate.bin -i 2 -I 512 \$@
EOF
chmod +x /tmp/lvcreate
mount /tmp/lvcreate /usr/sbin/lvcreate -o bind
cat > /tmp/part-include <<EOF
part raid.01 --ondisk=sda --size=$boot --asprimary
part raid.02 --ondisk=sdb --size=$boot --asprimary
part raid.03 --ondisk=sdc --size=$boot --asprimary
part raid.04 --ondisk=sdd --size=$boot --asprimary
part raid.05 --ondisk=sda --size=1 --grow --asprimary
part raid.06 --ondisk=sdb --size=1 --grow --asprimary
part raid.07 --ondisk=sdc --size=1 --grow --asprimary
part raid.08 --ondisk=sdd --size=1 --grow --asprimary
raid /boot --level=1 --device=md0 --fstype=ext3 raid.01 raid.02 raid.03 raid.04
raid pv.10 --level=1 --device=md1 raid.05 raid.07
raid pv.20 --level=1 --device=md2 raid.06 raid.08
volgroup $vol pv.10 pv.20
logvol / --name=root --vgname=$vol --fstype=ext3 --size=$root
logvol swap --name=swap --vgname=$vol --fstype=swap --size=$swap
logvol /usr --name=usr --vgname=$vol --fstype=ext3 --size=$usr
logvol /tmp --name=tmp --vgname=$vol --fstype=ext3 --size=$tmp
logvol /var --name=var --vgname=$vol --fstype=ext3 --size=$var
logvol /usr/local --name=usrlocal --vgname=$vol --fstype=ext3 --size=$usrlocal
EOF
************************************************************************
--
---------------------------------------------------------------------
Matt Fahrner 2 South Park St.
Manager of Networking Willis House
Burlington Coat Factory Warehouse Lebanon, N.H. 03766
TEL: (603) 448-4100 xt 5150 USA
FAX: (603) 443-6190 Matt.Fahrner@xxxxxxxx
---------------------------------------------------------------------
Next Message by Thread:
click to view message preview
Re: More customized partitions?
I've seen it mentioned before to have the %pre run a script that is later
read as an `update` or as an `include`. Searching the mailing list archives
for those terms might provide some usefull suggestions :)
----- Original Message -----
From: "Matt Fahrner" <Matt.Fahrner@xxxxxxxx>
To: <kickstart-list@xxxxxxxxxx>
Cc: "Joe Funk" <Joe.Funk@xxxxxxxx>
Sent: Wednesday, June 25, 2003 6:06 PM
Subject: More customized partitions?
> Does anyone know if there's a way, say in the "%pre" to run something
> that could do more customized partitioning than what is supplied by
> generic "kickstart". For instance, perhaps running a Perl script that
> in turn runs "fdisk"?
>
> The reason I ask is because while the kickstart config does offer
> quite a few options, there are a number of things we'd like to do that
> it can't handle. For instance, we'd like to clear all but one
> partition or make a very, very, smart program to auto-partition our
> disks (we have such a wide range, 4 gig to 20 gig, that using "--grow"
> isn't quite sufficient).
>
> Anyone done this before? Is it feasible?
>
> Thanks in advance,
>
> - Matt
>
> --
>
> ---------------------------------------------------------------------
> Matt Fahrner 2 South Park St.
> Manager of Networking Willis House
> Burlington Coat Factory Warehouse Lebanon, N.H. 03766
> TEL: (603) 448-4100 xt 5150 USA
> FAX: (603) 443-6190 Matt.Fahrner@xxxxxxxx
> ---------------------------------------------------------------------
>
>
>
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/kickstart-list
>
|
|