SLES 10 SP4 doesn't create Sector aligned partitions

Hi Experts & Admins,

OS Ver: SLES 10 SP4, HW : HP Proliant DL 3xx
I was trying to create a customized DVD image for SLES 10 SP4 installation using autoyast/autoinst.xml methods. I want to create all my paritions to be sector aligned (starting sector is multiple of 8 or 4K) at the time of installation itself.

When I use method to create partitions, it is creating the parition starting from Sector #63, not a multiple of 8 (4K). I guess, this is because of SLES 10 SP4 kernel detected my drive’s geometry as 255 Heads/63 Sectors and it creates Cylinder aligned paritions by default. <region_entry> list also not helping to start the parition at specific sector.

So, I added a small code in pre-script to create aligned partitions using parted as follows. (/dev/cciss/c0d0 is disk device name of HP SmartArray disk)

  <pre-scripts config:type="list">
     <script>
     <filename>cciss.sh</filename>
     <feedback config:type="boolean">true</feedback>
     <interpreter>shell</interpreter>
        <source><![CDATA[
           #!/bin/bash
           echo "Running Pre-installation script"

           parted -s /dev/cciss/c0d0 mklabel msdos
           parted -s /dev/cciss/c0d0 mkpart primary 2048s 990m
           parted -s /dev/cciss/c0d0 mkpart primary 2048000s 100%

           partprobe /dev/cciss/c0d0
           fdisk -ul /dev/cciss/c0d0

        ]]></source>
     </script>
  </pre-scripts>

When I do like this, the first partition gets created at sector 2048, but second partition gets created with some other starting sector other than 2048000s. According to documentation, the pre-script will be executed before the system doing anything else, and can be used for creating customized paritions like this (ref: http://www.novell.com/support/kb/doc.php?id=3664970 ) but it is not working as expected. Sometimes, the partition changes that has been done in pre-script is not getting recognized by the installer GUI; a partprobe / sfdisk -R failing to rescan the device too.

Is there any ways to instruct the installer create sector aligned paritions or start at specific sector?
Is that possible to change drive geometry before the installer starts? I tried doing this by “sfdisk -S 32 -H 255” code also in pre-script; but it works at times, sometimes not.

Thanks in advance,
Jibs

Hi
I would surmise that it’s the system age (SLE 10 SP4) and the tools
available then and now…

For example this users observations.
http://lists.opensuse.org/archive/opensuse-autoinstall/2011-03/msg00030.html


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.3 (x86_64) Kernel 3.7.10-1.16-desktop
up 6:46, 3 users, load average: 0.33, 0.28, 0.17
CPU AMD E2-1800@1.70GHz | GPU Radeon HD 7340

Thanks Malcolm.

Yes. Autoyast is creating aligned partitions in SLES 11 SP3, but not on SLES 10 SP4.
I was able to apply a work around by creating the partitions using sfdisk with 32 Sectors/track and 255 Heads, from pre-script as follows
‘echo -e “1,250
251,3000” | sfdisk -f -S 32 -H 255 /dev/cciss/c0d0’

If we could succeed in setting Sectors/track to 32 instead of 63, all problems would get solved I believe. Installer would create properly aligned partitions its own without specifying any sector boundaries. I also noticed on my server that, if I go to 6th console terminal (ALT + F6) while the installation progressing on 7th terminal, "fdisk -ul " reports the drive geometry as 63 sectors/255 heads. However after the first reboot, the sector boundaries that shown in previous fdisk output remains same, but geometry changes to 32 Sectors/255 heads.

The above method (sfdisk -S 32 -H 255 from pre-script) works perfectly if my hard disk doesn’t have any existing partitions before system start in to SLES 10 installer GUI. But if there are any existing partitions, it fails to modify them in pre-script.

Does anyone know how to tweak the installer to skip partition scanning before pre-script and do partition/disk scanning after pre-script steps are executed, probably as a last line of pre-script?

Thanks in advance,
Jibs

URL: http://doc.opensuse.org/projects/YaST/openSUSE11.2/autoinstall/createprofile.scripts.html says as follows:

[FONT=Lucida Console]4.12.1. Pre-Install Scripts
Executed before YaST2 does any real change to the system (Before partitioning and package installation but after the hardware detection)

You can use the pre-script to modify your profile and let autoyast read it again. If you want to do that, you can find your profile in “/tmp/profile/autoinst.xml”. Do what you want to do with that file and store the modified version in “/tmp/profile/modified.xml”. Autoyast will read that modified script then again after the pre-script is done.

With SUSE Linux 10.0 and all following versions it’s possible to change the partitioning with fdisk in your pre-script. With pre 10.0 versions of SUSE Linux (like SLES9), that was not possible. [/FONT]

But unfortunately, this is not working as per the documentation.
Does anyone know how to tweak the installer to skip partition scanning before pre-script and do partition/disk scanning after pre-script steps are executed, probably as a last line of pre-script?

Thanks in advance,
Jibs

It looks like, no way to fix this problem at this moment and it is a bug with SLES 10 autoyast installer.
We need to add custom scripts in pre-script to perform partitioning from pre-script only if the disk doesn’t have any partition table already. We need to use true method to wipe out existing partition table if it already contains some partition table and leave the partition creation to installer using normal method. In that case, the partitions will be cylinder aligned, may not be aligned to 4K sector boundaries.

This thread can be closed.

Thanks
Jibs