Skip to main content

Oracle Linux has issues with LVM in anaconda

We've been having a variety of problems with our LVM system partitioning and anaconda. Mind you, once it is configured and installed, the system runs fine. But during rollout, LVM has been a head breaker...
Main issue is: dirty disks. Since we are booting from SAN, we have no control over the LUNs we get. Although we specify zerombr and clearpart --all in anaconda, LVM complains if there is anything on the disk. Especially if there are non-Linux partitions left on the disks. Altiris does it's boot "magic" using a DOS partition to create a known environment from which it launches stuff. This gave the anaconda installer headaches.
Our work-around: don't do partitioning from anaconda, but use the pre-install phase (%pre). We force a clear of the local disk (sda) and our boot LUN (sdb) and clear partitions explicitly as well as remove any traces of LVM signatures. We remove all Logical Volumes (LV), Volume Groups (VG) and Physical Volumes (PV). While this is a lot of work, it's the only way we'll get the guarantee our kickstart script will work.

In case you also have a Linux system, use LVM and perhaps even boot off of the SAN, here is our kickstart script:

# Kickstart file
# Bare metal Linux
# install using http installation source
#
install
text
url --url http://server/oel
lang en_US
langsupport --default=en_US.UTF-8 en_US.UTF-8
keyboard us
# config NIC and use DHCP for easy roll out
network --device eth0 --bootproto dhcp
network --device=eth1 --onboot no --bootproto dhcp
network --device=eth2 --onboot no --bootproto dhcp
network --device=eth3 --onboot no --bootproto dhcp
network --device=eth4 --onboot no --bootproto dhcp
network --device=eth5 --onboot no --bootproto dhcp
# auto reboot after installation
reboot
firewall --disabled
selinux --disabled
authconfig --enableshadow --enablemd5
timezone --utc Europe/Amsterdam
# install OS on SAN LUN, nousbstorage to ignore Dell virtual media
bootloader --driveorder=sdb,sda --location=mbr --append="nousbstorage"
# clear MBR to force empty disks (WARNING: ERASES ALL CONTENT)
zerombr yes
# init local disk and LUN, noformat because that's done in %pre
part /boot --onpart=sdb1 --noformat
part pv.49 --grow --onpart=sdb2
volgroup vgsystem --pesize=4096 pv.49
logvol / --fstype ext3 --name=lvroot --vgname=vgsystem --size=4096
logvol /tmp --fstype ext3 --name=lvtmp --vgname=vgsystem --size=2048
logvol /var --fstype ext3 --name=lvvar --vgname=vgsystem --size=2048
logvol /u01 --fstype ext3 --name=lvoracle --vgname=vgsystem --size=100 --grow

%packages
@ admin-tools
@ editors
@ emacs
@ system-tools
@ text-internet
@ legacy-network-server
@ gnome-desktop
@ dialup
@ network-server
@ base-x
@ server-cfg
@ development-tools
@ ruby
@ graphical-internet
gcc4
lslk
kernel-smp
-linuxwacom
oracleasm-2.6.9-55.0.0.0.2.ELsmp
-bluez-pin
-kernel-devel
-kernel-largesmp-devel
lvm2
memtest86+
-zsh
-desktop-backgrounds-extra
-gnome-mag
wireshark-gnome
-synaptics
-gok
vnc-server
system-config-boot
-openoffice.org
system-switch-mail
-openoffice.org-i18n
-evolution-webcal
-fetchmail
-cadaver
sysstat
gftp
-switchdesk
gnome-nettool
-kernel-smp-devel
-planner
-system-config-soundcard
net-snmp-utils
rdesktop
-gaim
system-switch-mail-gnome
-gnome-audio
subversion
mrtg
mc
-xchat
-gcc-g77
-gnome-pilot
-at-spi
-gnomemeeting
device-mapper-multipath
tsclient
system-config-kickstart
nmap-frontend
e2fsprogs
-evolution

%pre
# Do entire formatting and partitioning of boot devices here
# Clear any LVM traces
for sLv in `lvm lvdisplay|grep "LV Name"|awk '{print $3}'`
do
lvm lvremove -f $sLv
done
for sVg in `lvm vgdisplay|grep "VG Name"|awk '{print $3}'`
do
lvm vgremove $sVg
done
for sPv in `lvm pvdisplay|grep "PV Name"|awk '{print $3}'`
do
lvm pvremove -ff -y $sPv
done
# Clear partitions on /dev/sda and /dev/sdb
for sPa in `parted /dev/sda print|grep ^[0-9]|awk '{print $1}'`
do
parted /dev/sda rm $sPa
done
for sPb in `parted /dev/sdb print|grep ^[0-9]|awk '{print $1}'`
do
parted /dev/sdb rm $sPb
done
# force detection of new partition table
partprobe

# Create Swap partition (type 82) on /dev/sda
# parted not used, because of possible bug with multipathing
fdisk /dev/sda <<EOF
n
p
1

+2000M
t
82
p
w
EOF

# Create boot and LVM partitions on /dev/sdb (type 83 and 8e)
fdisk /dev/sdb <<EOF
n
p
1

+100M
t
83
n
p
2


t
2
8e
p
w
EOF
partprobe

# Format partitions and anaconda won't have to (see above)
mkswap -L swap /dev/sda1
mke2fs -jv /dev/sdb1

%post
# mark sda as a non-boot device (or it will try)
parted /dev/sda set 1 boot off
rpm -e kernel-devel
rpm -e kernel-smp-devel
rpm -e kernel-largesmp-devel
rpm -e kernel-largesmp
rpm -e rhgb

# After reboot, automatically do post installation steps...
echo /tmp/postinst.sh >> /etc/rc.local


PS: the package list will be changed soon. During development, we were using runlevel 5 as a default. Now we're at runlevel 3, the way a server should be! Using xming over ssh and tunnel (if needed) for remote admin using X11 when necessary. Thanks Koen!

Comments

Popular posts from this blog

Preventing PuTTY timeouts

Just found a great tip to prevent timeouts of PuTTY sessions. I'm fine with timeouts by the host, but in our case the firewall kills sessions after 30 minutes of inactivity... When using PuTTY to ssh to your Linux/Unix servers, be sure to use the feature to send NULL packets to prevent a timeout. I've set it to once every 900 seconds, i.e. 15 minutes... See screenshot on the right.

Tuning the nscd name cache daemon

I've been playing a bit with the nscd now and want to share some tips related to tuning the nscd.conf file. To see how the DNS cache is doing, use nscd -g. nscd configuration: 0 server debug level 26m 57s server runtime 5 current number of threads 32 maximum number of threads 0 number of times clients had to wait yes paranoia mode enabled 3600 restart internal passwd cache: no cache is enabled [other zero output removed] group cache: no cache is enabled [other zero output removed] hosts cache: yes cache is enabled yes cache is persistent yes cache is shared 211 suggested size 216064 total data pool size 1144 used data pool size 3600 seconds time to live for positive entries 20 seconds time to live for negative entries 66254 cache hi...

Dell Linux - OMSA Hardware Monitoring

Just getting started using Dell's OpenManage Server Administrator (OMSA) on our Oracle Linux platform. There are some confusing instructions going around so it's not immediately clear what to do, hence my blogging here. :) There is a site on Dell - Hardware Monitoring , as well as a wiki with instruction on how to setup their OMSA tooling using yum or up2date. [update]My first update for their instructions: be sure your server has Internet access, as most servers will use a proxy or so. use export http_proxy=http://yourproxy.example.com:port to configure it just for the session, and setup up2date to use an HTTP proxy by editing the settings in /etc/sysconfig/rhn/up2date .