Silent Linux Filesystem

Silencing hard drives, optical drives and other storage devices

Moderators: NeilBlanchard, Ralf Hutter, sthayashi, Lawrence Lee

Post Reply
ojg
Friend of SPCR
Posts: 34
Joined: Thu Aug 07, 2003 8:08 pm
Location: Norway

Silent Linux Filesystem

Post by ojg » Thu Nov 27, 2003 5:51 pm

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!

fraz
Posts: 45
Joined: Sat Aug 16, 2003 9:52 pm
Location: Australia

Post by fraz » Thu Nov 27, 2003 6:30 pm

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.

ojg
Friend of SPCR
Posts: 34
Joined: Thu Aug 07, 2003 8:08 pm
Location: Norway

Post by ojg » Thu Nov 27, 2003 9:55 pm

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...

fraz
Posts: 45
Joined: Sat Aug 16, 2003 9:52 pm
Location: Australia

Post by fraz » Fri Nov 28, 2003 10:42 pm

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! :lol:. 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.

Trip
*Lifetime Patron*
Posts: 2928
Joined: Wed Sep 24, 2003 7:18 pm
Location: SC

Post by Trip » Fri Nov 28, 2003 10:55 pm

Does Win XP or the version coming out in like 2005 or so have this problem corrected?

fraz
Posts: 45
Joined: Sat Aug 16, 2003 9:52 pm
Location: Australia

Post by fraz » Fri Nov 28, 2003 11:04 pm

I don't know if XP has this problem. Since i haven't owned an XP computer, and don't plan to. :)

But it would be very easy to implement. Just don't flush the buffers when the disk is off!

ojg
Friend of SPCR
Posts: 34
Joined: Thu Aug 07, 2003 8:08 pm
Location: Norway

Post by ojg » Sun Dec 14, 2003 8:43 pm

I'm back again...

Finally got my drive converted to ext2 so that noflushd could work properly. I tried noflushd with xfs too, but it didn't work. With ext2 the drive is powered down all the time when I am not actively using the PC. Problem solved, thanks for a great tip!

fraz
Posts: 45
Joined: Sat Aug 16, 2003 9:52 pm
Location: Australia

Post by fraz » Sun Dec 14, 2003 9:00 pm

Glad i could help!

Thats how I got know these things!

ojg
Friend of SPCR
Posts: 34
Joined: Thu Aug 07, 2003 8:08 pm
Location: Norway

Post by ojg » Sun Dec 21, 2003 2:09 pm

Another update:

Noflushd seems to work fine with ext3 as well. So you can have your cake and eat it too!

Just don't use any of the fancy filesystems like XFS or ReiserFS.

Inexplicable
Posts: 226
Joined: Sat Sep 06, 2003 5:59 am
Location: Finland

Post by Inexplicable » Sun Dec 21, 2003 2:44 pm

ojg wrote:Noflushd seems to work fine with ext3 as well. So you can have your cake and eat it too!
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.

Post Reply