Interesting tidbit...
On Sun, Aug 7, 2011 at 6:34 PM, Scott Henson <shenson(a)redhat.com> wrote:
On Fri, 8 Jul 2011 17:15:49 -0400, Greg Chavez
<greg.chavez(a)gmail.com> wrote:
> Does anybody know where the list-harddrives macro comes from? Is it
> an anaconda thing? How does it work? I realize that this is not
> really a Cobbler issue, but maybe some of you who use this snippet
> know more about my situation in general and this macro in particular?
> Any help you guys can give me would be much appreciated, even if it's
> just pointing me to another mailing list.
list-harddrives comes with anaconda. The problem seems to be that it can
list harddrives in arbitrary manner. I'd check the size of the drives
($2 and $4) to know for sure which one is which. You can probably also
check the scsi disk name to make sure you aren't partitioning the wrong
on.
Thanks for the reply, Scott, that explains a lot and, in fact, that is
*precisely* how we solved the problem. For the edification of
company, below is the snippet we have been using with great success
over the last month.
There still must be something in the physical system that
list-harddrives macro is responding to, since it makes the mistake
consistently on the system in question. Perhaps an issue for another
group :)
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# START pre-kvmhost-partitions
#
set \$(list-harddrives)
echo "\$@"
disk=( \$1 \$3 )
size=( \$2 \$4 )
echo "S1: \${size[0]} S2: \${size[1]}"
echo "D1: \${disk[0]} D2: \${disk[1]}"
# Make PV assignments based on size
if [[ \${size[0]} < \${size[1]} ]] ; then
root_d=\${disk[0]}
data_d=\${disk[1]}
else
root_d=\${disk[1]}
data_d=\${disk[0]}
fi
echo "ROOT: \$root_d"
echo "DATA: \$data_d"
cat << EOF > /tmp/partinfo
part /boot --fstype ext3 --size 200 --ondisk=\$root_d --asprimary
part swap --recommended --ondisk=\$root_d --asprimary
part pv.root --size=1024 --grow --ondisk=\$root_d
part pv.data --size=1024 --grow --ondisk=\$data_d
volgroup vg00 pv.root
volgroup vg01 pv.data
logvol / --fstype ext3 --size=1024 --vgname=vg00 --name=root --grow
logvol /srv --fstype ext3 --size=1024 --vgname=vg01 --name=data --grow
EOF
#
# END pre-kvmhost-partitions
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--
--Greg Chavez
--