Monthly Archives: March 2008

How to install Linux via the network with a kickstart file

0
Filed under Hot Tips

Here’s a nice tip on how to install Linux over the network (in this case a http / webserver), from a kickstart file

Put this in the /ks.cfg file on your bootable CD:

[php]

title Remote Install
        root (hd0,0)
        kernel /vmlinuz_remote ks=http://<domain>/<path_to_file>/<kickstart_config> vnc vncconnect=<observing_ip>
        initrd /initrd_remote.img

# Barebones demo remote kickstart configuration
#

install
network --bootproto dhcp
url --url http://<domain>/<path_to_file>/i386/tree
lang en_US
langsupport --default en_US en_US
keyboard us
mouse none
zerombr yes
clearpart --all
part pv.01 --size=1000 --grow
part /boot --fstype=ext3 --size=200
part swap --size=1000   --maxsize=2000
volgroup myvg pv.01
logvol / --vgname=myvg --name=rootvol --size=1000 --grow
bootloader --location mbr
timezone America/New_York
auth --enablemd5 --enableshadow
rootpw --iscrypted <encryptedpasswdstring>
selinux --permissive
reboot
firewall --enabled --http --ssh --smtp
skipx

%packages --resolvedeps

@ Base

%post

# MOTD
echo << /etc/motd
echo "Remote kickstart on $(date +'%Y-%m-%d')" << /etc/motd
echo << /etc/motd
[/php]

I found the information on this website, http://www.redhat.com/magazine/024oct06/features/kickstart/
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

How to create a custom CentOS or any other Linux

0
Filed under Hot Tips

I was looking for a way to make my own CentOS 5.1 CD’s with various selected packages, some which are normally located on the other CD’s and not on the first CD. For what I need, I want to keep it simple, just use one CD to install the packages I need for a minimal server.

Initially I installed CentOS 5.1 x64 on a test PC, with the packages I wanted, and only copied the packages installed from the online CentOS repos to a folder and recreated the ISO with makeisofs. The only way I could get this to work, was to copy the /root/install.log file into an excel spread sheet, from where I stripped out everything not related, and added a copy string to it (concatenate works nice for this).

While searching for answers to this problem, I found a site with a nice script to automatically scan the /root/install.log file on the installed system and copy those files to a new folder, then use createrepo to create a new repo, and makeisofs to create a new ISO file for installation.

Here’s the original website: http://lingxiang.tang.googlepages.com/createalesssizecentos5

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

Code highlighter not working anymore :(

2
Filed under Wordpress

For some odd reason my code high lighter isn’t working anymore :( So now all my posts look ugly, and I need to figure out why…..

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

How to create custom Linux ISO images?

0
Filed under Hot Tips

I often want to modify the contents of a Linux CD, and then I need to recreate the ISO image before I can use it on another PC. One such example is to make a "vanilla" install of CentOS Linux for cPanel. cPanel and most other control panels don’t want / need all the extra software installed, and I normally use the same partition scheme, language & county settings, and other settings on the servers.

So, first I mount the CD, and copy all the files to my hard drive, say "/tmp/cds"

So, I would delete all packages not needed, and then make a custom ks.cfg kickstart file with all the settings I need. But, now to recreate the ISO image to be written to a CD. For this purpose one can use mkisofs under Linux, as follows:

[php]cd /tmp/cds/centos51_x86; mkisofs -o /tmp/centos51_cpanel.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -J -R -V "CentOS 5.1 cPanel CD" .[/php]

And that’s it. Now I can burn the /tmp/centos51_cpanel.iso file to a CD, ready to install a new cPanel server :)

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

It’s late, I’m tired, need to finish my work

0
Filed under Blogging

It’s been quite some time since I have last blogged (hey, this word doesn’t exist in the dictionary, is it a valid verb?) so I better post some stuff on my blog again.

Things have been hectic at work. I have quite a few web development projects to complete, and also a new Dedicated Server in South Africa to start promoting and selling space on it. It’s been running very well for about 3 weeks now, but I want to upgrade the Xen kernel on it with a newer one, but at the same time upgrade the Hard Drive to a bigger one. I don’t think the current 80GB HDD will last long. So, I’m currently playing around with an automated installation of CentOS 5.1 x64 & a kickstart file, but it’s rather later and I think I’m going to finish this up tomorrow.

I also need to finish up our VPS packages on the billing system so that users can start ordering it, and then I must advertise them. The Matrix is playing in the background, and though I’ve seen it many times, it’s still a good movie….

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

Need to setup some LVM (Logical Volume Management) partitions on Linux?

0
Filed under Hot Tips

I found a site with a quick overview on how to create Logical Volume’s (otherwise known as LVM) on a Linux partition.

Here’s the link

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

How to enable a startup & shutdown sound on Linux Servers

0
Filed under HOWTO\'s

I was looking for a way to get notifications when servers start up or shutdown. Since a server normally doesn’t have a monitor connected.

Using a chime / tone could be very effective, but since servers normally don’t have external speakers, the internal speaker would need to be used. It is there already, and generally used by the BIOS for diagnosis.

The following website, http://www.johnath.com/beep/ has a nice script for this exact purpose. Setting is up is very easy, If you use an rpm based system like Fedora Core, CentOS, Redhat, etc, then you can use rpm to install the script, as follows:

[php]

rpm -ivh http://www.johnath.com/beep/beep-1.2.2-1.src.rpm
[/php]

Once installed, you need to reboot for the script to take affect, since it’s using the internal speaker. After you have rebooted, you can use it with

[php]
/usr/bin/beep -l 75 -f 500
[/php]

use man beep to see all the options.

ipcop use the following startup & shutdown "sequences":

[shell]

# Send nice startup beep now
/usr/bin/beep -l 75 -f 500
/usr/bin/beep -l 75 -f 1000
/usr/bin/beep -l 75 -f 2000
/usr/bin/beep -l 75 -f 3000

# Send nice shutdown beep now
/usr/bin/beep -l 75 -f 3000
/usr/bin/beep -l 75 -f 2000
/usr/bin/beep -l 75 -f 1000
/usr/bin/beep -l 75 -f 500
[/shell]

To make this work automatically when the server starts up, or shuts down, you need to create the following 2 scripts (or similar), in /scripts ( I keep al my "self made" scripts here, you can put it anywhere you like)

Create the startup sound with "vi /scripts/startupsound"

[php]

/usr/bin/beep -l 125 -f 500
/usr/bin/beep -l 125 -f 1000
/usr/bin/beep -l 125 -f 2000
/usr/bin/beep -l 125 -f 3000
/usr/bin/beep -l 125 -f 4000
/usr/bin/beep -l 125 -f 5000
[/php]

Now, create the shutdown file, with "vi /scripts/shutdownsound"
[php]
/usr/bin/beep -l 125 -f 5000
/usr/bin/beep -l 125 -f 4000
/usr/bin/beep -l 125 -f 3000
/usr/bin/beep -l 125 -f 2000
/usr/bin/beep -l 125 -f 1000
/usr/bin/beep -l 125 -f 500
[/php]

Lastly, we need make them executable, as follows:
[php]
chmod +x /scripts/startupsound
chmod +x /script/shutdownsound
[/php]

and then add them to the system runtime scripts. For startup, add the following right at the bottom of /etc/rc.local:

[php]
sh /script/startupsound
[/php]

The shutdown sound script goes into /etc/init.d/halt, at the top:

[php]
sh /script/shutdownsound
[/php]

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

Some notes on writing a Kickstart file for automated CentOS (or any other Redhard Linux variant) Linux installations

0
Filed under General

I’m busy writing a kickstart file to be used on and automated installation of CentOS Linux on my servers. I basically need a vanilla installation for cPanel, and 90% of the options I choose will always stay the same, like the language / country / time zone / packages / etc. The only things that will change are: hostname / IP address / partitioning scheme (if more than 2 HDD’s, then RAID is to be used)

With the kickstart script I can install a new server in less than 10 minutes, meaning better productivity. This is also ideal for reinstalling / upgrading existing servers with least amount of downtime.

I’m going to take some notes on the setup of the kickstart file, and maybe later one post a more in-depth howto on the kickstart file.

<– more –>

It’s been a while since I worked on this, and thought I’d chase up on it again.I last left off with the RAID partitioning script, which I couldn’t get working properly. Basically I want the kickstart file to automatically setup different software RAID levels, depending on the amount and type of drives installed. All my attempts failed, but I now found a site that might help. On http://evuraan.blogspot.com/2005/02/auto-finding-your-hard-drives-for.html the user explains a scenario that uses perl to see how many drives are installed, and then partition them as needed. From what I see, it could be possible to setup different RAID levels this way, even if the server has a mixture of IDE, SCSI & SATA HDD’s installed. IDE normally reports are /dev/hdX, and SCSI & SATA as /dev/sdX

….. more on this later

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis