git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Josh Boyer" <jwboyer@gmail.com>
To: "Linus Torvalds" <torvalds@osdl.org>
Cc: "David Tweed" <tweed314@yahoo.co.uk>, git@vger.kernel.org
Subject: Re: using git on flash media
Date: Wed, 19 Apr 2006 19:44:34 -0500	[thread overview]
Message-ID: <625fc13d0604191744w1155a6c3hde184a9705669c4b@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0604191651110.3701@g5.osdl.org>

On 4/19/06, Linus Torvalds <torvalds@osdl.org> wrote:
>
>
> On Thu, 20 Apr 2006, David Tweed wrote:
> >
> > What I'm basically checking is that it doesn't, I dunno, rewrite files
> > so frequently that on a modern flash drive it would wear out the entire
> > drive unreasonably quickly.
>
> The largely write-once nature of git should mean that the only files that
> get rewritten a lot are
>  - the directories get rewritten to, since git creates new objects at a
>    reasonable pace
>  - the branch references get rewritten.
>
> In general, I'd say that git probably does less writing than most other
> SCM's are likely to do.
>
> That said, when you say "modern flash drive", I really suspect you
> shouldn't care deeply any more. Modern flash devices can be rewritten a
> lot more than old ones could (by an order of magnitude or more), and they
> almost always have wear levelling in hw, making it even less of an issue
> (but if they don't, your biggest issue will be that you should use a
> filesystem that does it for you).

Finding one that claims to have HW wear leveling is still hard, so you
can never really tell.

> That said, if you want to be safe, I think flash memory card vendors
> guarantee only up to 10,000 write cycles (and it used to be much less).
>
> That's _complete_ rewrites, though, which is more than just a single
> sector write. They tend to guarantee 100,000 single-sector re-writes (ie
> more like the "directory update" things when you create a new object).

When talking about flash, it's the erase cycles that are counted. 
Most NOR chips guarantee 100,000 erase cycles per eraseblock.  NAND
chips, which are what most flash drives use, can vary between 10,000 -
100,000 erases depending on the technology used.

> And assuming you'd count one commit as one "total rewrite" (which sounds
> unlikely - but it's certainly more than one sector - I don't know what
> they consider a total rewrite when they make up their numbers), that

A "total rewrite" is simply something that causes an eraseblock to be
erased.  That can vary alot, but it essentially boils down to needing
to write new data to a location in an eraseblock that has already been
written to.

> implies that to be really safe, you shouldn't do more than 10,000 commits
> before you replace your flash. Quite frankly, I suspect that's _way_ more
> conservative than you should be, but hey, since you asked..

To be really conservative, just don't do it ;).  Most flash drives
don't allow access to the raw flash chips, so while you can use
something like JFFS2 on them still, the benefits of that are somewhat
lost since you never really know what is going on underneath.

> One rule: NEVER mount your flash with the "sync" option, and use "noatime"
> to avoid unnecessary inode access time updates (that's especially true for

Right.

josh

      reply	other threads:[~2006-04-20  0:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-19 23:31 using git on flash media David Tweed
2006-04-20  0:23 ` Linus Torvalds
2006-04-20  0:44   ` Josh Boyer [this message]

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=625fc13d0604191744w1155a6c3hde184a9705669c4b@mail.gmail.com \
    --to=jwboyer@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=tweed314@yahoo.co.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).