All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kent Overstreet <kent.overstreet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: luvar-2S8i3W4CjuIzjkFyG6Beag@public.gmane.org
Cc: Nauman Rafique <nauman-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	info-2S8i3W4CjuIzjkFyG6Beag@public.gmane.org
Subject: Re: comparison with rival projects
Date: Wed, 15 Dec 2010 16:49:15 -0800	[thread overview]
Message-ID: <4D09620B.7060405@gmail.com> (raw)
In-Reply-To: <1474160620.28501292460406484.JavaMail.root@shiva>

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

  reply	other threads:[~2010-12-16  0:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <824216649.28481292460292573.JavaMail.root@shiva>
2010-12-16  0:46 ` comparison with rival projects luvar-2S8i3W4CjuIzjkFyG6Beag
2010-12-16  0:49   ` Kent Overstreet [this message]
     [not found] <503688497.28381292455530354.JavaMail.root@shiva>
2010-12-15 23:26 ` luvar-2S8i3W4CjuIzjkFyG6Beag
2010-12-16  0:05   ` Kent Overstreet
     [not found]     ` <4D0957B4.6060801-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-12-16  0:18       ` Nauman Rafique
     [not found]         ` <AANLkTi=hos1PdNJeRfi8mOxN9whosK+6cEfBpkv38coK-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-16  0:45           ` Kent Overstreet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D09620B.7060405@gmail.com \
    --to=kent.overstreet-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=info-2S8i3W4CjuIzjkFyG6Beag@public.gmane.org \
    --cc=linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=luvar-2S8i3W4CjuIzjkFyG6Beag@public.gmane.org \
    --cc=nauman-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.