Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

How to calm a "noisey" hard drive

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
extraketchup
n00b
n00b
User avatar
Posts: 29
Joined: Mon Jun 21, 2004 1:07 pm
Location: Maine
Contact:
Contact extraketchup
Website

How to calm a "noisey" hard drive

  • Quote

Post by extraketchup » Sun Jul 01, 2007 3:10 pm

Howdy folks,

I've been on a personal quest for a while now to quiet down my noisy hard drive on my laptop. I've detailed this process on my blog at http://extra-ketchup.blogspot.com/2007/ ... drive.html . My goal was to reduce the almost constant "chatter" and "chirping" from what seemed excessive drive head movement even during simple things like surfing the web. While power consumption is part of my concern, my main worry is drive life, as my previous laptop (which also had Gentoo and ran mostly using KDE as my environment) died due to hard drive failure.

Check my blog for details and insights, but here's the quick summary of what I did to quiet down my hard drive so that it very rarely spins up for normal use such as browsing the web:
  • II copied my /usr directory to a fast SD card (my Dell laptop has a built-in card reader) and mounted it read only.
  • I changed various file system settings to reduce writes back to the hard drive - noatime, nodiratime, and commit=3600 as part of my fstab options (I'm currently using ext3, though these options should work on other filesystems)
  • In similar fashion, I adjusted various /proc/sys/vm settings to reducing writes due to dirty pages. NOTE - I actually found that laptop mode made my drive MORE noisy, not less! I think this is because of the demand of KDE on the filesystem, but I turned off laptop mode and my drive is silent now.
  • I set up my init scripts (which are my own to begin with) to copy busy subdirectories of ~/ to my /tmp directory (which is mounted tmpfs) and then mount --bind those directories back to my home directory. This means that while I am browsing, any cache hits or updates, cookies, favicons, history, etc. is saved to a tmpfs (which is in RAM) which is fast and requires no hard drive spinup. KDE is constantly updating it's .kde directory, for example - even moving a window causes an update of the coordinates to be written to a config file! When I shut down, all the updates are copied from RAM (tmpfs) back to the hard drive.
Well, that's basically it. Visit the link about for the details of why this works and some of the caveats of using this system. Overall, not only is my hard drive quiet, but my system is faster and uses less power! I also have the peace of mind that my drive should last longer.

- Mike
There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.
Top
xalan
Apprentice
Apprentice
Posts: 190
Joined: Tue Feb 01, 2005 6:36 pm

  • Quote

Post by xalan » Sun Jul 01, 2007 4:14 pm

Hey Mike,

Thanks for sharing your experiences. I am going through your blog and learnt some new things.

-x
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

  • Quote

Post by PaulBredbury » Sun Jul 01, 2007 4:31 pm

Also try:

Code: Select all

 -M     Get/set Automatic Acoustic Management (AAM) setting.
From man hdparm
Top
xalan
Apprentice
Apprentice
Posts: 190
Joined: Tue Feb 01, 2005 6:36 pm

  • Quote

Post by xalan » Sun Jul 01, 2007 5:10 pm

Mike:

Which KDE process generated lots of disk activity. On my box most of disk activity was by pdflush and filesystem journalling daemon kjournald.

-x
Top
extraketchup
n00b
n00b
User avatar
Posts: 29
Joined: Mon Jun 21, 2004 1:07 pm
Location: Maine
Contact:
Contact extraketchup
Website

KDE and hard drive activity

  • Quote

Post by extraketchup » Sun Jul 01, 2007 5:22 pm

xalan wrote:Mike:

Which KDE process generated lots of disk activity. On my box most of disk activity was by pdflush and filesystem journalling daemon kjournald.

-x
What I noticed is that every time I opened a menu that I hadn't opened before (and thus not in the system cache), the drive was accessed. From what I can tell, KDE waits until you go to a menu or other setting before loading the icons, fonts, etc. that it needs. So just walking down the menus will stir up the drive a bit. It's not brutal thrashing, but if I do want my drive to spin down for a while, it's an issue.

Also, web browsing generates plenty of drive read/writes since history, cache, favicons, and cookies are all recorded each time a new web page is visited. I can spend serious time surfing the web, during which I'd like the hard drive to be able to rest. That's why I copy .kde (and .mozilla for Firefox) to my tmpfs /tmp directory in RAM.

Even moving or resizing a window causes a drive write because KDE records the locations and sizes of windows of various apps so that when you close then reopen that app, it appears where it was last. I'm pretty sure this feature can be turned off in the control center, but I actually like the feature. I prefer to store all this info in my tmpfs RAM (since I may move windows quite a bit depending on what I'm doing), and then copy the final state of things when I shut down the computer back to the hard drive. If my system crashes, I only lose little changes like recent cookies and window positions since .kde is COPIED to /tmp (and back again) for each session.

So, I'd say the two things that make KDE play very nice with the hard drive is the /usr directory on Flash RAM, since KDE consists of many small files (icons, libraries, fonts, etc.) that are randomly accessed throughout using various apps, and also copying my .kde directory (which holds my personal config files, cookies, etc.) to /tmp. I also make sure that kdecache-me is a real directory, not a symlink to /var/tmp.

- Mike
There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.
Top
extraketchup
n00b
n00b
User avatar
Posts: 29
Joined: Mon Jun 21, 2004 1:07 pm
Location: Maine
Contact:
Contact extraketchup
Website

Re: Hi

  • Quote

Post by extraketchup » Sun Jul 01, 2007 6:12 pm

veerakumar wrote:Your Hard Drive is failing.
Use smart daemon to see it.
Or use diagnostic programs which come or on the website of HDD manufacturers.
No, no - this is a brand new (Dell Linux) laptop. When I say "noisy", I purposefully quote that because I'm not talking about a dying drive, just one that is being forced to do many random seeks across the drive platter. HOWEVER, my OLD laptop failed, and the "chirping" that's regular for hard drives got louder and eventually turned to clunking and odd clicking. It started to stick, and I'd have to "burp" my laptop with a couple hard slaps on the bottom to lose the drive head. Hence my new Dell laptop.

Now I don't know if the busy-ness of that old drive had anything to do with it's eventual failure, but surely reducing the head seeks of my new drive can't hurt! Especially if it reduces power and also enhances performance (win-win-win).

As for SMART, it never said anything was wrong with my old drive, even when the head was stuck! Steve Gibson has lots to say about SMART, and what he says isn't very good..
There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.
Top
xalan
Apprentice
Apprentice
Posts: 190
Joined: Tue Feb 01, 2005 6:36 pm

Re: KDE and hard drive activity

  • Quote

Post by xalan » Sun Jul 01, 2007 7:44 pm

extraketchup wrote:
So, I'd say the two things that make KDE play very nice with the hard drive is the /usr directory on Flash RAM, since KDE consists of many small files (icons, libraries, fonts, etc.) that are randomly accessed throughout using various apps, and also copying my .kde directory (which holds my personal config files, cookies, etc.) to /tmp. I also make sure that kdecache-me is a real directory, not a symlink to /var/tmp.

- Mike
I agree with you regarding firefox issues lots of disk writes. But I have an issue with respect to mounting /usr on "Flash RAM". AFAIK flash memory has a finite write capability on the order of 1 million writes. I don't know if there is a similar limitation for reads. If there is then you will be reducing the life of your flash card very fast since /usr/lib is read very heavily but written rarely. If there is no limitation on reads then you are fine.
Top
micr0c0sm
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 148
Joined: Sat Oct 29, 2005 9:36 pm
Location: New York
Contact:
Contact micr0c0sm
Website

  • Quote

Post by micr0c0sm » Wed Jul 04, 2007 7:11 am

mind sharing your startup script for your busy ~/ directories and your fstab ? Good tips so far.
Top
extraketchup
n00b
n00b
User avatar
Posts: 29
Joined: Mon Jun 21, 2004 1:07 pm
Location: Maine
Contact:
Contact extraketchup
Website

"show us the code"

  • Quote

Post by extraketchup » Wed Jul 04, 2007 11:04 am

micr0c0sm wrote:mind sharing your startup script for your busy ~/ directories and your fstab ? Good tips so far.
interesting stuff from fstab (the tabbing doesn't copy over whell):

Code: Select all

/dev/sda1               /               ext3    noatime,async,noatime,nodiratime                1 0
/dev/sda3               none            swap            sw                      0 0
/dev/sda2               /var            ext3    noatime,async,noatime,nodiratime,data=writeback,commit=3600             0 0
/dev/sda4               /home           ext3    noatime,async,noatime,nodiratime,data=journal,commit=3600    0 0
/dev/mmcblk0p1          /usr    ext2    ro,auto,async   0  0
interesting stuff from lilo.conf (for / options):

Code: Select all

image=/boot/vmlinuz
        label=Linux
        read-only
        root=/dev/sda1
        append="rootflags=data=journal,commit=3600"
interesting stuff from my bootscript:

Code: Select all

# The following is to keep the drive quiet but quick
        # TODO - auto set these based on whether on battery or plugged in
        echo 0 > /proc/sys/vm/laptop_mode
        echo 60 > /proc/sys/vm/dirty_background_ratio
        echo 40 > /proc/sys/vm/dirty_ratio
        echo 50000 > /proc/sys/vm/dirty_expire_centisecs
        echo 50000 > /proc/sys/vm/dirty_writeback_centisecs
        echo 10 > /proc/sys/vm/swappiness
        /usr/sbin/acpid
        /sbin/hdparm hdparm -B 255 /dev/sda
        # use SD card "SURRaBoost"
        mount /usr
        # copy busy config directories to tmpfs and mount back
        cp -a /home/mjsurran/.kde3.5 /tmp
        cp -a /home/mjsurran/.mozilla /tmp
        touch /tmp/.xsession-errors
        mount --bind /tmp/.kde3.5 /home/mjsurran/.kde3.5
        mount --bind /tmp/.mozilla /home/mjsurran/.mozilla
note - I'm the only one who uses my laptop. If multiple people use a computer, then the tmpfs code could be modified and placed in the startkde script.
2nd note -

Code: Select all

/sbin/hdparm hdparm -B 255 /dev/sda
quiets down my drive in that the heads don't go back to "rest" every second. It also improved performance quite a bit. My bios must set my hard drive to a very aggressive self-powersavings mode. I'm working on ACPI scripts to set the drive back to that powersavings mode when on battery.
There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.
Top
Post Reply

9 posts • Page 1 of 1

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic