LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-02-2008, 10:55 PM   #1
jcreigh
LQ Newbie
 
Registered: Dec 2008
Posts: 1

Rep: Reputation: 0
Can I use a solid state drive as a cache for a larger hard disk?


Hi all,

I'm interested in the idea of using a solid state drive to speed up my day-to-day computing, but I can't afford to use a solid state drive for all my data, and I don't want to have to manually pick and choose what goes on and what doesn't.

So I'm wondering if it's possible to get a smallish solid state drive (say, 32GB or 64GB) and use it transparently as a cache for a larger (eg, 500GB or so), cheaper traditional hard drive. I'm envisioning some sort of kernel driver that sets up a virtual block device based on the SSD and the hard disk. Writes would go though to the hard disk, but reads would check a cache that would be maintained on the SSD before hitting the hard disk. Cache misses would cause the least recently used block in the cache the be dropped and replaced with the block that was just read. Or something like that.

Does anybody know of anything that does this? Or have any pointers for where to look? I've googled around, but to no avail.

Thanks,

Jason
 
Old 12-02-2008, 11:28 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Writing to a solid state drive would be slower than on a real hard drive. Also, you want to limit the number of writes to a solid state drive so using one as a cache would reduce the lifetime of the drive. The distro's for the eeePC don't have a swap file and use RAM for cache to reduce the number of writes.

It would make sense to use a solid state drive for static system directories such as /bin, /sbin/, /lib, /sbin, /usr/sbin, etc. These directories are mounted so that only root can write to them, and are only written to when you install a package. According to the LFS, these directories can even be mounted static-shared. They make ideal candidates for a solid state drive with faster read times and no spin-up time.

A compromise might be to use unionfs and copy files with old create timestamps, and recent access times (that are frequently read), and copy them to the solid-state layer. This would create a read-cache for files on the hard drive that aren't written often.
http://www.linuxjournal.com/article/7714
You may need to install an -mm kernel or manually patch your kernel's source to add unionfs, but with the popularity of the eeePC and it's use in Knoppix, it may be included in the mainline kernel.
Some of the papers on the unionfs home page may describe something similar to what you described.

Last edited by jschiwal; 12-02-2008 at 11:31 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Best io-scheduler for Solid State Drive? brentleary Linux - Kernel 2 03-25-2009 01:33 AM
Solid State Drive Performance Inquiry rocket357 General 2 08-29-2008 05:20 AM
Larger Hard drive andy1974 Linux - Hardware 6 03-08-2008 02:23 PM
Migrating to larger hard drive SlowCoder Linux - General 7 05-20-2007 04:08 AM
Solid State Hard Drives fatman General 3 01-16-2007 07:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration