Silent Linux Filesystem
Moderators: NeilBlanchard, Ralf Hutter, sthayashi, Lawrence Lee
Silent Linux Filesystem
Hi! I hope the topic grabbed your attention, because my question might sound weird to most people but should make sense on this forum.
The issue is this: I am making a Linux based HTPC and I want the harddrive to spin down when it is not being used, so I use hdparm to set the spindown-time. But some filesystems causes the harddrive to wake up more often than it needs to. So far I have tried ext3 which accessed the drive every 10 minutes or so. Then I tried XFS which was even worse!
So now I am asking you what kind of filesystem I should use to make sure the drive shuts up!
Thanks!
The issue is this: I am making a Linux based HTPC and I want the harddrive to spin down when it is not being used, so I use hdparm to set the spindown-time. But some filesystems causes the harddrive to wake up more often than it needs to. So far I have tried ext3 which accessed the drive every 10 minutes or so. Then I tried XFS which was even worse!
So now I am asking you what kind of filesystem I should use to make sure the drive shuts up!
Thanks!
You'll want to use ext2 which is the traditional non-journaled linux filesystem, and noflushd which is a daemon to power off hard drives when the has not been a read for X minutes.
The best thing about this linux implementation is that unlike MS Windows disk writes are stored in memory until the disk is woken up by a read which cannot be covered by memory disk cache. Make silent computers much more of a reality. Now you just need enough memory spare for linux caches and buffers. 100Meg as listed by free should be heaps.
Don't bother messing with hdparm for this kind of stuff. Otherwise you'll be heading down the same (unsatisfactory) route windows uses for sleeping hard drives. And don't try and use a journaled filesystem such as ext3. They prevent the data sitting in buffers which is what you want for the hardrive to stay off. Doesn't work with noflushd.
Your next problem is to look at anacron and cron to make sure your maintainance processes such as log rotate etc. All run in the same half hour or so of the day because they will wake up the drive. And also check for things like exim which run every 15 minutes and will wake the disk.
GOod luck, its worth it.
The best thing about this linux implementation is that unlike MS Windows disk writes are stored in memory until the disk is woken up by a read which cannot be covered by memory disk cache. Make silent computers much more of a reality. Now you just need enough memory spare for linux caches and buffers. 100Meg as listed by free should be heaps.
Don't bother messing with hdparm for this kind of stuff. Otherwise you'll be heading down the same (unsatisfactory) route windows uses for sleeping hard drives. And don't try and use a journaled filesystem such as ext3. They prevent the data sitting in buffers which is what you want for the hardrive to stay off. Doesn't work with noflushd.
Your next problem is to look at anacron and cron to make sure your maintainance processes such as log rotate etc. All run in the same half hour or so of the day because they will wake up the drive. And also check for things like exim which run every 15 minutes and will wake the disk.
GOod luck, its worth it.
Thanks for your tip about noflushd, I will look into it and report back what I find. My first worry though is that this method is not power-safe, right? It becomes absolutely crucial to do a safe shutdown or else data will be lost.
Cron was the first thing I took care of, it only runs once a day now. Now I found out that samba server was waking up every 10 minutes reading the disk so I disabled it. Now the disk only wakes up every hour on the half-hour! Strange! And I did a 'ls -Rlt | grep ...' and none of the atimes had changed! Weird...
Cron was the first thing I took care of, it only runs once a day now. Now I found out that samba server was waking up every 10 minutes reading the disk so I disabled it. Now the disk only wakes up every hour on the half-hour! Strange! And I did a 'ls -Rlt | grep ...' and none of the atimes had changed! Weird...
Mine only wakes up once a day for the cron jobs at around noon. So it sounds like there something still not quite working right.
I still think you should just leave hdparm alone and use noflushd. You will get much longer periods without HD spinup.
However, as you noted, if you loose power and have unsaved data in the buffers, it's gone. If you have the money an UPS is a nice idea. My system is a laptop, so that isn't a problem. So far I haven't experienced anything worse than the usual fsck when i pulled the battery out thinking the computer was off (damn silence, i'll have to make it noiser! . No corruption but nothing that was "saved" when the disk was off was there. Just make sure you do clean shutdowns.
The other advantage of noflushd is you can have have two (or more) disk timeouts. Mine are 33 minutes for general use, and 7 minutes for long battery time and silent web browsing etc. You switch between them with
/usr/bin/killall -s HUP noflushd
say, from a menu or taskbar button.
Noflushd and quietness was actually among one of the reasons I left windows 2000 for linux. Could never get windows to leave the damn disk alone.
I still think you should just leave hdparm alone and use noflushd. You will get much longer periods without HD spinup.
However, as you noted, if you loose power and have unsaved data in the buffers, it's gone. If you have the money an UPS is a nice idea. My system is a laptop, so that isn't a problem. So far I haven't experienced anything worse than the usual fsck when i pulled the battery out thinking the computer was off (damn silence, i'll have to make it noiser! . No corruption but nothing that was "saved" when the disk was off was there. Just make sure you do clean shutdowns.
The other advantage of noflushd is you can have have two (or more) disk timeouts. Mine are 33 minutes for general use, and 7 minutes for long battery time and silent web browsing etc. You switch between them with
/usr/bin/killall -s HUP noflushd
say, from a menu or taskbar button.
Noflushd and quietness was actually among one of the reasons I left windows 2000 for linux. Could never get windows to leave the damn disk alone.
-
- Posts: 226
- Joined: Sat Sep 06, 2003 5:59 am
- Location: Finland
I wouldn't count on the cake tasting very fresh, though. The whole point of having a journaling filesystem is that it can recover your data (almost) upto the point of system failure. If nothing gets written on the harddrive, nothing gets recovered. Might as well use ext2.ojg wrote:Noflushd seems to work fine with ext3 as well. So you can have your cake and eat it too!