How do I minimize idle I/O on Linux to decrease noise?

How do I minimize idle I/O on Linux to decrease noise?

If I put Linux on my machine, what steps should I take so that it ONLY tries to access the hard drive when I physically work on it. i.e., the grinding sounds are annoying me when I try to fall asleep.

答案1

You can use iotop (preferably with a large interval and the -o option) to find out which program is writing to disk.

If you have enough RAM, you may also want to turn off swap with:

$ sudo swapoff -a

, or permanently by removing the swap line from /etc/fstab.

The typical culprits for I/O in the night are:

  • cron. This daemon allows one to schedule commands (like "update at 2am" or "clear sessions every 30 minutes"). Have a look at /etc/cron* and use crontab -e (there is one for each user) to find out what is being executed, and when, and remove the offending lines. Since most of the preconfigured cronjobs are indexing in some way, you can safely turn cron off if you don't depend on any action being scheduled.
  • logfiles Have a look at /var/log. If some file is constantly growing in there, consider reducing the program's log level. If you don't care about logs, turn them off in the programs and/or mount a memory filesystem at /var/log. You can find out which files change with what with $ sudo tail -f /var/log/*
  • On-disk temporary files. Usually, that means some process is writing to /tmp (you can find out with iotop). Consider mounting a memory-based filesystem (tmpfs) on there if you have enough RAM and the size of these files is limited.

You may also be interested in powertop, which shows which programs are waking up your CPU. If something unexpected is in there, consider filing a bug against the program.

On the hardware side, you can get a silent disk (an SSD has no movable parts, so it's a good candidate) or put the HDD to standby manually. hdparm (particularily the -C and -y options) is a good tool for that.

答案2

Get a Solid State Drive (SSD), they contain no moving parts. That is the only guarantee.

答案3

If you don't need your computer to compute anything, turn it off at night and you will save yourself quite a bit of power; not to mention you are then also eliminating the fan noise from lowering your sleep quality.

答案4

Monitor drive access, find out what is waking the drive up at night, stop it.

相关内容