Mar 30 2006

Part 1 Installation of Centos-3 for a Home Server. The Install day

Tag:tepezcuintle @ 15:31

Installation of Centos-3 for a Home Server.

First download the ISO’s from the centos website.

http://isoredirect.centos.org/centos/3/isos/i386/

Once downloaded use your CD burner and burn the ISO image onto a CD

Have your disks ready and don’t scratch them

######## How to build penguincentos Linux Server. ########

I want to create a machine that I can use at home or this can be used at work. This
machine will not be used for anything that involves graphical interfaces. This will be a machine that will hosts

A mailserver. Qmail
Webserver + Databases Apache + MySQL + Posgresql + PHP

it can be used also as a fax print server or Samba Server to share files.

I will show you step by step how you can do the same and build a reliable and secure
server that you can use from home using your Cable or DSL line.

######### The Machine ##############################

I have a Dell machine Pentium 600 and 380 megs of Ram
let’s try to turn this old machine into a server.

Put the CD into the machine
setup your computer to boot from CD ( check your bios )
usually if you put the cd it will boo into the Centos installer, but
if you have problems check your BIOS

Ok I put the cd and it went into the Centos installer
if it ask you what type of install type choose

linux-text

Then a window will come up begin testing the CD, it is better to
have the machine test the CD just in case, so let’s do it.

This is going to take some time so sit an relax.

Ok after a a few minutes the computer screen reads

The media check passed and it is ok to install from this media.

So press enter to continue. It asked me if I wanted to continue testing other media. I decided to just say no because I know the media that I have is fine. So i said no and the installer continued.

Choose your language. US English
Keyboard US
Generic Wheel mouse ps2 ( we won’t be using the mouse much but leave that setting on )

Then it ask you to choose

personal desktop
workstation
Server
Custom

Let’s pick custom. We don’t want a lot of stuff installed so we will select that option.

Then it comes the part to setup the partitions. I have a 20 Gig hard drive so I am going to check for autopartition just for the hell of it and see what it recommends for me. I can change that later
if that does not match my needs.

I had windows XP on this machine so the machine prompted me saying that all partitions on this
computer will be removed.

I picked the option Remove All partitions on this computer then pick the drive for this installation
if you have only one drive in your computer you could have hda and hdb . This computer only has
one drive hda

so I picked [*] hda

Then after clicking ok the computer displays.

You have chose to remove all partitions (ALL DATA ) on the following drives:

/dev/hda

Are you sure you want to do this.

Of course you want to do this :) so choose Yes and press enter

ok the Autopartitioning tool picked the following

hda1 101Megs
hda2 18.3 gigs
hda3 635 swap

So far it seems reasonable. let me explain. the /boot folder is where your kernel is stored. Usually the kernel is not that big so 101 megs is enough, data like /etc/ /home/ /var and other
folders will be stored inside the hda2 partition. The rest hda3 is space used by the Linux kernel to manage swap memory. Usually the swap memory is double the size of your ram. 635 is actually a right amout for my installed RAM.

So after reviewing this I choose Ok.

Then after that it asked me if I want to choose Grub or Lilo, I like lilo better so I will choose Lilo
the press ok.

“A few systems require special options to pass to the kernel at boot time”

Leave this area blank and press enter.

after I click ok there is this window

Defaut boot label Device
* linux /dev/hda2

that looks fine so press ok

Then it ask you where do you want to install the boot loader. Choose MASTER BOOT RECORD

/dev/hda Master Boot Record.

Then it ask me to configure the networking. It ask me if I want to use DHCP basically DHCP is good if you have a dhcp server such as a router linksys router, netopia or any router that provides IP address to clients that request an ip using DHCP. However, since I am going to be using this machine as a server I will use a dedicated IP address.

I run a Linksys router that gives IP addresses in the range of 192.168.1.10-254

so I am going to pick 192.168.1.145

before I do that let’s make sure no one is using this ip at the office.

C:\DOCUME~1\MARCOM~1>ping 192.168.1.145

Pinging 192.168.1.145 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Basically no one is using that IP address so it is ok to use it.

uncheck the DHCP option on the setup screen

Leave * Active on boot. That means that once the computer restarts it will use the given ip everytime. Otherwise if you choose no your server will boot up without an IP so let’s avoid that :)

IP Address 192.168.1.145
Netmask 255.255.255.0 ( usually this netmask is very common for home routers )

Then press ok

Gateway. This is the IP address of your Router. usually the router is 192.168.1.1 but if you have
a windows machine already connected to the network just open the command prompt and type

ipconfig /all

C:\DOCUME~1\MARCOM~1>ipconfig /all

Windows IP Configuration

Host Name . . . . . . . . . . . . : penguin
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : 3Com EtherLink XL 10/100 PCI Fo
plete PC Management NIC (3C905C-TX)
Physical Address. . . . . . . . . : 00-01-02-3A-B4-B0
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.1.130
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
DNS Servers . . . . . . . . . . . : 192.168.1.135

The gateway address is 192.168.1.1 and the DNS server is 192.168.1.135
so I typed that on my configuration

You can find our your DNS servers by calling your ISP and ask them to give you the IP addresses
of their DNS servers so you can use them on your machine.

Then press Ok

now it is asking you for the hostname. The hostname is the name of this server. you can give it a name like

penguincentos and click ok

Then an option comes up that says Enable firewall or No firewall

I am doing this installation behind the router at home. So I am not going to setup a firewall yet
basically this server is protected from outside hackers by the router. So I am not going to enable the firewall yet.

No firewall and click ok.

Additional Language support.

English USA

Click ok.

Time Zone selection. I am in NYC so I am going to choose.

America/New_York

Click ok

password ( This is your root password )

make a password that you will remember, If you forget this password you will have problems
login into your machine as root. pick an 8 character password that includes number and letters

I picked my password The66KiLLEr

Now it asked me what I am going to install on this server

Disable X windows , Gnome , Graphical Internet, Office Productivity
Sound and Video, Graphics, anything that involves the desktop should be removed. Remember we won’t be doing video or X windows on this computer no KDE or Gnome.

Enable Text based internet, Development Tools, Kernel development. Printing support and Network Servers, System Tools.

Then Click ok

Then it says a complete log will be found under /root/install.log so you can check what was installed.

Click ok.

Then it began the formatting of the file system.
Then Transfering install image to the hard drive.
Preparing RPM transaction.

Starting Install process this will take some time.

The RPM’s are being copied and installed on their respective directories.

Go and eat something some cereal , have some coffee or watch some TV.

The files will take some time to be transfered.

After 10 minutes it asked me to put CD #2

I put the CD on the tray and click ok

Then after a few minutes it asked me for Disk #3 , I put the CD on the tray and hit Ok

then I got a window

Congratulations Your CentOS-3 Installation is complete. Remove any cd’s and press enter
to reboot your machine.

Let’s do that :)

press ok

The computer rebooted. Now let’s see what happens

I got the Centos logo then it went into booting the kernel

Lots of text scrolling , a lot of services are starting. An ssh key was generated.

Don’t worry about all this, it is just cool to see all that stuff happening right now.

Now you I got a login

penguincentos login:

enter root and my password

username: root
password: The66KiLLEr

don’t think for a minute that that is my real password. I am using this only to demostrate what to enter

then I got [root@penguincentos root]#

cool now you are root on your server.

Let’s create another user

enter this command

adduser penguinadmin

then

passwd penguinadmin

it will prompt you for a password enter anything you want but please write it down.

New passwd **************

you will see all authentication tokes updated successfully.

then on the console type exit.

You Will see

Centos Release 3.4 ( Final )
Kernel 2.4.21-27-0.1EL on an i686

Ok so let’s recap what we have done.

We created partitions for our server. Installed the operating system and the bootloader so our machine will boot into linux automatically, we also configured an ip address

from your Windows computer do

ping 192.168.1.145 ( change that to the ip you gave your machine )

Pinging 192.168.1.145 with 32 bytes of data:

Reply from 192.168.1.145: bytes=32 time<1ms TTL=64
Reply from 192.168.1.145: bytes=32 time<1ms TTL=64
Reply from 192.168.1.145: bytes=32 time<1ms TTL=64
Reply from 192.168.1.145: bytes=32 time<1ms TTL=64

Ping statistics for 192.168.1.145:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\DOCUME~1\MARCOM~1>

Excellent this means your computer is online and you can ssh from your windows machine.

If you need a great SSH client for windows use this

http://ftp.ssh.com/pub/ssh/SSHSecureShellClient-3.2.9.exe

that ssh program rules and is the one I use at work and at home.

We will continue the setup of this computer from windows. We will SSH into the new server and continue from there. You can setup this server away from your desk if you want as you don’t need to be using a monitor or a keyboard anymore. We can controll all that through SSH

Install the SSH client on your windows machine

Open the SSH program and click on file / connect

Hostname 192.168.1.145 ( or use the ip you gave your machine )

username penguinadmin ( or the username you setup on that machine )

type the password you used for penguinadmin not the root password.

The SSH program will say that you are connecting for the first time and if you store the finger print of the host public key. Say yes.

password type the password you gave to penguinadmin

[penguinadmin@penguincentos penguinadmin]$

haha :) you are now connected to your Linux machine over SSH,

let’s update our machine. We need to update the machine because many packages have been upgraded since those CD’s came out. The update will download the new packages and update your machine.

become root ( root is the only user able to modify and install programs in the machine ) if you tried to update your machine using username penguinadmin you will fail since this user is only a limited user

user root is very powerfull so be careful when you use it , you can hose your installation if you type the wrong command

[penguinadmin@penguincentos penguinadmin]$ su -l root

enter your password

[root@penguincentos root]# yum update

you will see a lot of text on the screen
something like this .

Gathering header information file(s) from server(s)
Server: CentOS-3 - Addons
Server: CentOS-3 - Base
Server: CentOS-3 - Extras
Server: CentOS-3 - Updates
Finding updated packages
Downloading needed headers

xemacs-0-21.4.13-8.ent.1. 100% |=========================| 154 kB 00:00
rh-postgresql-pl-0-7.3.10 100% |=========================| 5.4 kB 00:00
gnome-desktop-0-2.2.2-2.2 100% |=========================| 10 kB 00:00
gtk2-devel-0-2.2.4-19.i38 100% |=========================| 35 kB 00:00
sendmail-cf-0-8.12.11-4.R 100% |=========================| 15 kB 00:00
tetex-fonts-0-1.0.7-67.9. 100% |=========================| 117 kB 00:00
redhat-config-kickstart-0 100% |=========================| 8.7 kB 00:00
XFree86-base-fonts-0-4.3. 100% |=========================| 78 kB 00:00
anaconda-product-0-3-6.ce 100% |=========================| 1.5 kB 00:00
compat-libgcj-devel-0-7.3 100% |=========================| 31 kB 00:00
compat-gcc-objc-0-7.3-2.9 100% |=========================| 14 kB 00:00
kdebase-6-3.1.3-5.9.i386. 100% |=========================| 101 kB 00:00
gnome-system-monitor-0-2. 100% |=========================| 4.9 kB 00:00
bootparamd-0-0.17-19.RHEL 100% |=========================| 2.6 kB 00:00
XFree86-75dpi-fonts-0-4.3 100% |=========================| 76 kB 00:00
gnome-vfs2-devel-0-2.2.5- 100% |=========================| 7.0 kB 00:00
gdk-pixbuf-devel-1-0.22.0 100% |=========================| 4.9 kB 00:00
kernel-0-2.4.21-40.EL.i58 100% |=========================| 51 kB 00:00
samba-swat-0-3.0.9-1.3E.5 100% |=========================| 25 kB 00:00
redhat-config-users-0-1.1 100% |=========================| 7.5 kB 00:00
rh-postgresql-jdbc-0-7.3. 100% |=========================| 4.8 kB 00:00

And then it will show you which clients can be updated.

Resolving dependencies
Dependencies resolved
I will do the following:
[install: kernel 2.4.21-40.EL.i686]
[update: cups 1:1.1.17-13.3.36.i386]
[update: samba-client 3.0.9-1.3E.5.i386]
[update: hwdata 0.101.20-1.noarch]
[update: hotplug 3:2002_04_01-20.5.i386]
[update: libstdc++ 3.2.3-53.i386]
[update: glibc-utils 2.3.2-95.37.i386]
[update: devlabel 0.48.03-10.i386]
[update: util-linux 2.11y-31.11.i386]
[update: rpm 4.2.3-24_nonptl.i386]
[update: binutils 2.14.90.0.4-39.i386]
[update: tar 1.13.25-14.RHEL3.i386]
[update: perl-CPAN 2:1.61-90.4.i386]
[update: openssh-server 3.6.1p2-33.30.6.i386]
[update: XFree86-Mesa-libGLU 4.3.0-97.EL.i386]
[update: initscripts 7.31.30.EL-1.i386]
[update: libstdc++-devel 3.2.3-53.i386]
[update: cpio 2.5-4.RHEL3.i386]
[update: rh-postgresql-devel 7.3.10-2.i386]
[update: openssl-devel 0.9.7a-33.17.i386]
[update: bzip2 1.0.2-11.EL3.4.i386]
[update: make 1:3.79.1-17.1.i386]
[update: openldap 2.0.27-20.i386]
[update: libgcc 3.2.3-53.i386]
[update: gnome-mime-data 2.2.0-4.i386]
[update: ethereal 0.10.14-1.EL3.1.i386]
[update: cups-libs 1:1.1.17-13.3.36.i386]
[update: rpmdb-redhat 3.4-0.20051015.i386]
[update: vim-minimal 1:6.3.046-0.30E.4.i386]
[update: vixie-cron 4.1-10.EL3.i386]
[update: XFree86-xfs 4.3.0-97.EL.i386]
[update: zsh 4.0.7-1.EL.2.i386]
[update: raidtools 1.00.3-8.EL3.i386]
[update: elinks 0.4.2-8.i386]
[update: quota 1:3.10-7.i386]
[update: curl-devel 7.10.6-7.rhel3.i386]
[update: glibc-profile 2.3.2-95.37.i386]
[update: ipsec-tools 0.2.5-0.7.i386]
[update: procps 2.0.17-13.7.i386]
[update: XFree86-libs-data 4.3.0-97.EL.i386]
[update: gcc-c++ 3.2.3-53.i386]
[update: krb5-workstation 1.2.7-47.i386]
[update: mkinitrd 3.5.13.6-1.i386]
[update: libf2c 3.2.3-53.i386]
[update: iscsi-initiator-utils 3.6.3-3.i386]
[update: pam-devel 0.75-66.i386]
[update: net-snmp-libs 5.0.9-2.30E.19.i386]
[update: ghostscript 7.05-32.1.10.i386]
[update: tcl 8.3.5-92.4.i386]
[update: usermode 1.68-5E.4.i386]
[update: less 378-12.i386]
[update: ntsysv 1.3.13.2-0.3.i386]
[update: centos-release 3:3-6.1.i386]
[update: file 3.39-9.EL3.3.i386]
[update: glibc 2.3.2-95.37.i686]
[update: comps 3.6centos.0-0.20051012.i386]
[update: perl 2:5.8.0-90.4.i386]
[update: mount 2.11y-31.11.i386]
[update: kudzu-devel 1.1.22.14-4.1.centos.0.i386]
[update: kernel-utils 1:2.4-8.37.12.i386]
[update: openssh-clients 3.6.1p2-33.30.6.i386]
[update: samba-common 3.0.9-1.3E.5.i386]
[update: rpm-devel 4.2.3-24_nonptl.i386]
[update: kudzu 1.1.22.14-4.1.centos.0.i386]
[update: gtk2 2.2.4-19.i386]
[update: ypserv 2.8-13.i386]
[update: gcc 3.2.3-53.i386]
[update: net-snmp-devel 5.0.9-2.30E.19.i386]
[update: gdb 6.3.0.0-1.62.i386]
[update: redhat-config-netboot 0.1.30-1_EL3.i386]
[update: mailx 8.1.1-31.EL3.i386]
[update: grep 2.5.1-24.5.i386]
[update: authconfig 4.3.7-3.i386]
[update: sysklogd 1.4.1-26_EL3.i386]
[update: vim-common 1:6.3.046-0.30E.4.i386]
[update: rmt 0.4b37-1E.i386]
[update: laus 0.1-70RHEL3.i386]
[update: sudo 1.6.7p5-1.2.i386]
[update: pstack 1.2-3.EL.2.i386]
[update: chkconfig 1.3.13.2-0.3.i386]
[update: rsh 0.17-17.6.i386]
[update: psmisc 21.3-2.i386]
[update: gzip 1.3.3-12.rhel3.i386]
[update: gcc-g77 3.2.3-53.i386]
[update: gcc-java 3.2.3-53.i386]
[update: redhat-config-securitylevel-tui 1.2.9.2-1.i386]
[update: jpackage-utils 1.5.38-1jpp_5rh.noarch]
[update: XFree86-truetype-fonts 4.3.0-97.EL.i386]
[update: gnupg 1.2.1-15.i386]
[update: nfs-utils 1.0.6-42EL.i386]
[update: krb5-devel 1.2.7-47.i386]
[update: SysVinit 2.85-4.4.i386]
[update: openldap-clients 2.0.27-20.i386]
[update: dump 0.4b37-1E.i386]
[update: nscd 2.3.2-95.37.i386]
[update: popt 1.8.2-24_nonptl.i386]
[update: rpm-libs 4.2.3-24_nonptl.i386]
[update: slocate 2.7-3.RHEL3.6.i386]
[update: openssl 0.9.7a-33.17.i686]
[update: iputils 20020927-11.30.2.i386]
[update: enscript 1.6.1-24.4.i386]
[update: ltrace 0.3.36-2.EL3.i386]
[update: libgcj-devel 3.2.3-53.i386]
[update: glibc-devel 2.3.2-95.37.i386]
[update: psacct 6.3.2-31.rhel3.i386]
[update: python 2.2.3-6.2.i386]
[update: netconfig 0.8.19-1.2.i386]
[update: fetchmail 6.2.0-3.el3.2.i386]
[update: net-tools 1.60-20E.9.i386]
[update: openldap-devel 2.0.27-20.i386]
[update: db4 4.1.25-8.1.i386]
[update: ncurses-devel 5.3-9.4.i386]
[update: usbutils 0.11-2.i386]
[update: db4-devel 4.1.25-8.1.i386]
[update: glibc-common 2.3.2-95.37.i386]
[update: bonobo-activation 2.2.2-1.2E.i386]
[update: bind-utils 20:9.2.4-7_EL3.i386]
[update: python-devel 2.2.3-6.2.i386]
[update: coreutils 4.5.3-28.i386]
[update: nss_ldap 207-17.i386]
[update: nptl-devel 2.3.2-95.37.i686]
[update: mktemp 1.5-18.2.i386]
[update: grub 0.93-4.8.i386]
[update: cvs 1.11.2-28.i386]
[update: sharutils 4.2.1-16.2.i386]
[update: strace 4.5.12-0.EL3.1.i386]
[update: bind-libs 20:9.2.4-7_EL3.i386]
[update: cpp 3.2.3-53.i386]
[update: glibc-kernheaders 2.4-8.34.2.i386]
[update: laus-libs 0.1-70RHEL3.i386]
[update: rh-postgresql-libs 7.3.10-2.i386]
[update: gnome-vfs2 2.2.5-2E.3.2.i386]
[update: XFree86-Mesa-libGL 4.3.0-97.EL.i386]
[update: tcpdump 14:3.7.2-7.E3.5.i386]
[update: netdump-server 0.7.7-2.i386]
[update: net-snmp 5.0.9-2.30E.19.i386]
[update: hpijs 1.3-32.1.10.i386]
[update: xinetd 2:2.3.12-6.3E.2.i386]
[update: tzdata 2005m-1.EL3.noarch]
[update: parted 1.6.3-29.5.i386]
[update: losetup 2.11y-31.11.i386]
[update: openmotif 2.2.3-5.RHEL3.2.i386]
[update: libgcj 3.2.3-53.i386]
[update: libobjc 3.2.3-53.i386]
[update: ncurses 5.3-9.4.i386]
[update: kernel-source 2.4.21-40.EL.i386]
[update: netdump 0.7.7-2.i386]
[update: dos2unix 3.1-15.EL.22.i386]
[update: crash 4.0-1.centos.0.i386]
[update: sysreport 1.3.7.2-9.noarch]
[update: gcc-objc 3.2.3-53.i386]
[update: bash 2.05b-41.4.centos.0.i386]
[update: XFree86-libs 4.3.0-97.EL.i386]
[update: ypbind 3:1.12-5.21.6.i386]
[update: pcre 3.9-10.2.i386]
[update: glibc-headers 2.3.2-95.37.i386]
[update: openssh 3.6.1p2-33.30.6.i386]
[update: sendmail 8.12.11-4.RHEL3.4.i386]
[update: up2date 4.4.44-3.centos.1.i386]
[update: kernel-doc 2.4.21-40.EL.i386]
[update: gcc-gnat 3.2.3-53.i386]
[update: db4-utils 4.1.25-8.1.i386]
[update: diskdumputils 1.1.9-3.i386]
[update: rpm-python 4.2.3-24_nonptl.i386]
[update: expect 5.38.0-92.4.i386]
[update: wget 1.10.2-0.30E.i386]
[update: curl 7.10.6-7.rhel3.i386]
[update: tk 8.3.5-92.4.i386]
[update: telnet 1:0.17-26.EL3.3.i386]
[update: rpm-build 4.2.3-24_nonptl.i386]
[update: unix2dos 2.2-19.EL.25.i386]
[update: krb5-libs 1.2.7-47.i386]
[update: centos-yumcache 3.1-0.20051015.3.noarch]
[update: libpcap 14:0.7.2-7.E3.5.i386]
[update: pam_krb5 1.77-1.i386]
[update: rdist 1:6.1.5-35.30.2.i386]
[update: bzip2-libs 1.0.2-11.EL3.4.i386]
[update: bzip2-devel 1.0.2-11.EL3.4.i386]
[update: shadow-utils 2:4.0.3-25.RHEL3.i386]
[update: libgnat 3.2.3-53.i386]
[update: lvm 1.0.8-14.i386]
[update: lsof 4.63-4.1.i386]
[update: pam 0.75-66.i386]
[update: autofs 1:4.1.3-154.i386]
[update: libtiff 3.5.7-22.el3.i386]
[update: XFree86-font-utils 4.3.0-97.EL.i386]
[update: man 1.5k-11.rhel3.i386]
Is this ok [y/N]:

If you press yes it will begin to download all those packages to udpate them.
But you will get this error

Downloading Packages
warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID 025e513b
Error: Could not find the GPG Key necessary to validate pkg /var/cache/yum/update/packages/cups-1.1.17-13.3.36.i386.rpm
Error: You may want to run yum clean or remove the file:
/var/cache/yum/update/packages/cups-1.1.17-13.3.36.i386.rpm
Error: You may also check that you have the correct GPG keys installed

What is going on here everything was going ok and now all this is happening :(

don’t dispair. Here is what you have to do.

cut and paste this into the console

rpm –import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-3

[root@penguincentos packages]# rpm –import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-3

press enter

nothing will happen. Then run yum update again

now you will see stuff like this .

Getting samba-client-3.0.9-1.3E.5.i386.rpm
samba-client-3.0.9-1.3E.5 100% |=========================| 3.2 MB 00:11
Getting hwdata-0.101.20-1.noarch.rpm
hwdata-0.101.20-1.noarch. 100% |=========================| 294 kB 00:00
Getting hotplug-2002_04_01-20.5.i386.rpm
hotplug-2002_04_01-20.5.i 100% |=========================| 45 kB 00:00
Getting libstdc++-3.2.3-53.i386.rpm
libstdc++-3.2.3-53.i386.r 100% |=========================| 260 kB 00:00
Getting glibc-utils-2.3.2-95.37.i386.rpm
glibc-utils-2.3.2-95.37.i 100% |=========================| 81 kB 00:00
Getting devlabel-0.48.03-10.i386.rpm
devlabel-0.48.03-10.i386. 100% |=========================| 32 kB 00:00
Getting util-linux-2.11y-31.11.i386.rpm
util-linux-2.11y-31.11.i3 100% |=========================| 1.3 MB 00:03
Getting rpm-4.2.3-24_nonptl.i386.rpm
rpm-4.2.3-24_nonptl.i386. 100% |=========================| 559 kB 00:01
Getting binutils-2.14.90.0.4-39.i386.rpm

realize that the computer is going to update the machine and lots of packages will be updated
it can take some time so relax and make sure you have broadband.

374 packages were downloaded and are being installed on the server.

Test transaction complete, Success!
libgcc 100 % done 1/374
hwdata 100 % done 2/374
XFree86-libs-data 100 % done 3/374
tzdata 100 % done 4/374
rmt 100 % done 5/374
gnome-mime-data 100 % done 6/374
glibc-common 100 % done 7/374

This can take some time too so hang in there.

Wow something happened since I started getting funny characters on the screen
I decided to hook up a monitor to my computer and I saw this

end_request I/0 error dev hda

What is this thing . I am going to reboot

I tried to ssh but still got the same error . I hit the power button
let’s pray that t his will work

The computer was able to boot fine and I noticed that there is a new linux kernel added to the list
of available kernel on the Centos screen.

Let’s see what happens.

I was able to get a logon window.

let’s try to ssh from windows.

[penguinadmin@penguincentos penguinadmin]$

well the thing was able to work but let’s assume that things are still broken,. I belive some of the updates didn’t get installed so I am going to try to run yum update.

become root again

[penguinadmin@penguincentos penguinadmin]$ su -l root
Password:

As soon as I did that I started to get the same error message.

end_request I/0 error.

This sucks.

I rebooted the machine using the second kernel that was listed let’s see what happens.

I noticed that on the windows ssh client i got this before I rebooted

error: db4 error(5) from dbcursor->c_get: Input/output error
error: db4 error(5) from dbcursor->c_get: Input/output error
error: db4 error(5) from dbcursor->c_get: Input/output error

This is an rpm db error let’s rebuild the database

Rebuild the database

.[penguinadmin@penguincentos penguinadmin]$ su -l root
Password:
[root@penguincentos root]# rpm –rebuilddb

Again I still had the same problem it seems like the disk is hosed.

Basically when I get those errors I grab the error I see on the screen and then paste it on google
or other search engines. I believe that there is always someone out there that has had the same
problem. In this case it appears that the disk is hosed and some sectors are corrupted.

Some people recommended to do an e2fsck -p to under init level 1 to fix this issue
basically I ran it and fixed some sectors but then when I rebooted I got an error

INIT: no inittab found

usually the sectors that were fixed are not available anymore and who knows if some of the sectors were used by the operating system files.

It doesn’t matter if doing e2fsck caused more problems because honestly that means that
your hard disk was messed up and would you trust a bad hard drive all your data?

I don’t think so.

this sucks

Well, time to find another disk. However, this was a good way for us to see what happens in real life situations when you are trying to do something and everything breaks :)

Before I decide to trash the whole thing I am going to do a linux rescure

boot from the Centos CD and press F5 and it will go into linux rescure

type linux rescue and it will go into rescue mode

I did that and it said that it would mount my system under /mnt/sysimage but it actually failed
it said that I did not have any linux partitions. This is really crazy.

How about trying the install again ??

Let’s give it a try.

So i reinstalled everything from scratch again.

Now I am going to use a tool to determine if things are working as they should

there is a program smartctl which can check the status of your drive on linux

su root

[root@penguincentos sbin]# ./smartctl -Hc /dev/hda
smartctl version 5.1-11 Copyright (C) 2002-3 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Off-line data collection status: (0×82) Offline data collection activity
completed without error.
Auto Off-line Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete off-line
data collection: (1568) seconds.
Offline data collection
capabilities: (0×1b) SMART execute Offline immediate.
Automatic timer ON/OFF support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
No Selective Self-test supported.
SMART capabilities: (0×0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0×01) Error logging supported.
No General Purpose Logging support.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 28) minutes.

It said that the system passed. That seems to be ok I guess so I am going to continue with the upgrade and download all the rpm’s

So after a reinstall things seems to work now and I have a full operational system.

I did a yum update and I got all the new updates and also the kernel got upgraded.

Ok some things took me a long time to fix but this won’t happen in general , I think some of the rpm db errors I was gettings is because the disk needed to be fsck manually,. I ran e2fsck /dev/hda2 to clear some of the errors and then I was able to use the computer fine.

I did a yum update and all the packages were installed and nothing to update.

I learned so many things installing this Centos Server. I have installed Centos so many times and never got a problem but this disk had windows XP before and I never ran scandisk on it. I should’ve done that before I installed Centos but seems like everything is working out ok.

On my next entry I will show you how to turn this machine into a powerful home or office server.