SSD cache to minimize HDD spin-up time?

Thats not really how or why caching works - caching is meant to take advantage of the faster speed and better random access of the SSD or other memory, rather than minimising writes to the hdd. Caching is designed to maximise speed, not reduce write, by having a smaller, faster buffer backing a large, slow storage device.

In fact, bcache, which is part of the mainline linux kernel, will simply pass on sequential writes to the hdd, rather than passing it through the SSD since there's no performance advantage.

ZIL/L2Arc uses the SSD to store logs (in the case of ZIL) and commonly used file clusters (with L2Arc). ZIL speeds up synchronous writes by storing them till they're all ready to be written. L2Arc stores commonly accessed files on faster storage. Neither of these will let you do what you need.

Fusion drive also uses a SSD and a HDD transparently putting commonly used files on the SSD for faster reads, and HDDs for bulk storage of less often used files. It too doesn't let you use the SSD as scratch space, and back up files to the main drive every so often

What you're looking at isn't caching at all, but rather periodic backups of the system to the HDD. I'm guessing ou might be able to fudge something together with Aufs -the first branch on the HDD with larger files (so it takes precidence), and a branch on the SSD, then run a script that moves files from the SSD to the HDD periodically, while having it accessable from the same location. I've not tested this out yet, but unlike caching, periodically moving files and using aufs will likely be exactly what you want.

The simplest way to sort files by age is ls -tr - t sorts by time (newest to oldest) and r reverses the order. (If you have a specific range in mind find . -mtime n works great n as a specific number gives you files modified n days ago, -n gives you files modified in the last n days and + n gives you files modified n days ago). You can find some ideas on how to use it here

Since quietness is your real goal, you can check if your drive supports silent mode with hdparm -M /dev/sda - this should output something like acoustic = 254 (128=quiet ... 254=fast), in which case you can make your hard drive quieter with the command hdparm -M 128 /dev/sda. Run the opposite command hdparm -M 1254 /dev/sda when you need more speed.


Since the other answers have treated the problem from the software point of view, I thought to include some information about hardware solutions.

The article Sound Proof your Hard Drive lists the following options:

  • Defragment your hard drive
  • Wrap hard drive in rubber bands to dampen vibrations
  • Go for a new hard drive: Most hard drives of present day are equipped with fluid dynamic bearings, which allow the platters to remain almost silent even when spinning at a very high rate.

I can testify from my own experience that I can never hear my new 4 TB hard disk, even when copying very large files.

With some research, one can also find acoustic dampening materials for hard disk such as the SilentDrive HD Enclosure & Acoustic Materials or the NoiseMagic NoVibes III Silent Hard Drive Mounting System. I don't know where these are sold, and the rubber bands above seem to me almost as efficient.

One can also sound-proof the entire computer. Some example websites that sell sound proofing materials are Quiet PC USA, AcousticPC or Dynamat, but there are many such.

Some computer cases are already designed for silent operation. See for example
Six Low-Noise, Performance-Oriented Cases, Tested.

As a last remark, a noisy hard drive that clunks, clicks, or screeches may be a sign that your hard drive is beginning to fail, so take care.


Several variations of Puppy Linux are based on Ubuntu but using Aufs.

Puppy runs entirely from RAM, there are no HDD accesses in normal operation.

If you tell Puppy that your HDD is a flash drive, it will dump the RAM filesystem to disk periodically instead of continuously. This was designed to reduce the wear of frequent writes to flashdrives but works fine on HDDs too.

As with just about everything in Puppy, you can use a GUI to set how often you want the RAM filesystem saved. Typically, this will be every 10mins or so but there's nothing to prevent setting it to dump every 720mins (12 hours) for example.

Puppy Linux Event Manager

This excerpt from my Grub4DOS bootloader menu.lst file shows the setting for the pmedia kernel option that says it is using flashdrive instead of an HDD...

# menu.lst produced by grub4dosconfig-v1.7.1
#
# 'kernel ... pmedia=ideflash'
#     Treat the HDD as a flashdrive: infrequent writes of filesystem to savefile

title Puppy Lupu 5.2.8 (sda3/puppy528lu) Cached\nUse SWAP; changes to RAM; flush to disk every 10min (fastest)
  find --set-root --ignore-floppies --ignore-cd /puppy528lu/initrd.gz
  kernel /puppy528lu/vmlinuz   psubdir=puppy528lu pmedia=ideflash pfix=copy,fsck
  initrd /puppy528lu/initrd.gz

A note about Puppy Linux "variations"...
I'm using Puppy Linux 5.2.8 "Lupu" which is based on (built by paring down) Ubuntu 10.04 Lucid Lynx. This version is also often called "Lucid" instead of "Lupu" due to its origins. There are also versions based on Slackware and some other distributions. Since you are already using Xubuntu, Puppy Linux Lupu would be the most familiar. It would also be much faster. I used Xubuntu for about a year before finding Puppy.

There is also a much newer version based on "Ubuntu Precise Pangolin" called "Puppy Linux Precise." There are major changes to the kernel used in the newer version that may not work well with older hardware. If your machine is less than 5yo, you might be happier with Precise. I believe the technique described above will still work on Precise though the exact options, etc. may be different but am unable to test it.