logo
Published on LinuxElectrons (http://www.linuxelectrons.com)

Upgrading a Dedicated Server to Fedora 7

By ByteEnable
Created 07/08/2007 - 13:53
LinuxElectrons is hosted on a dedicated server, running Fedora Core, that is until last week. The IDE hard drive in the server timed out causing some of the services running to crash, most noticeable was httpd (apache). To my surprise, ssh still worked. In the past when I've had a disk drive crash the OS usually panics or just freezes.

So I logged in and did a quick peek at /var/log/messages. There it was, a timeout on the IDE drive. Apache could not be restarted along with some other oddities. I contacted tech support and they warm rebooted the server. The warm reboot didn't work so the tech performed a cold boot. It came right back up and everything seemed to be okay. I then received an email stating that the IDE disk drive is failing and they want to replace the drive at my convenience. No problem, its a holiday weekend, I have time. For those curious minds, a warm boot is when the reset button is pressed or reset is initiated via software. A cold boot is when power is removed from the system and then reapplied (power switch).  A cold boot is a much more thorough reset.  All the hardware performs a complete reset.

The server has been running a mangled version of Fedora Core 4. I've been manually updating over the years using yum and compiling httpd, PHP and MySQL by hand. Since this was going to be a fresh drive, I inquired about the restore process. Backup and restore is a premium feature which LinuxElectrons does not have. The restore process was going to be a fresh install of the OS. I asked for Fedora 7, but was informed that Fedora Core 6 was the latest supported version. A quick google determined that going from Fedora Core 6 to Fedora 7 was a no-brainer. I was starting to get excited. After a few minutes it hit me that I was going to have to reconfigure the entire server all over again, minus basic network configuration details. My gleeful excitement was replaced with nervous apprehension while ticking off the packages in my head, Apache, PHP, Sendmail and MySQL.

Upgrade

After backing up the www directories, MySQL databases and /etc, I contacted tech support to inform them that I was ready for the drive replacement. Within an hour I received an email with the login information. The first thing I did was to prepare yum for the upgrade to Fedora 7. This was accomplished using the following commands:
I kicked off the update with “yum -y update”. Yum spun for a few minutes then it was soon upgrading about 1500 packages. This process took about an hour.

Fedora 7

Fedora 7 uses the new PATA/IDE subsystem, which (like the SATA subsystem) goes through the SCSI layer. All disk devices are now /dev/sdX. Before a reboot into Fedora 7, some changes must be made to grub.conf and /etc/fstab. According to the release notes, all partitions must be labeled. Since I wasn't using LVM, labels were not a must. I just changed all the hda's (/dev/hdaX) to sda's (/dev/sdX) in grub.conf and /etc/fstab. In fact, using labels originally caused some grief. Tech support had placed the failing drive on the secondary IDE port for convenience. The drive stays for seven days to give you a chance to copy something over. Now both drives had the exact same labels, Fedora 7 did not like this. I removed the labeling and resorted back to /dev/sdX as stated earlier.

The previous installed version of Fedora was hand tweaked, custom kernel, bare-bones services and so forth. Fedora 7 installed an i686 kernel along with a i686 version of glibc, cool. However, it also installed unnecessary services for a dedicated server residing on the Internet. PHP is also now very modular, meaning that one has to manually install php-mbstring, php-gd and others. Yum makes this a snap if you know the file name. I usually browse the repository for file names on a mirror, like mirrors.kernel.org. The official filename for php-gd is php-gd-5.2.2-3.i386.rpm. To install, you would use “yum install php-gd”.

Tweaking Services

The services listed below were stopped using “/etc/init.d/[service] stop”. Then the services were prevented from starting by using “/sbin/chkconfig --level 0123456 [service] off”.

NetworkManager, NetworkManagerDispatcher, avahi-daemon, avahi-dnsconfd, bluetooth, cpuspeed, cups, dc_client, dc_server, dhcdbd, dund, firstboot, hidd, ip6tables, irda, irqbalance, kdump, mailman, mdmonitor, multipathd, named, netconsole, netfs, netplugd, nfs, nfslock, nmb, nscd, pand, pcscd, postgresql, psacct, rdisc, rpcbind, rpcgssd, rpcidmapd, rpcsvcgssd, smb, squid, tux, vsftpd, winbind, wpa_supplicant, ypbind

RedHat magazine published a decent article on understanding Linux daemons [3] that can be used as a guide on deciding which services to turn off.

Final Tweaks


There are three final tweaks that I use. I remove all tty consoles except for one in /etc/inittab and do not run the X server as shown here:
The final tweak is the blacklisting of snd and soundcore in /etc/modprobe.d/blacklist.

The upgrade went very well except for the initial IDE disk device names versus labels.  LinuxElectrons is now running Fedora 7.

Source URL:
http://www.linuxelectrons.com/features/howto/10611/upgrading-dedicated-server-fedora-7