Thread (2 messages) 2 messages, 2 authors, 2010-12-16

Re: comparison with rival projects

From: Kent Overstreet <hidden>
Date: 2010-12-16 00:49:15

On 12/15/2010 04:46 PM, luvar-2S8i3W4CjuIzjkFyG6Beag@public.gmane.org wrote:
First of all, I would like to thanks for answers.

One more question and some reply in text.

After making ssd disc a cache for some partition, there is possibility to detach cache. What should I do to "erase" (trim) whole disk for another benchmarking? I think that "dd if=/dev/zero of=/dev/sdx" wouldnt be right command.
Yeah, one nifty thing is you can disable caching on a mounted, in use 
filesystem (and reenable it provided you invalidate the cache somehow).

Hdparm can send a trim, but it can't do the whole disk at once, you've 
got to script it. I wrote one awhile back, this is what I use:

#!/bin/bash

DEV=$1

if [ ! -b "$DEV" ]; then
         echo "Can't open $DEV"
         exit 1
fi

SECTORS=`hdparm -I "$DEV"|awk '/LBA48/ { print $5 }'`
OFFSET=0

echo "$DEV has $SECTORS sectors:"

while (($SECTORS)); do
         i=$(( $SECTORS > 65535 ? 65535 : $SECTORS ))

         echo "wiping $i sectors at offset $OFFSET"
         hdparm --please-destroy-my-drive \
		--trim-sector-ranges $OFFSET:$i $DEV

         SECTORS=$(($SECTORS - $i))
         OFFSET=$(($OFFSET + $i))
done
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help