Monday, December 13, 2010

OpenSUSE sleep function.

After much back and forth on operating systems, having tried FreeBSD, OpenBSD, Fedora and CentOS; I've decided to come back to OpenSUSE. Why? Because it feels more like home. Also it has features that as I've mentioned in other posts are just not comparable on other systems. It is true that Yast is available through oracle for other operating systems and if you are married to one of those systems I suggest checking it out as a taste of what you are missing by not using Suse. I currently use the ncurses version of yast to perform many administrative tasks. I also use midnight commander a lot when I can't remember where a certain file lives(not to mention its text editor is far superior to say, vi or vim... yes I said it). Since re-installing I've met with a few problems. I am not a power saving maniac(some optimization is good, but it can quickly become time consuming to get fine grained and not usually reliable control). The first thing that I noticed was that, though at some point in the past the sleep function worked seamlessly out of the box, it had been failing since my last install and is currently very buggy. So I set out to find the config file which I found using mc(midnight commander) residing at... /etc/pc/config.c/defaults. I found that there are a few options for putting a computer to sleep one could use as an alternative to the default user space suspend module (including tuxonice, userspace and kernel mode). the kernel mode module worked the best for me, but I still had some problems. Before I began experiencing problems my server would keep the ethernet device listening for connections when the rest of the system went to sleep and it would wake itself on lan and even wlan connections. So after much unsuccessful research I decided that maybe putting the whole system to sleep will not do any longer for my needs. Instead I decided to just put the monitor to sleep and spin down disks when possible(this option can easily be configured through the Suse control panel gui). I was still experiencing some efficiency problems. The external disk would rarely spin down and was even getting quite hot when not accessed. I did some more research and found that I could use the noatime option in /etc/fstab (so my fstab entry looks like this: /dev/sdb1 /home/*****/Desktop/the_disk ext4 acl,noatime,user xattr 03 (where ***** could be your username)) on my drives to prevent the operating system from journaling access times(I am interested in when the file was created or changed, but I could care less when it was accessed last so for me the trade of works. There is a definite trade off in security and your ability to log activity(for example it can come in very handy if you need to trace back files accessed maliciously) and you may not want to disable the option on your more important partitions(like root for example), but obviously it has its uses for power management). Apparently, the operating system will access the drive about every 5 seconds unless this option is turned off using the noatime option. While it is unlikely that the root disk will be spun down very frequently, if ever(making it almost un-necessary to toss this option(I decided to give it a go anyway as I am not running a particularly sensitive server(though I would not recommend it if you deal with mission critical data), but the external storage device and the monitor will be churning away only when needed(as will everything else, though its not likely to make too much difference).

Now since I am using a machine that is quite old to host my lamp server I decided to pop in a partition magic live cd and run some tests(I noticed in my logs that a segment of my hard drive is offline and thus more or less invisible to the operating system, this is likely due to age). It appears after some brief diagnostics that the drive is rather unhealthy(prefail I believe is the term it used). This is something that will command my attention in the future, but I can't afford to address it at the moment. The fix for this is a new drive and clonezilla, which is entirely within the scope of my understanding, but a new drive is out of the scope of my financial situation currently(hopefully it won't fail completely before I can address it)... Until then frequent back-ups are in order. On ubuntu I like deja dup for handling this, but since my server has no X on it, I've been using a python script to tar the files and store them on my hard drive, maybe I'll go into that next time.

No comments:

Post a Comment