Overblog Suivre ce blog
Editer l'article Administration Créer mon blog
5 mars 2014 3 05 /03 /mars /2014 08:15

 

As root:

 

Install flashcache and tools

<code>

sudo apt-get install flashcache-dkms flashcache-utils
</code>

 

Setup Parameters :

<code>

cat <<EOF>>/etc/sysctl.conf


###################################################################
# FlashCache
#
# disable writing dirty cache data at shutdown (do this only if you really trust FC)
# dev.flashcache.fast_remove = 1
#
# change the reclaim policy from FIFO to LRU" >>/etc/sysctl.conf
dev.flashcache.reclaim_policy = 1
#
# Writeback
# do not write "stale" data to disk until evicted due to lack of space
#dev.flashcache.fallow_delay = 0
#
EOF

</code>

 

Start module and install it asdefautl module

<code>

sudo modprobe flashcache

sudo echo "flashcache" >> /etc/modules

</code>

 

check:

<code>

~# dmesg | grep flashcache
[ 2042.003705] flashcache: flashcache-2.0 initialized

#

lsmod |grep flashcach
flashcache             82952  0

</code>

 

# Step 4 - montage volume simple DATA/Home

# Find the UUID of the volume you want to cache:

<code>
ls -la /dev/disk/by-uuid/
</code>
#### mount DATA Drive


<code>

sudo umount /home/yoyo/eMule
sudo flashcache_create -v -p back filecache_data /dev/sda3 /dev/disk/by-uuid/45e71c47-a88f-4493-8b1a-e5bfcf7562b0

vi /etc/fstab
# Comment out the line with the device you want to cache
# Add a new line for the flashcache similar this:

# /home/yoyo/eMule was on /dev/sda5 during installation
#UUID=45e71c47-a88f-4493-8b1a-e5bfcf7562b0 /home/yoyo/eMule     reiserfs defaults        0       2
/dev/mapper/filecache_data /home/yoyo/eMule     reiserfs defaults,noatime,notail        0       2

</code>

 

#Step 5 - check
<code>
~# sudo dmsetup status
filecache_data: 0 325122048 flashcache stats:
    reads(2775), writes(37)
    read hits(3), read hit percent(0)
    write hits(11) write hit percent(29)
    dirty write hits(0) dirty write hit percent(0)
    replacement(0), write replacement(0)
    write invalidates(0), read invalidates(0)
    pending enqueues(0), pending inval(0)
    metadata dirties(37), metadata cleans(0)
    metadata batch(3) metadata ssd writes(34)
    cleanings(0) fallow cleanings(0)
    no room(0) front merge(0) back merge(0)
    disk reads(2772), disk writes(0) ssd reads(3) ssd writes(2843)
    uncached reads(0), uncached writes(0), uncached IO requeue(0)
    uncached sequential reads(0), uncached sequential writes(0)
    pid_adds(0), pid_dels(0), pid_drops(0) pid_expiry(0)

~# sudo dmsetup table
filecache_data: 0 325122048 flashcache conf:
    ssd dev (/dev/sda3), disk dev (/dev/disk/by-uuid/45e71c47-a88f-4493-8b1a-e5bfcf7562b0) cache mode(WRITE_BACK)
    capacity(10854M), associativity(512), data block size(4K) metadata block size(4096b)
    skip sequential thresh(0K)
    total blocks(2778624), cached blocks(286), cache percent(0)
    dirty blocks(5), dirty percent(0)
    nr_queued(0)
Size Hist: 4096:7007
filecache_home: 0 131246080 flashcache conf:
    ssd dev (/dev/sda2), disk dev (/dev/disk/by-uuid/c85a514b-0a7d-4c4c-8af6-dcea99ed773c) cache mode(WRITE_BACK)
    capacity(8158M), associativity(512), data block size(4K) metadata block size(4096b)
    skip sequential thresh(0K)
    total blocks(2088448), cached blocks(6081), cache percent(0)
    dirty blocks(1231), dirty percent(0)
    nr_queued(0)
Size Hist: 4096:7007 </code>

Partager cet article

Repost 0
Published by nitocris - dans Linux
commenter cet article

commentaires