이 상황에서 git repository 복구 가능할까요?

slc의 이미지

linux에서 disk 2개를 mirror 구성하고, xfs 파일시스템으로 만들고
git repository를 저장하였습니다.

git commit 도중 crash 나서 리부팅이 되었는데, repository에 문제가 생겨서
어떻게 복구하면 될지 난감하네요.
index 파일과 refs/heads/master 파일 size가 0으로 되버리고,
일부 object 파일 크기도 0으로 되버린것도 있고...

지난번에 단전이 되는 바람에 파워가 나가버렸는데 일부 object가 corrupt났다고 해서
repository를 다시 만들고,
disk write cache를 disable시키고, git config file에 "fsyncobjectfiles = true"
넣어줬는데, 이번에 또 reboot되니 문제가 있네요.

git 빠르고, 용량도 작게 차지해서 사용하고 있는데.. 영 불안해서.

아래는 crash reboot후 현상입니다.
index, master -> size 0
fsck -> error: Invalid HEAD

# ls -l index refs/heads/master
-rw-r--r-- 1 root root 0 2011-11-18 10:55 index
-rw-r--r-- 1 root root 0 2011-11-18 10:55 refs/heads/master

# find objects/ -size 0
objects/40/cf51449233434dbdd00eabfc992103e43f3f62
objects/6a/b3c5fbce5552e76c59823e6e32a38d8051694f
objects/ea/ae18dac0c8f4a4fdcdd047107e982450e3a539
.
.
.

# git fsck --full
error: Invalid HEAD
fatal: object 21a16bbff328057b5fb0592932a70e8474357dcf is corrupted

# git fsck
error: Invalid HEAD
error: bad ref for refs/heads/master
notice: No default references
fatal: index file smaller than expected

어떻게 하면 repository를 복구할 수 있을까요? 어떻게 하면 이런 경우를 겪지 않을까요?

파일시스템을 바꿔보고, sync 모드로 마운드 해도 repository에 문제 생기는 걸 막을 수가 없네요. -_-

테스트 한거 업데이트 합니다.

--- jfs, sync(x) ----
file system : jfs
mount option : sync(x)
write disk cache : disable
git config fsyncobjectfiles = true

git commit 중 system reset : fatal: index file corrupt

system reset 1번 만에 repository 문제 발생

--- jfs, sync(o) ----
file system : jfs
mount option : sync(o)
write disk cache : disable
git config fsyncobjectfiles = true

git commit 중 system reset : object corrupt

system reset 16번 만에 repository 문제 발생

익명 사용자의 이미지

xfs가 그렇게 허술하지는 않을텐데요. 좀 이상하네요.
레포지터리 용량이 100MB도 안되는 비교적 작은 용량의 레포지터리라면 잘 깨지지 않습니다.

제 경험으로는 항상 메모리가 말썽이더군요. 메모리 체크를 먼저 해보시기 바랍니다.

익명 사용자의 이미지

memtest로 1회 테스트 했습니다만, error는 없습니다.

xfs에서 jfs로 변경해서 다시해봤는데 바로 object corrupt나네요.
어떻게 해야할지? 난감하네요.

bushi의 이미지

굉장히 다양한 주제로 시작해서 결론을 하나로 도출하려고 애를 쓰시는 것 같은데,
의미가 있을런지요 ?

1. RAID mirror 로 backup 을 대신하겠다
2. DVCS 로 backup 을 대신하겠다
3. journaling filesystem 으로 backup 을 대신하겠다

RAID mirror 는 h/w 불량에 대비하기 위한 것이지 s/w 불량이나 사용자 불량에 대비하기 위한 것이 아닙니다.

DVCS 로 소스를 분산시키면 backup 효과를 거둘 순 있습니다. backup 겸용 머신이 튼튼하다면요.

journaling filesystem 은 파일시스템이 깨지는 것을 막는 것이지 파일이 깨지는 것을 막지는 않습니다. 오히려 파일을 깨서라도 파일시스템이 깨지는 것을 막습니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.