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

Gianluca Cecchi gianluca.cecchi at gmail.com
Wed Jun 9 08:10:10 UTC 2010


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

%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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/rhelv6-beta-list/attachments/20100609/df397acc/attachment.htm>


More information about the rhelv6-beta-list mailing list