Linux

Swap On, Swap Off

Submitted by scott on July 27, 2006 - 4:32pm

My server has been acting up lately. It would periodically slow to a crawl and stop responding. Checking the server log files I would always see an entry about mysql running out of memory. I assumed it was a mysql performance tuning issue and was reading up on the plethora of performance settings you could tweak. This lead me down various wild goose chases. I should have started with the obvious: What is consuming all the memory on my machine? I did do a "top" of my system and nothing appeared to be using more memory than it should, but I didn't look at the overall memory usage until today. Here is what I saw:

Memory usage before

Look at that carefully. First of all 84% of the memory is being used, but that's not a big deal. Linux caches as much as it can into RAM and then swaps out what it doesn't need to the virtual memory on demand. Virtual memory....swap....look at that picture again. 0 bytes of swap!!! There is NO virtual ram available! According to my system it doesn't exist! That's trouble. Looking over my /etc/fstab file (the file that specifies all of your partitions that you are mounting) it looked like it was loading my swap partition.

But executing:

cat /proc/meminfo

Showed that there was 0 bytes of swap.

There is a command in Linux to enabled/disable the swap (virtual memory). The commands are swapon and swapoff. I gave swapon a try:

/sbin/swapon /dev/sda3

Then looked at my memory usage. Ahhhh there is my swap.

Memory Usage After

No wonder my machine was locking up, it was running out of physical ram and then crashing hard because it had nothing else to do. But the question is why was the swap partition not being mounted? Well that's my stupidity. I was restructuring my partitions the other day and created a new swap partition but never gave it a label. The label is basically a name you can give your partition such as "backup" or "work". In my fstab file I was mounting my swap file using the label rather than specifying what device it is (/dev/hda3 in my case). So to fix this I just needed to update my fstab file to mount my swap using the device name rather than the label name.

Moral of the story: When you have insomnia, don't screw with your partitions late in the evening...compile your kernel instead. ;)

HowTo: Install iFolder on Fedora Core 4

Submitted by scott on April 19, 2006 - 9:04am

Now that my Fedora install is upgraded to FC4 I decided to give iFolder a shot. It's actually "fairly" easy to install, but I ran into a couple of snags trying to get it configured and running.

Installation on Fedora is simplest if you use Yum. To do this you need to add repositories for mono and iFolder. Here is a super fast way to get the repositories setup:

For Mono:

wget http://www.go-mono.com/download/fedora-4-i386/mono.repo
cp mono.repo /etc/yum.repos.d/

For iFolder:

wget http://forgeftp.novell.com/ifolder/server/3.5/iFolderServer-Fedora.repo
cp iFolderServer-Fedora.repo /etc/yum.repos.d/

Now the repositories are setup, you should execute yum upgrade to update your repository lists.

To install now is a piece of cake:

yum install ifolder3-server

Yum rules! If you are familiar with Apt-Get you will appreciate Yum. It will download and install all the dependencies...no messing around with tar balls for me!

So now iFolder is installed but it needs to be configured. I read through this wiki page to get some details on configuring iFolder...

Update FC3 to FC4 Using Yum

Submitted by scott on April 18, 2006 - 4:22pm

To test out iFolder I had to upgrade my Fedora Linux install to FC4. I contemplated FC5 but read somewhere about an issue with iFolder and FC5 so I decided against it. Best not to leap frog from FC3 to FC5 anyways...baby steps.

Rather than clean install or download the installer CD and attempt an upgrade I decided to tempt fate and see how well a live update using Yum would work. Note: first I backed up everything. I may be adventurous but I'm not crazy. This upgrade path is not recommended by the Fedora Project, however many people have had good success with it.

Key points:

  • Disable third party repositories first
  • Backup everything important!
  • Make note of any third party software you may have installed (it may be broken after the upgrade)
  • Disable SELinux and reboot
  • Some config files may have changed. The upgrade will not overwrite your existing config files but will create a version with a .rpmnew extension so you can merge the changes into your existing config.
  • FC3 uses PHP 4 and FC4 uses PHP 5 so you will have to update your php.ini file after the upgrade. You pretty much can just mv php.ini php.ini.bak and mv php.ini.rpmnew php.ini to get it working.

This is a quick list of steps on what to do.  For more information on what's going on etc, read through the links at the bottom.  Particularly if you have a 64 bit system, there are some additional steps that I omitted here.

Step 1: yum -y update yum
Step 2: wget http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os/Fedora/RPMS/fedora-release-4-2.noarch.rpm
Step 3: rpm -Uvh /path/to/fedora-release-4-2.noarch.rpm
Step 4: Disable third party repositories. I just renamed them from .repo to .bak
Step 5: yum -y upgrade mkinitrd
Step 6: yum -y update kernel
Step 7: Disable SELinux: nano /etc/sysconfig/selinux and set SELINUX=disabled
Step 8: Reboot and load FC4 Kernel
Step 9: yum remove kernel-2.6.\*FC3\* and yum remove kernel-smp\*FC3\*
Step 10: yum -y upgrade
Step 11: Go get a coffee this will take some time...
Step 12: yum groupinstall "GNOME Desktop Environment"
Step 13: Re-enable SELinux if you use it
Step 14: Reboot
Step 15: Look over system logs and see if any problems occurred at bootup.
Step 16: Re-enable third party repositories and perform yum update

I didn't come up with this whole step process. I used the following two resources to come up with a strategy:

YumUpgradeFaq

Upgrading Red Hat Linux with Yum

So far it's been a big success. My only snag was php being broken, but after updating my php.ini file it worked fine. Now I should be able to give iFolder a go and see how well it works...