[Centos] Guide to stripping Centos 3

Sat Jan 15 17:35:44 UTC 2005
R P Herrold <herrold at owlriver.com>

I responded to a post in the Dell poweredge mailing list 
earlier today.  My answer was off the top of my head, with a 
bit of experimentation.  The content may be useful in the 
Cenyos context as well to admin's looking to strip the size of 
an install to the bare bones.

Comment welcomed. Can anyone see any packages which I have 
missed?

-- Russ Herrold

---------- Forwarded message ----------
Date: Sat, 15 Jan 2005 12:29:12 -0500 (EST)
From: R P Herrold <herrold at owlriver.com>
To: linux-poweredge at dell.com
Subject: Re: dell-lnx-pe] Re: Stripping RHEL 3.0?

> At 07:58 PM 1/14/2005 -0500, David Hubbard wrote:
>> Does anyone know of a good guide for stripping
>> down RHEL 3.0?
   <snip>
>>   Due to all the dependencies
>> I can't find a way to actually strip RHEL in a way
>> that leaves everything happy.

Great timing and a good question -- I was just building such a host.  I'll test 
for a bit to minimize size.  Kickstart and anaconda are your friends.  Here is 
a quick guide:


During each install, a file called 'ks.cfg' is left by anaconda in /root/  At 
the end of this post, I include the ks.cfg file which will build a stripped 
host.  I have done a couple test installs, and gone through the resulting 
packagelist using;

     rpm -qa --qf '%{size} %{name} \n' | sort -n | less

to see what I could add with the '-' prefix at the bottom of the file.

(I have left in there a couple 'conveneince packages' and I usually add one 
extravagance -- I prefer 'konsole' to pop back as a remote terminal and so pay 
its space penalty, but comment it out here)

As I said, I 'went hunting' and trimmed it down to 465 M ; more savings are 
possible.  The worst remaining mandatory 'size offenders' in the install are:
 	glibc-common	42M
 	perl		27M
 	kernel		22M
Not much more we can do there.

But ... Once the install is done, turn off auditting:
 	chkconfig audit off
 	service audit stop
and reclaim the LARGE (100M) amout of room these files eat up
 	cd /var/log/audit.d/
 	rm -f *
Unfortunately the package is not deletable as there are dependency issues.

As I say. I then end up at: 465M

Using a network install from a local mirror and a ks.cf file permits 'gameing' 
to see what changed in the ks.cfg result in a given size profile.  See my notes 
at:

 	http://www.owlriver.com/tips/pxe-install/

for more information on setting up and debugging such an environment.  It 
permits experimentation with fast test installs (under ten minutes per test 
shot, even on a low RAM host (64M)) to 'tune' for a desired result.

-- Russ Herrold


[root at ftp kickstart]# cat  ks.cfg-Centos_34
#
#       Centos 34 server - built to be tiny as possible
#
install
lang en_US.UTF-8
langsupport --default en_US.UTF-8 en_US.UTF-8
keyboard us
mouse genericwheelps/2 --device psaux
url --url ftp://10.16.33.105/pub/install/ftpinstall
# xconfig --card "RIVA128" --videoram 4096 --hsync 31.5-35.1 --vsync 50-61 
--resolution 1280x800 --depth 24
skipx
network --device eth0 --bootproto dhcp
# rootpw --iscrypted <elided>
firewall --disabled
# not yet in RHEL 3
# selinux --disabled
authconfig --enableshadow --enablemd5
timezone America/New_York
bootloader --location=mbr
#       --append hdb=ide-scsi
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all --drives=hda
part /boot --fstype ext3 --size=100 --ondisk=hda
part / --fstype ext3 --size=1024 --grow --ondisk=hda
part /var/spool --fstype ext3 --size=1024 --grow --ondisk=hda
part /var/cache --fstype ext3 --size=1024 --grow --ondisk=hda
part /var/log --fstype ext3 --size=1024 --grow --ondisk=hda
part swap --size=128 --grow --maxsize=256 --ondisk=hda

#       basically a unconfigured server - the new 2005 Centurion
%packages
kernel
elinks
grub
joe
lftp
lynx
rdate
rpm-build
rsync
yum
# kdebase
-apmd
-autofs
-centos-yumcache
-comps
-cups
-cups-libs
-eal3-certification
-eal3-certification-doc
-finger
-freetype
-ipsec-tools
-iptables
-iptables-ipv6
-irda-utils
-iscsi-initiator-utils
-isdn4k-utils
-krb5-libs
-krb5-workstation
-krbafs-utils
-kernel-pcmcia-cs
-libwvstreams
-mdadm
-mgetty
-mtr
-nano
-nfs-utils
-pam_krb5
-pam_smb
-parted
-portmap
-raidtools
-redhat-config-network-tui
-redhat-config-securitylevel-tui
-redhat-logos
-redhat-menues
-redhat-lsb
-rpmdb-redhat
-stunnel
-sysreport
-talk
-tftp
-specspo
-vconfig
-wireless-tools
-wvdial
-xinetd
-ypbind
-yp-tools

#       If you use yum, you do not need:
-up2date
-up2date-update

%post
[root at ftp kickstart]#