Friday, 24 December 2010

Minimal RHEL 5.5 / CentOS 5.5 Install

After messing around with Ubuntu for a while, I decided it would be a little more portable for me to use a Red Hat based distro as my primary Linux environment. My distro of choice is actually Scientific Linux, which is developed / maintained by CERN. Why not CentOS? Frankly, Scientific Linux doesn't have any of the bullshit that CentOS does, and is for all intents and purposes identical.

Oddly enough, there is no "JeOS" option for RHEL based distro's like there is for Ubuntu. Amazon recently launched their own RHEL derivative which I thought might give me some clues as to how minimal a RHEL based distro could be, however a quick yum list installed proved it to be far from minimal - disk is cheaper than the combination of network and CPU it seems, so they cram many development packages into the base image (OpenJDK, Lua, Perl, Python, Ruby, X etc). Which is not really a huge deal to be honest, but I like to keep things as small as possible without getting ridiculous.

There are many other posts to be found on various forums covering this topic, but a lot of them didn't really hit the spot for me so I came up with my own "minimal" kickstart script. This allows you to use only the first CD of the SL or CentOS distro, and will give you a pretty decent base install in just under 700MB of disk. Which is why my disk layout is based on a 4GB system volume.

# rhel 5.x based kickstart file
# disk layout assumes a 4GB sda
lang en_US.UTF-8
keyboard us
network --device eth0 --bootproto dhcp --hostname sl55.local
firewall --enabled --port=22:tcp
services --disabled ip6tables
rootpw root
authconfig --enableshadow --enablemd5
selinux --permissive
timezone --utc Europe/London
bootloader --location=mbr --driveorder=sda
clearpart --initlabel --linux --drives=sda
part /boot --fstype ext3 --size=500
part pv.2 --size=0 --grow --ondisk=sda
volgroup vg00 --pesize=32768 pv.2
logvol swap --fstype swap --name=swap00 --vgname=vg00 --size=1024
logvol / --fstype ext3 --name=lv00 --vgname=vg00 --size=2560


#really disable ipv6
echo "install ipv6 /bin/true" > /etc/modprobe.d/blacklist-ipv6.conf
echo "blacklist ipv6" >> /etc/modprobe.d/blacklist-ipv6.conf

Just save this as ks.cfg into the root of the ISO image, then replace the isolinux/isolinux.cfg file in the ISO with something like:

default install
prompt 0
label install
kernel vmlinuz
append initrd=initrd.img text ks=cdrom:/ks.cfg

Then you'll have an ISO that can auto-install any RHEL 5.5 based distro in just a few minutes.

If you have any comments / improvements / suggestions, go for your life in the comments.


Anonymous said...

There's always bullshit, but whether it's known bullshit or hidden bullshit is a simple matter of what side of the fence you're on, and where the fence is. My distro of choice is RHEL, period.

Anything "derived" from RHEL doesn't have the secret sauce, and that's a fact that may distros choose to omit when they play the FOSS FUD game a la Larry et al.

What is that secret sauce? Well, we don't use Open Source, do we? We use the compilations of said source otherwise referred to as binaries, certified, tested, hammered on the forge of vendor products in some datacenter somewhere. Oils ain't oils, and it ain't identical. The difference between the race car that wins the F1 and the race car that ends busted and broke by the side of the track is about tuning and engineering, period. The compiler flags and tunings are Red Hat secrets closely guarded by the engineering team, and as a former employee of some other notionally-important Red Hat team I can say that they are closely-guarded indeed.

Am I biased in my choice of distro? Perhaps, but pragmatism isn't about religion, it's fact-based and experience-proven. For the same reason I wouldn't dream of running Fedora in production, I wouldn't dream of running anything but the best.

On another note, I don't need no stinkin' JeOS, I'll decide what packages I include in my SOE, stripped-down corporate-approved VM-specific build, if it's all the same to you :) It's times like this I'm inclined to think that there is true value in the RHCA education track, purely because they teach you how to fly that cumbersome 2500-rpm jumbo distro like it's a fighter jet - 100 feet off the ground with 1500 packages left behind.

Happy 2k11 Stu ;-)


Anonymous said...

Haha awesome, thanks for chiming in mate - always great to learn from you :). And Happy New Year to you too!