git repo being corrupted?
I've recently started to notice the following being reported:
% git-status
error: bad index file sha1 signature
fatal: index file corrupt
(a) Is there anything I can do to fix this (apart from git-clone from the repo and start over) ? git-fsck reports the same problem.
(b) What is causing it? Is it just my hard disk failing, or is it a bug? A memory test seems to be OK.
Linux 2.6.22-3-amd64
File system is XFS
git version 1.5.4.4
Quoted 8 lines · Luke Diamand
I've recently started to notice the following being reported:
% git-status
error: bad index file sha1 signature
fatal: index file corrupt(a) Is there anything I can do to fix this (apart from git-clone from the repo and start over) ? git-fsck reports the same problem.
rm -f .git/index should do it.
Quoted 6 lines
(b) What is causing it? Is it just my hard disk failing, or is it a bug? A memory test seems to be OK.
Linux 2.6.22-3-amd64
File system is XFS
git version 1.5.4.4
You're using XFS. Did you have a power fail in the recent past?
Signature · 2 lines
lfr 0/0
Quoted 5 lines · Luciano Rocha
Quoted 3 lines
Linux 2.6.22-3-amd64
File system is XFS
git version 1.5.4.4You're using XFS. Did you have a power fail in the recent past?
How did you know?
Quoted 1 line
Quoted 9 lines · Luke Diamand
Quoted 5 lines · Luciano Rocha
Quoted 3 lines
Linux 2.6.22-3-amd64
File system is XFS
git version 1.5.4.4You're using XFS. Did you have a power fail in the recent past?
How did you know?
XFS doesn't order metadata writes with data writes, so if the power fails, it can find an update in the journal but the data wasn't written. Then it fills the file with zeroes to the new size.
I've lost /etc/passwd once with that behaviour...
Also, ext3 doesn't order the metadata and data updates with data=writeback, but the default is data=ordered, which does.
I use xfs, but only when I know I have at least daily backups (or on systems with UPS and with UPS initiated orderly shutdowns).
Signature · 2 lines
lfr 0/0
Quoted 7 lines · Luciano Rocha
Quoted 3 lines
Quoted 1 line
You're using XFS. Did you have a power fail in the recent past?
How did you know?
XFS doesn't order metadata writes with data writes, so if the power fails, it can find an update in the journal but the data wasn't written. Then it fills the file with zeroes to the new size.
This behavior should be a lot better for recent kernels.
xfs does even better with write barriers. But any file change that is more than one write can be corrupted or split by an inopportune powerdown.
David
Quoted 10 lines · David Brown
Quoted 6 lines · Luciano Rocha
Quoted 2 lines
Quoted 1 line
You're using XFS. Did you have a power fail in the recent past?
How did you know?
XFS doesn't order metadata writes with data writes, so if the power fails, it can find an update in the journal but the data wasn't written. Then it fills the file with zeroes to the new size.
This behavior should be a lot better for recent kernels.
To be fair, it hasn't happened to me lately. But I haven't lost power often, so I can't say it's fixed. ;)
Quoted 2 lines
xfs does even better with write barriers. But any file change that is more than one write can be corrupted or split by an inopportune powerdown.
Maybe, but I'm still waiting for barrier support through device-mapper.
Signature · 2 lines
lfr 0/0