(Minimizing HDD access) Disabling logging, caching most used commands?

Hello, I am very new to FreeBSD as well as to the general *NIX thing.

I like the idea of a silent PC. I am thinking of getting an SSD drive, but those are costly.
A normal HDD could be almost as silent as an SSD, if it was possible to disable all logging, and preload most commands into RAM.

Would this be possible, and would it be easy to do for a noob? I am reading the FreeBSD Handbook and trying to get into the whole thing, but it is going to take a while.

Also, to what extent can you preload programs into memory? I wouldn't mind dedicating some 500MB for preloading software (which could essentially hold all the programs I would ever use), since this kind of idle RAM consumption is what I am already accustomed to when working on Windows.

Even if preloading software is not feasible, and I decide to get an SSD, I would still like to know how to disable logging, since I want to prolong the peak performance of the SSD as long as possible.

Does disabling logging cause any problems? One thing I could imagine being affected is security, since you wouldn't be able to compare incoming network calls to previously occurred calls to spot some kind of an attack. Would this be a problem, or are the recent logs held in RAM?

Thanks.
 
Disabling logging on a server system is not recommended at all. And disabling it on a desktop system is really not worth it.
I guess you are talking about the latter, right? Well, today, on my desktop, the system has modified 7 log files 866KB big. In the past month, both logs and their backups account for 30 files and are 935KB big. Not so much, eh?

What you can do to decrease access is add a noatime option in /etc/fstab to frequently used partitions or all of them if you want.
 
  • Thanks
Reactions: ju
@ju

Mount /tmp in RAM (check tmpmfs option for /etc/rc.conf file), then symlink /var/tmp to /tmp dir.

Disable unneeded services (sendmail for example).
 
  • Thanks
Reactions: ju
It depends what you want to do with your system?

If you just need to mostly use a terminal then using tmpfs for /tmp and /var, and disabling some default crontabs will allow your hard drive to spin down for long periods. If you plan to run typical desktop apps like a browser, mail client, etc. things get much more complicated.
 
  • Thanks
Reactions: ju
Yeah, I am mostly using desktop apps like the browser, and also doing some coding and trying to get familiar with the non-desktop side.
 
You can get SSDs for less than $100 these days. Also might be able to use a USB flash drive? They also have SATA/IDE to Compact Flash interfaces available.

But like they said, you can mount /tmp and /var as temp (memory) file system.

I think the installer also uses a tmpfs for it's /usr directory (binaries). Might be able to do that, if not, just manually create one, copy them over your commonly used stuff there and put it first in your path.

Set noatime in /etc/fstab

Disable any unused daemons.

Probably check though cron/periodic and disable anything you don't need.

ATA Control can also be used to spin down disks: http://www.freebsd.org/cgi/man.cgi?query=atacontrol&sektion=8

Use lsof to track what files are being open. In fact, would probably setup a script to automatically dump the output for awhile.
 
  • Thanks
Reactions: ju
Back
Top