git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Recovering from repository corruption

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 10, 2008, 21:48 UTC
Message-ID
<alpine.LFD.1.10.0806101431410.3101@woody.linux-foundation.org>
In-Reply-To
<6dbd4d000806101422j39709906x1b4b03b82b504e62@mail.gmail.com>
On Tue, 10 Jun 2008, Denis Bueno wrote:
Show 11 quoted lines
> >
> > then *if* you have the files
> >
> >        .git/objects/32/0bd6e82267b71dd2ca7043ea3f61dbbca16109
> >        .git/objects/4d/0be2816d5eea5ae2b40990235e2225c1715927
> >
> > then those two files are interesting in themselves (most likely they are
> > not there at all, or are zero-sized, but if you have them, please post
> > them).
> 
> They are attached, and they are not zero-sized.
Very interesting.

Both of them look fairly sane as objects (ie random - it's supposed to eb zlib-compressed), but both of them have the first 512 bytes *identically* corrupted:

	0000000 6564 626e 6575 406e 6f64 6f72 6874 2e79
	          d   e   n   b   u   e   n   @   d   o   r   o   t   h   y   .
	0000020 6f6c 6163 2e6c 3634 0033 0000 0000 0000
	          l   o   c   a   l   .   4   6   3  \0  \0  \0  \0  \0  \0  \0
	0000040 0000 0000 0000 0000 0000 0000 0000 0000
	         \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
	*

ie it's an all-zero block, except for that email-looking thing at the head.

Sadly, I don't think there is any way to find the missing block that got overwritten. And quite frankly, there's no way to really know whether the rest was really fine either - it just looks more likely, but quite frankly, it could have been random old contents on your disk too that just happens to look like the expected random pattern (which you'll get with any compression format - compression by definition removes patterns).

One thign that strikes me is that you seem to be really prone to this problem, since it happened to you a year ago too. I cannot swear to this, but I literally suspect your last case (July-2007) was the previous time we had a corruption issue. Why does it seem to happen to you, but not others?

Do you have some odd filesystem in play? Was the current corruption in a similar environment as the old one? IOW, I'm trying to find a pattern here, to see if there might be something we can do about it..

But it *sounds* like the objects you lost were literally old ones, no? Ie the lost stuff wasn't something you had committed in the last five minutes or so? If so, then you really do seem to have a filesystem that corrupts *old* files when it crashes. That's fairly scary. What FS is it?

		Linus
Previous: Denis BuenoNext: Denis Bueno
Message 12 of 31 in “Recovering from repository corruption”
  1. Denis BuenoJun 10, 2008
  2. Jakub NarebskiJun 10, 2008
  3. Denis BuenoJun 10, 2008
  4. Jakub NarebskiJun 10, 2008
  5. Denis BuenoJun 10, 2008
  6. Jakub NarebskiJun 10, 2008
  7. Denis BuenoJun 10, 2008
  8. Linus TorvaldsJun 10, 2008
  9. Denis BuenoJun 10, 2008
  10. Linus TorvaldsJun 10, 2008
  11. Denis BuenoJun 10, 2008
  12. Linus TorvaldsJun 10, 2008
  13. Denis BuenoJun 10, 2008
  14. TarmiganJun 10, 2008
  15. Denis BuenoJun 10, 2008
  16. Linus TorvaldsJun 10, 2008
  17. Linus TorvaldsJun 10, 2008
  18. Nicolas PitreJun 11, 2008
  19. Linus TorvaldsJun 11, 2008
  20. Nicolas PitreJun 11, 2008
  21. Denis BuenoJun 10, 2008
  22. Junio C HamanoJun 10, 2008
  23. To graft or not to graft... (Re: Recovering from repository corruption)Stephen R. van den Berg, Jun 11, 2008
  24. Jakub NarebskiJun 11, 2008
  25. Linus TorvaldsJun 11, 2008
  26. Johan HerlandJun 12, 2008
  27. Jeff KingJun 12, 2008
  28. Johan HerlandJun 12, 2008
  29. Stephen R. van den BergJun 12, 2008
  30. Nicolas PitreJun 10, 2008
  31. Denis BuenoJun 10, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.