Hi, You cant combine sfdisk with autoyast partitioning or at least it is very difficultand to accomplish what you want. If you are using a recent release, you can use rules to detect the type of the harddisk you are using and have different partitioning schemes for the various disks depending on the size of the disks. Anas Mike Rose wrote:
Hi,
Our requirement for partitioning is not covered by autoyast (IMHO) so I've had to use a pre-install script that uses sfdisk to create what we want - create / as a primary partition, an extended partition with swap and the rest of the disk as another partition (later to be mounted as /scratch for obvious reasons), but not all of the HDDs we have can take a / partition of 10GB so sometimes we need not to create a 3rd partition and to reduce the size of /. I've added the script that does this to end of this email.
Unfortunately this does not work. I am assuming I have messed up my partition XML - can you help?
I am now going to try using the "Auto-detection of partitions to be kept" method while I wait for a reply.
partitions before install (using exec /bin/bash -x so that I get an interactive prompt to be able to check that the pre-install script has worked):
Disk /dev/hda: 9729 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System /dev/hda1 0+ 1305 1306- 10490413+ 83 Linux /dev/hda2 1306 9728 8423 67657747+ 5 Extended /dev/hda3 0 - 0 0 0 Empty /dev/hda4 0 - 0 0 0 Empty /dev/hda5 1306+ 1434 129- 1036161 82 Linux swap /dev/hda6 1435+ 9728 8294- 66621523+ 83 Linux
partitions after install:
Disk /dev/hda: 9729 cylinders, 255 heads, 63 sectors/track Warning: extended partition does not start at a cylinder boundary. DOS and Linux will interpret the contents differently. Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System /dev/hda1 0+ 1305 1306- 10490413+ 5 Extended /dev/hda2 1306 9728 8423 67657747+ 5 Extended /dev/hda3 0 - 0 0 0 Empty /dev/hda4 0 - 0 0 0 Empty /dev/hda5 1306+ 1434 129- 1036161 82 Linux swap /dev/hda6 1435+ 9728 8294- 66621523+ 83 Linux
which is a bit of a mess so no wonder the installatin cannot succeed.
From reading: http://www.suse.de/~nashif/autoinstall/9.1/html/CreateProfile.Partitioning.h... I thought I had understood the XML I needed to use to be:
<partitioning config:type="list"> <drive> <device>/dev/hda</device> <partitions config:type="list"> <partition> <create config:type="boolean">false</create> <filesystem config:type="symbol">ext3</filesystem> <format config:type="boolean">true</format> <mount>/</mount>
1 </partition> <partition> <create config:type="boolean">false</create> <filesystem config:type="symbol">swap</filesystem> <format config:type="boolean">true</format> <mount>swap</mount>5 </partition> </partitions> </drive> </partitioning>The XML pre_install script: <source><![CDATA[ #!/bin/sh wget http://XXXX/~install/suse9.1/pre_install_suse91.sh wget http://XXXX/~install/suse9.1/sfdisk chmod +x sfdisk chmod +x pre_install_suse91.sh ./pre_install_suse91.sh # exec /bin/bash -x ]]></source>
pre_install_suse91.sh:
#!/bin/sh -x # setup detault route to install server route add -net XXXXX netmask 255.255.255.0 dev eth0
# Now partition the disk SFDISK=./sfdisk mknod /tmp/hda b 3 0 CREATETEMP=false
$SFDISK --no-reread -V /tmp/hda if $SFDISK --no-reread -V -q /tmp/hda; then DOPARTITION=false else DOPARTITION=true DISKSIZE=$((`$SFDISK --no-reread -s /tmp/hda` / 1024 )) # assume 1k blocks echo $DISKSIZE MEMSIZE=`cat /proc/meminfo | grep "MemTotal:" | cut -d":" -f2 | cut -d"k" -f1` echo $MEMSIZE if [ $(($MEMSIZE / 1024 )) -gt 128 ]; then SWAPSIZE=$(($MEMSIZE / 1024)) else SWAPSIZE=128 fi ROOTSIZE=$(($DISKSIZE - $SWAPSIZE)) # disk - swap if [ $ROOTSIZE -gt 10240 ]; then # 10GB in MB CREATETEMP=true ROOTSIZE=10240 TEMPSIZE=$(($DISKSIZE - $ROOTSIZE)) fi # if we always put swap in an extended partition, we can # guarantee: # # / is /dev/hda1 # swap is /dev/hda5 # /scratch is /dev/hda6 # and all is well and happy throughout the land ... echo $ROOTSIZE $SWAPSIZE $CREATETEMP fi if $DOPARTITION; then echo "past DOPARTITION" if $CREATETEMP; then # we're lurching into a different partitioning echo "createtemp" $SFDISK --no-reread -D -uM /tmp/hda <
cheers,
Mike Rose