I have a Centos installed on a Hitachi 2.5" drive that shuts off really quickly, it seems.
So every 30 sec, the drive makes the sound of an access activity. I have looked trying to find what might be being updated. Swap drive usage is 0 bytes. No activity in /var/log. What might it be and can I do anything to lessen the drive access (improve battery life)?
Robert Moskowitz wrote:
I have a Centos installed on a Hitachi 2.5" drive that shuts off really quickly, it seems.
So every 30 sec, the drive makes the sound of an access activity. I have looked trying to find what might be being updated. Swap drive usage is 0 bytes. No activity in /var/log. What might it be and can I do anything to lessen the drive access (improve battery life)?
I'm sure there are other things as well but first thing comes to mind is disabling atime for your file systems, to test the change you can do this
(for each of the mount points) mount <mount point> -o remount,noatime
e.g.
mount / -o remount,noatime mount /usr -o remount,noatime
You can verify the options by running 'mount'. If this does the trick you can add the options to /etc/fstab, e.g.
LABEL=/ / ext3 defaults,noatime 1 1
nate
Thanks, but explain...
nate wrote:
Robert Moskowitz wrote:
I have a Centos installed on a Hitachi 2.5" drive that shuts off really quickly, it seems.
So every 30 sec, the drive makes the sound of an access activity. I have looked trying to find what might be being updated. Swap drive usage is 0 bytes. No activity in /var/log. What might it be and can I do anything to lessen the drive access (improve battery life)?
I'm sure there are other things as well but first thing comes to mind is disabling atime for your file systems, to test the change you can do this
(for each of the mount points) mount <mount point> -o remount,noatime
Everything is quite on the notebook front. Now.
But What is going on here?
atime -- Update inode access time for each access. This is the default.
noatime -- Do not update inode access times on this file system (e.g, for faster access on the news spool to speed up news servers).
Are the inodes being updated or some info about inode access times?
If you have a partition for a mail share, would this help it too (like it does for a news server)?
e.g.
mount / -o remount,noatime mount /usr -o remount,noatime
You can verify the options by running 'mount'. If this does the trick you can add the options to /etc/fstab, e.g.
LABEL=/ / ext3 defaults,noatime 1 1
nate
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Robert Moskowitz wrote:
But What is going on here?
atime -- Update inode access time for each access. This is the default.
noatime -- Do not update inode access times on this file system (e.g, for faster access on the news spool to speed up news servers).
Are the inodes being updated or some info about inode access times?
Every time a file is accessed the file system updates an internal table noting the last time it was accessed. Used for tools like find. Most people don't ever use this data themselves directly.
If you have a partition for a mail share, would this help it too (like it does for a news server)?
It should, though there are some apps that don't behave properly without atime being updated. I don't recall any off the top of my head but recall discussions over the years where people have mentioned some. Maybe they are mostly fixed now, I'm sure a google search will turn up results.
This looks informative: http://kerneltrap.org/node/14148
nate
Robert Moskowitz wrote:
I'm sure there are other things as well but first thing comes to mind is disabling atime for your file systems, to test the change you can do this
(for each of the mount points) mount <mount point> -o remount,noatime
Everything is quite on the notebook front. Now.
But What is going on here?
It's an old Ext2/3 feature that updates the atime information every time a file is accessed, even when the file is just being read from, not written to, thereby transforming even read-only disk operations to read-write. It's useless in pretty much every situation, except if you need to do disk forensics (there's a break in and you need to figure out everything that the attacker did to your system).
There were talks on LKML a while ago to change the default from atime to noatime. I don't know what was the result of that.
Bottom line: disable atime on all systems unless you _really_ need to do disk forensics. You will see a performance improvement in almost every scenario.
Anne Wilson wrote:
On Tuesday 08 July 2008 00:51:59 Florin Andrei wrote:
Bottom line: disable atime on all systems unless you _really_ need to do disk forensics. You will see a performance improvement in almost every scenario.
I'd like to try this on this laptop. How do you do it?
Put noatime in the options bit on the fstab and that should do the trick. For details, see "man 8 mount". You can have noatime, nodiratime (I am not sue if this is covered with the first option, really).
The "defaults" key word usually maps to: rw, suid, dev,exec,auto,nouser,async
On top of that atime is also is used as a default.
Once you remount your partition, mount should report like: /dev/sda1 on /data8 type ext3 (rw,noatime)
Works here. :)
On Tuesday 08 July 2008 11:12:53 Hakan Koseoglu wrote:
Anne Wilson wrote:
On Tuesday 08 July 2008 00:51:59 Florin Andrei wrote:
Bottom line: disable atime on all systems unless you _really_ need to do disk forensics. You will see a performance improvement in almost every scenario.
I'd like to try this on this laptop. How do you do it?
Put noatime in the options bit on the fstab and that should do the trick. For details, see "man 8 mount". You can have noatime, nodiratime (I am not sue if this is covered with the first option, really).
The "defaults" key word usually maps to: rw, suid, dev,exec,auto,nouser,async
On top of that atime is also is used as a default.
Once you remount your partition, mount should report like: /dev/sda1 on /data8 type ext3 (rw,noatime)
Works here. :)
So I need to do this for local mounts, or for all mounts? I have /, home, two windows partitions and some nfs mounts.
The reason I want to try it is that the laptop appears to be running much hotter under KDE4 than it did under KDE3, so I want to test whether over-frequent updates is the reason or not. For instance, if I minimise this message then maximise it again, the fan will start. Obviously, if there was a problem with the temp mounting I would take it out again.
Anne
Anne Wilson wrote:
The reason I want to try it is that the laptop appears to be running much hotter under KDE4 than it did under KDE3, so I want to test whether over-frequent updates is the reason or not. For instance, if I minimise this message then maximise it again, the fan will start. Obviously, if there was a problem with the temp mounting I would take it out again.
Does CentOS have a "laptop mode"? I'm only using this OS on servers, so I never tried laptop optimizations.
Ubuntu does, and it seems to help keep the machine more quiet and cool. I also mount local partitions "noatime", don't use 3D screensavers and don't enable the Compiz 3D desktop effects. That crap is a distraction anyway. Oh, and I also enable CPU frequency scaling. I'm using Gnome, but these optimisations shouldn't depend on the desktop environment. Maybe KDE enables some graphic effects of its own, I don't know.
On Tuesday 08 July 2008 19:29:06 Florin Andrei wrote:
Anne Wilson wrote:
The reason I want to try it is that the laptop appears to be running much hotter under KDE4 than it did under KDE3, so I want to test whether over-frequent updates is the reason or not. For instance, if I minimise this message then maximise it again, the fan will start. Obviously, if there was a problem with the temp mounting I would take it out again.
Does CentOS have a "laptop mode"? I'm only using this OS on servers, so I never tried laptop optimizations.
Ubuntu does, and it seems to help keep the machine more quiet and cool. I also mount local partitions "noatime", don't use 3D screensavers and don't enable the Compiz 3D desktop effects. That crap is a distraction anyway. Oh, and I also enable CPU frequency scaling. I'm using Gnome, but these optimisations shouldn't depend on the desktop environment. Maybe KDE enables some graphic effects of its own, I don't know.
The laptop doesn't run CentOS - my server does, but the laptop has Mandriva. The local partitions are mounted 'noaatime', and, like you, I don't enable an 3D stuff. Desktop effects are not enabled, and CPU frequency scaling is enabled.
I've been told that KDE 4.1 is better on this score, so maybe it's a bit like when Fedora take the debugging code out as they get close to release.
Anne
On Tuesday 08 July 2008 11:12:53 Hakan Koseoglu wrote:
Anne Wilson wrote:
On Tuesday 08 July 2008 00:51:59 Florin Andrei wrote:
Bottom line: disable atime on all systems unless you _really_ need to do disk forensics. You will see a performance improvement in almost every scenario.
I'd like to try this on this laptop. How do you do it?
Put noatime in the options bit on the fstab and that should do the trick. For details, see "man 8 mount". You can have noatime, nodiratime (I am not sue if this is covered with the first option, really).
The "defaults" key word usually maps to: rw, suid, dev,exec,auto,nouser,async
On top of that atime is also is used as a default.
Once you remount your partition, mount should report like: /dev/sda1 on /data8 type ext3 (rw,noatime)
Works here. :)
Should have checked before asking. / and /home are already set noatime. It looks as though my problem is unrelated.
Anne
nate wrote:
Robert Moskowitz wrote:
I have a Centos installed on a Hitachi 2.5" drive that shuts off really quickly, it seems.
So every 30 sec, the drive makes the sound of an access activity. I have looked trying to find what might be being updated. Swap drive usage is 0 bytes. No activity in /var/log. What might it be and can I do anything to lessen the drive access (improve battery life)?
I'm sure there are other things as well but first thing comes to mind is disabling atime for your file systems, to test the change you can do this
(for each of the mount points) mount <mount point> -o remount,noatime
Oh, I only did this for the mounts in the LVM partition: / and /home
I forgot to do /boot which is a plain old ext3
Still things are quite. This itself is interesting if only ext3 mounts in LVM partitions not just plain ext3 partitions suffer from this.
OOPS, been 15 min, about, and I just heard the drive seek again. But 15 min I can live with; 30 sec was nerve-racking (on an otherwise silent system, no fan).
Robert Moskowitz wrote:
OOPS, been 15 min, about, and I just heard the drive seek again. But 15 min I can live with; 30 sec was nerve-racking (on an otherwise silent system, no fan).
This may be of help, haven't tried it myself: http://martin.hinner.info/mybook/spindown.php
Looks like you can get the system to log what causes the drive to spin up.
nate
On Mon, 2008-07-07 at 18:35 -0400, Robert Moskowitz wrote:
I have a Centos installed on a Hitachi 2.5" drive that shuts off really quickly, it seems.
So every 30 sec, the drive makes the sound of an access activity. I have looked trying to find what might be being updated. Swap drive usage is 0 bytes. No activity in /var/log. What might it be and can I do anything to lessen the drive access (improve battery life)?
---- don't use a journalled filesystem (ext3)
Craig
Craig White wrote:
On Mon, 2008-07-07 at 18:35 -0400, Robert Moskowitz wrote:
I have a Centos installed on a Hitachi 2.5" drive that shuts off really quickly, it seems.
So every 30 sec, the drive makes the sound of an access activity. I have looked trying to find what might be being updated. Swap drive usage is 0 bytes. No activity in /var/log. What might it be and can I do anything to lessen the drive access (improve battery life)?
don't use a journalled filesystem (ext3)
there is a bit to be said about that for a notebook. Particularly if you separate /home to its own partition. I mean why is /boot a ext3 partition in Centos install? Why not ext2. Perhaps / could be too. but would you want to put /var/log on a journalling partition? I guess there have been flames all over the place on these default decisions.
Robert Moskowitz wrote:
there is a bit to be said about that for a notebook. Particularly if you separate /home to its own partition. I mean why is /boot a ext3 partition in Centos install? Why not ext2. Perhaps / could be too. but would you want to put /var/log on a journalling partition? I guess there have been flames all over the place on these default decisions.
For most instances, the faster boot times with a journaled file system after an unclean shutdown is well worth most any downside to using ext3. I think the fsck code even for ext2 has been improved, before ext3 was available it was pretty painfully slow though even for small disks(e.g. 60GB).
/boot probably doesn't need to be ext3, as it's barely ever accessed after the system boots unless your installing a new kernel or something, but it doesn't hurt either(as it's hardly ever accessed).
Fortunately for ext3 users you can "convert" the file system to ext2 just by mounting it as ext2 instead of ext3(provided the journal is flushed out, which should be done when the file system is unmounted).
Though I really can't imagine why anyone would want to use a non journaled file system these days. Especially on a laptop where the chance of an unclean shutdown is much higher than that of a server, hate those fsck times..
nate
Craig White wrote:
don't use a journalled filesystem (ext3)
That's pretty extreme, it may not actually solve the original problem, and in case of a crash you may have "fun" with repairing inconsistent filesystems.