Re: using git on flash media

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/19/06, Linus Torvalds <torvalds@xxxxxxxx> 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
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]