Re: [gentoo-user] disk accesses per subdirectory tree

2012-12-22 Thread Daniel Troeder
On 21.12.2012 14:42, Helmut Jarausch wrote:
> Hi,
> 
> I'd like to put some subdirectory trees (of / and of /usr and of /home)
> onto an SSD.
> For that I'd like to count the disk accesses which go to a given
> subdirectory tree
> in some given time intervall.
> 
> Is there any utility which can measure this?
> 
> Many thanks for a hint,
> Helmut.
> 
Just an idea: IMO it is not difficult to write a small program that uses
inotify to do that. Just register those paths with inotify and count. I
think there is also a inotify-using cron and a scriptable inotify
client a little search:

dev-haskell/hinotify
dev-perl/Linux-Inotify2
dev-python/inotifyx
dev-python/pyinotify
dev-ruby/rb-inotify
sys-fs/inotify-tools

The last one... just opened the homepage:
https://github.com/rvoicilas/inotify-tools/wiki and scrolled down to
"inotifywatch" - I think you'll be able to do it with that :)

Greetings,
Daniel

-- 
Get my PGP key at:
*
http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x837FB8B5BB9D4887
* $ gpg --recv-keys --keyserver keyserver.ubuntu.com 0xBB9D4887



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-user] disk accesses per subdirectory tree

2012-12-21 Thread Mark Knecht
On Fri, Dec 21, 2012 at 5:42 AM, Helmut Jarausch
 wrote:
> Hi,
>
> I'd like to put some subdirectory trees (of / and of /usr and of /home) onto
> an SSD.
> For that I'd like to count the disk accesses which go to a given
> subdirectory tree
> in some given time intervall.
>
> Is there any utility which can measure this?
>
> Many thanks for a hint,
> Helmut.
>

Hi Helmut,
   Only responding to say I'd been looking for something to do the
same thing myself and haven't found anything.

   That said, a couple of points:

1) You should be able to watch for issues using smartctl, assuming a
modern SSDs.

2) In a post where I asked about this sort of stuff in the Vertex
forums I received the following response from folks who seem to have
more experience than I. Of course, take this with a grain of salt:

[QUOTE]
Just using round numbers and assuming effective wear leveling, your 30
GB file may get rewritten once a month. That's 25% of the 128 GB
drive, so each NAND cell will get rewritten 3 times a year. If the
NAND is good for 10,000 rewrites, you have LOTS of years available...

Even if it's rewritten every day, that's 100 NAND rewrites/year, or
100 years of NAND life based on rewrites.

You can use any numbers you want, but it will still likely come out to
"longer than we care about"...
[/QUOTE]

   Keep in mind that the idea of 'effective wear leveling' is
___really___ important here. Unlike an HD, SSDs do not write over and
over to the same location forever. If a block of the drive starts to
get heavily used, in terms of number of writes, then firmware will
move the block to another location and remap the address. This happens
in the drive, not by the OS, so it's invisible to us. (First order
anyway - there are probably ways to find out but I'm not looking for
those.)

   Anyway, as there hadn't been any responses I thought I would...

Cheers,
Mark