Page 1 of 1

Hard drive accessed every couple of seconds?

Posted: Sat May 03, 2008 10:45 pm
by exploder
I just purchased this computer.

http://www.bestbuy.com/site/olspage.jsp ... 3815923428

I installed Daryna and all of the hardware was detected and is working fine. I have noticed that the Hard Drive light flashes every two seconds when the computer is idle.

Is this normal? I need to make this machine last. Help me out here.

Re: Hard drive accessed every couple of seconds?

Posted: Sun May 04, 2008 12:37 am
by Fred
exploder,

I don't know what your light is triggered by. Hopefully the drive is spinning all the time and is not trying to spin down in that short a period of time.

The ext3 file system re-syncs the journal every 2 - 5 seconds, depending on the distro. I don't know what it is on Mint 4. I don't remember what the command is right off hand to change that but you can Google ext3 and find it pretty easy. I wouldn't set this time over 1 min. if it were me. I usually set mine at 30 seconds for a desk top.

Fred

EDIT: I looks like I misspoke above. Changing that time is a compile time option in the kernel. I was mis remembering from Gentoo. You can turn the sync flush to disk off. but then you have to sync it manually, say from a corntab, or you lose the advantage of having a journal. The time between re-syncs is the time you will loose your working data.

Re: Hard drive accessed every couple of seconds?

Posted: Sun May 04, 2008 6:16 am
by Fred
There are actually two issues here.

One is the spin up, spin down timing etc. This is the power saving approch used in lap tops.

The other is the ext3 journal syncing issue.

Data flushing to disk shouldn't be an issue on a inactive desk top. Once done an inactive desk top could go for hours and not need to access the disk except for the auto timed journal re-sync check.

Fred

Re: Hard drive accessed every couple of seconds?

Posted: Sun May 04, 2008 8:49 am
by Fred
exploder,

A couple more things. I do not recommend that you use any of the power saving options that allow spin down on a desk top. Desk top hard drives are not rated for lots of power cycles like laptop drives are. Compared to hours of operation, spin up cycles are quite limited as far a MTBF is concerned.

I am not sure if using journal data writeback mode on ext3 instead of the default ordered mode turns off the 5 sec. sync or not. If it does, you might be interested in using it just for hard drive life. It is also faster, but not as safe, data recovery wise. There is a link below that shows you how to set it up. It might be worth a try just to see if it stops the sync access you seem to be seeing with the light.

http://ubuntuforums.org/showthread.php?t=107856

Fred

Re: Hard drive accessed every couple of seconds?

Posted: Sun May 04, 2008 9:23 am
by exploder
I appreciate the replies and the information but I still don't understand this?

I have never seen this happen before, the hard drive LED flashes on and off constantly every 2 seconds. The drive is quiet but then it really never makes any noise.
The other is the ext3 journal syncing issue.
This seems to make sense but will this cause the drive to eventually fail?

Re: Hard drive accessed every couple of seconds?

Posted: Sun May 04, 2008 9:40 am
by Fred
exploder,

The 5 sec. ext3 journal syncing in ordered mode is the default mode of operation on version 2 of the ext3 file system. I wouldn't think it would cause pre-mature disk failure on Mint any more than using ext3 on any other Linux distro.

It just means more disk reads than you would have with a non-journaled file system in a given period of time. With an inactive system you wouldn't be writing out to disk that often, just reading. Reading is the least damaging operation for a hard drive. I have never seen anything that would indicate that journaled file systems wear out drives faster, but I don't know that to be true or false.

I suspect the light on the box must be triggered by any drive activity. Looks sexy to the user, means next to nothing.

If it bothers you, you can try what I suggested above.

Fred

Re: Hard drive accessed every couple of seconds?

Posted: Sun May 04, 2008 9:50 am
by exploder
Thanks Fred! Sounds like there is nothing to worry about.

Re: Hard drive accessed every couple of seconds?

Posted: Sun May 04, 2008 9:53 am
by Fred
Cambo105,

Your light is probably flashing at the beginning of each sync cycle. exploder is probably seeing the beginning and the end of the cycle. On a laptop the power save mode may have set the sync cycle to 10 sec. too.

But I am just guessing on the above. If your disk drive is trying to spin up and down that often it will wear out pretty fast. I am assuming that isn't what is happening.

Fred

Re: Hard drive accessed every couple of seconds?

Posted: Sun May 04, 2008 10:27 am
by exploder
If I run dmesg | grep kjournald , here is the output I get.

[ 33.315086] kjournald starting. Commit interval 5 seconds

I never noticed this behaviour on the old pc.

Re: Hard drive accessed every couple of seconds?

Posted: Sun May 04, 2008 4:07 pm
by Husse
@ cambo105
The solution (if needed) is in this topic a bit up
http://www.linuxmint.com/forum/viewtopi ... 124#p74539
@ exploder
I also get the drive led flashing but less often and not as regular as you do
There was Vista originally on that box (?) you could check if it is different in Vista
That said I remember I've seen computers where the drive led flashes regularly like another lighthouse beacon :) - but no noise which means that the hdd does not do anything. Spinning up/down would be clearly audible and if you listen carefully you should hear the actuator "clicking"

Re: Hard drive accessed every couple of seconds?

Posted: Sun May 04, 2008 4:22 pm
by Fred
If we rule out the spin up down issue for the moment, I think the flashing light thing is related to exactly what is triggering it on the various boxes.

Journal syncing is something that must happen or the journal is worthless. Like I said, the default time is 5 sec. I know this can be set at kernel compile time and I am thinking there may be a way to modify it from the command line but I haven't been able to find it in my notes. So I may be misremembering.

Fred

Re: Hard drive accessed every couple of seconds?

Posted: Sun May 04, 2008 4:24 pm
by Fred
Cambo105,

The above post was not directed at you. Husse's post applies to you if you are having spin up down issues.

Fred

Re: Hard drive accessed every couple of seconds?

Posted: Mon May 05, 2008 8:36 pm
by Fred
Cambo105,

This is a contentious and complex issue. I have posted at least a couple of times on this. If you are interested in my opinion you can search the forum. They are there somewhere.

The short answer is that there is no short, correct answer. This is a problem with the physics of hard drives. It really became a problem when we decided to stuff hard drives into a carry around computer. Hard drives are delicate mechanical devices that are subject to damage at relatively low G forces. Various schemes are used to try to limit their exposure to vibration and still allow them to work. One of those is to park and lock the read/write head as much as possible.

All applications, OSs or whatever, have the same problems trying to hit a happy medium between turned off, locked down, and zero power consumption; and running all the time, head unlocked and ready, and full power consumption. There is not a "right" setting. There is your settings, my settings, Ubuntu's settings, Windows' settings, etc. Depending on your usage patterns and the environment you have your computer in, the settings best for you might be different from the ones best for me. The distro developers set this up to try to maximize usability and durability for the largest group of users. It is nothing more than an educated guess on their part.

Windows has the same problem to deal with. Did they make better compromises? I don't know. For some probably so, for others probably not. This is not an issue with Windows because there is no choice, you take what they give you, it isn't user adjustable. Do hard drives fail early under Windows? Most definitely. Though I would say that Windows probably has the edge because hard drive manufactures build their drives mainly for the Windows market. It stands to reason that they would on average last longer under Windows. But that is pure speculation on my part.

If you feel like you have the knowledge to set up your drive duty cycle better then the distro developer set it, then by all means adjust away. If not then I would leave it alone.

If you want to extend your laptop hard drive life, and are willing to give up the advantages of a journaled file system, then use the ext2 file system. It requires a lot less interaction with the hard drive.

I would end by saying that if you get two to three years of operational service from a laptop hard drive, you have done ok. Laptop drives just live too rough a life to last like a desktop drive would.

Fred

Re: Hard drive accessed every couple of seconds?

Posted: Mon May 05, 2008 10:20 pm
by Fred
Cambo105,

I honestly don't know what default setting Ubuntu uses. 128 sounds like it would be in the ball park, but I am sure someone else will chime in and tell us the correct default setting.

Fred

Re: Hard drive accessed every couple of seconds?

Posted: Tue May 06, 2008 6:10 am
by Fred
There you go. I knew Ed would come to the rescue. :-)

Fred

Re: Hard drive accessed every couple of seconds?

Posted: Tue May 06, 2008 8:29 am
by Fred
Hey guys and gals, I did confirm that ext3 writeback mode does disable the journal sync. This greatly reduces the I/O activity with the hard drive and is faster than the ordered mode.

If I had a laptop, I would use the ext3 writeback mode. This should greatly reduce the spin up down cycles for a given duty cycle setting.

What you would give up for this advantage is that the journal would only be updated by the normal flush to disk fetch operations. If you had a power failure, as an example, you would loose whatever data had not been flushed to disk since the last normal, on demand cycle. With ordered mode, which is the default, you would at most loose the last five seconds. It is a trade off that I would gladly do on a laptop. After all, how often do you have a power failure on a laptop.

If you are interested, the instructions for changing the mode are in one of my earlier posts.

Fred