[rhelv6-beta-list] Can RHEL6 installer align the disk partition with 4k-sector or raid stripe size?

Nico Kadel-Garcia nkadel at gmail.com
Wed Jun 9 12:22:07 UTC 2010


On Wed, Jun 9, 2010 at 4:10 AM, Gianluca Cecchi
<gianluca.cecchi at gmail.com> wrote:
> On Wed, Jun 9, 2010 at 3:15 AM, Nico Kadel-Garcia <nkadel at gmail.com> wrote:
>>
>> > On the plus side, using 4k sector sizes for guests over the network like
>> > this seems to have a very positive effect on the backend disk IO
>> > performance.
>>
>> I'd love to do so. Even aligning the partitions on 4096 byte
>> boundaries helps tremendously with NetApps providing the virtual disk
>> images over NFS, but I'm going bugfutz trying to get this into
>> kickstart tools. I'm hoping that RHEL 6's kickstart tools will make it
>> easier.
>>
>
> I took the approach below for kickstarting with rh el 5 guests in VMware and
> manage partition alignment with starting block of 128 when connected to EMC
> storage arrays.
> Probably you can adapt for your needs of sector size, disks layout and also
> see if any other change is required in rh el 6. I have not tried yet with
> it.
> PS: mind the new lines too
> HIH,
> Gianluca

I'm using parted, not fdisk. parted allows the selection of sectors
with the right syntax, and the setting of the "msdos' label for
unconfigured disks. It also allows me to set the first, and last,
sector to align on what fdisk reports as "cylinder" boundariies, to
get fdisk and tools like it to stop whinging about misaligned
boundaries.

I've also been forced to expend considerable work to flush any remains
of LVM devices, and since I'm using the same script for "rescue"
operations, to detect and turn off any swap before doing these steps,
so my tool is much longer.

I've been trying to do this:

> # Use prebuilt, aligned images, without preceding /dev/
> part / --onpart=VolGroup00/LogVol00_root
> part /var --onpart=VolGroup00/LogVol00_var
> part /boot --onpart=sda1
> part swap --onpart=VolGroup01/LogVol01_swap

The %pre is definitely setting up the logical volumes, *EXACTLY* the
way I want them, successfully. My logs include an "lvm lvscan" command
that shows this. But kickstart apparently inactivates all LVM volumes
at install time, and fails because it can't access those inactivated
LVM's. I'll try it your way today.

Is this going to occur in RHEL 6 as well? I'd much prefer to simply
tell the anaconda partitioning tools "4096 block size" so it will set
things for me.

> %pre
> #!/bin/sh
> LOGFILE=/tmp/ks_preinstall.log
>
> echo "" > $LOGFILE
> # clear mbr
> dd if=/dev/zero of=/dev/sda bs=512 count=1 2>>$LOGFILE
> fdisk /dev/sda << -TXT >> $LOGFILE 2>&1
> n
> p
> 1
>
> +100M
> x
> b
> 1
> 128
> r
> n
> p
> 2
>
>
> t
> 1
> 8e
> w
> -TXT
>
> SECSIZE=$(fdisk -lu /dev/sda | grep sda2 | awk '{print $2}' 2>> $LOGFILE)
> export NEWSECSIZE=$(expr \( $SECSIZE / 128 + 1 \) \* 128 2>> $LOGFILE)
>
> fdisk /dev/sda << -TXT >> $LOGFILE 2>&1
> x
> b
> 2
> $NEWSECSIZE
> r
> w
> -TXT
>
>
> Instead in install section:
>
> part /boot --fstype ext3 --onpart=sda1
> part pv.01  --onpart=sda2
> volgroup VolGroup01 pv.01
> logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup01 --size=5120
> logvol /var/log --fstype ext3 --name=LogVol01 --vgname=VolGroup01 --size=512
> logvol /var/opt --fstype ext3 --name=LogVol02 --vgname=VolGroup01 --size=512
> logvol /opt --fstype ext3 --name=LogVol03 --vgname=VolGroup01 --size=1536
> logvol swap --fstype swap --name=LogVol04 --vgname=VolGroup01 --size=256
>
> Also, in post section I have something like this to copy the logs and check
> any errors of the pre install phase:
>
> %post --nochroot
> LOGFILE=/mnt/sysimage/root/ks_postinstall.log
> LOGDIR=/mnt/sysimage/root/kslog-$(date +%d%m%Y)
> mkdir $LOGDIR
> # Copy log files in log dir
> cp /tmp/anaconda.log $LOGDIR >> $LOGFILE 2>&1
> cp /tmp/ks_preinstall.log $LOGDIR >> $LOGFILE 2>&1
> cp /tmp/ks.cfg $LOGDIR >> $LOGFILE 2>&1
>
> %post
> # Define LOG FILE
> LOGFILE=/root/ks_postinstall.log
> echo "" >> $LOGFILE 2>&1
> ...
> mv $LOGFILE /root/kslog-* 2> /dev/null
>
> _______________________________________________
> rhelv6-beta-list mailing list
> rhelv6-beta-list at redhat.com
> https://www.redhat.com/mailman/listinfo/rhelv6-beta-list
>




More information about the rhelv6-beta-list mailing list