Chris Sarginson wrote:
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))
Thanks for reporting this...
I don't mind changing the snippet if it is causing occasional problems,
though I never heard this reported as breaking a 4.5 install yet.
Can someone confirm the above problem and also that the proposed fix
works on various platforms? If so, I'll apply the change.
--Michael
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