Quantcast
Channel: Pinguy OS Forum - All Forums
Viewing all articles
Browse latest Browse all 1646

How To Use a Fast SSD as a Cache Drive For a Slow Mechanical Drive

$
0
0
I was given a old 30G Kingston SSD. Due to how small it was I decided the best thing to do with it is use it as a SSD cache drive.

Using a SSD as a cache drive isn't something new but there aren't many options.

I decided to use Flashcache as this works with drives that already have data on them and seemed the simplest to set up.

To install run this:
Code:
sudo apt-get install dkms build-essential linux-headers-$(uname -r) git
git clone git://github.com/facebook/flashcache; cd flashcache
sudo make -f Makefile.dkms

I have two mechanical drives so decided to partition the SSD right down the middle and call each partitions fcache1 and fcache2.

Next setup mount points.

I already had my NTFS drives mounted as /windows and /dos so I use those as the mount points.

to create you own run.

Code:
sudo mkdir /windows
sudo mkdir /dos

For this next part you need to be extremely careful. If you have a way to backup the data on the drive. Back it up.

Don't mix up your SSD cache drive and Data drive.

This will get you up and running pretty fast, but I would read this so you can see all the options. This is set to 'writethrough'. This is the safest option but not the fastest.

Code:
sudo flashcache_create -p thru fcache1 /dev/SSD1 /dev/DATA-DRIVE1
sudo flashcache_create -p thru fcache2 /dev/SSD2 /dev/DATA-DRIVE2
sudo mount /dev/mapper/fcache1 /dos
sudo mount /dev/mapper/fcache2 /windows

SSD & DATA-DRIVE being where you put the ssd and data drive.

Examples:
Code:
flashcache_create -p thru fcache1 /dev/sdb1 /dev/sda5
flashcache_create -p thru fcache2 /dev/sdb2 /dev/sdc1

The only issue I have found is once you reboot you have to set everything back up.

To get around this I added the commands to rc.local.

Open rc.local as root:
Code:
sudo gedit /etc/rc.local

And paste in something like this (change to match yours)
Code:
flashcache_create -p thru fcache1 /dev/SSD1 /dev/DATA-DRIVE1
flashcache_create -p thru fcache2 /dev/SSD2 /dev/DATA-DRIVE2
mount /dev/mapper/fcache1 /'MOUNT_POINT'
mount /dev/mapper/fcache2 /'MOUNT_POINT'

Save than reboot.

Viewing all articles
Browse latest Browse all 1646

Trending Articles