Why use all these escapes that make it hard to read ...just wrap the
whole thing in
#raw
<shell-script-logic-goes-here>
#end raw
-Georgi
-----Original Message-----
From: cobbler-bounces(a)lists.fedorahosted.org
[mailto:cobbler-bounces@lists.fedorahosted.org] On Behalf Of Chris
Sarginson
Sent: Thursday, July 10, 2008 9:45
To: cobbler mailing list
Subject: Partitioning on Centos 4.x machines
Whilst trying to automate a partitioning setup on a new cobbler server I
have found that the partition_select snippet seems to cause a slight
problem in the Centos 4.6 installer. Having had a scout around this
seems to have been in 4.5 as well, so killing 2 birds with one stone -
here is a snippet that should detect how many drives you have and set up
as software RAID 1 (2 drives) or not if you have only 1 drive.
The offending line on it's own is
let numd=\$#/2
- becomes -
let numd=\$((\$#\/2))
Snippet as a whole:
%include /tmp/partinfo
%pre
# Determine how many drives we have
set \$(list-harddrives)
let numd=\$((\$#\/2))
d1=\$1
d2=\$3
if [ \"\$numd\" = \"1\" ]; then
cat << EOF > /tmp/partinfo
part /boot --fstype ext3 --size=100 --ondisk=\$d1 --asprimary
part / --fstype ext3 --size=20480 --ondisk=\$d1 --asprimary
--fsoptions=\"defaults,usrquota\"
part swap --size=1024 --ondisk=\$d1 --asprimary
part /home --fstype ext3 --size=100 --ondisk=\$d1 --grow
--fsoption=\"defaults,usrquota\"
EOF
elif [ \"\$numd\" = \"2\" ]; then
cat << EOF > /tmp/partinfo
part raid.100000 --size=100 --ondisk=\$d1
part raid.100001 --size=100 --ondisk=\$d2
part raid.100002 --size=20480 --ondisk=\$d1
part raid.100003 --size=20480 --ondisk=\$d2
part swap --size=1024 --ondisk=\$d1
part swap --size=1024 --ondisk=\$d2
part raid.100004 --size=512 --grow --ondisk=\$d1
part raid.100005 --size=512 --grow --ondisk=\$d2
raid /boot --fstype ext3 --level=RAID1 --device=md0 raid.100000
raid.100001
raid / --fstype ext3 --level=RAID1 --device=md1 raid.100002 raid.100003
raid /home --fstype ext3 --level=RAID1 --device=md2 raid.100004
raid.100005
EOF
fi
--
Kind regards
Chris Sarginson
Technical Support
UKFast.Net Ltd
(t) 0870 111 8866
(f) 0870 458 4545
"The UK's Best Dedicated Hosting Provider" ISPA Awards 2008
"The UK's Best Hosting Provider" ISPA Awards 2007, 2006 and 2005
Dedicated Servers - Managed Hosting - Domain Names-
http://www.ukfast.net
UKFast.Net Ltd, City Tower, Piccadilly Plaza, Manchester, M1 4BT
Registered in England. Number 384 5616
_______________________________________________
cobbler mailing list
cobbler(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler
_____________
The information contained in this message is proprietary and/or confidential. If you are
not the
intended recipient, please: (i) delete the message and all copies; (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the sender immediately. In
addition,
please be aware that any message addressed to our domain is subject to archiving and
review by
persons other than the intended recipient. Thank you.
_____________