Skip to content

Instantly share code, notes, and snippets.

@garybernhardt
Last active July 11, 2017 00:36
Show Gist options
  • Save garybernhardt/b1a8cc6eacbfa9ea8100 to your computer and use it in GitHub Desktop.
Save garybernhardt/b1a8cc6eacbfa9ea8100 to your computer and use it in GitHub Desktop.
# Has your OS/FS/disk lost your data?
# cd to the directory containing your project repositories and run the command
# below. (It's long; make sure you get it all.) It finds all of your git repos
# and runs paranoid fscks in them to check their integrity.
(set -e && find . -type d -and -iname '.git' | while read p; do (cd "$(dirname "$p")" && (set -x && git fsck --full --strict)); done) && echo "OK"
# I have 81 git repos in my ~/proj directory and had no errors.
# You might get messages about dangling commits, dangling blobs, etc. Those
# aren't errors. If it prints "OK" at the end, your repos are all valid.
# Please leave a comment here saying whether the command succeeded or not (even
# if it said "OK"!). Also name your OS and file system. If it failed, please
# paste the bottom of the error, starting with the last "git fsck" command.
@jasonkarns
Copy link

OK
91 repos
Mac OS X 10.9.5
Journaled HFS+

@keck
Copy link

keck commented Nov 11, 2014

OK | 29 repos, OS X Mavericks, HFS

@rahearn
Copy link

rahearn commented Nov 11, 2014

OK
37 repos
OSX 10.10
Journaled HFS+

@aisipos
Copy link

aisipos commented Nov 11, 2014

OK, 167 repos, OS X 10.9, HFS+ w/ Filevault, SSD

@kleinmann
Copy link

OK
388 repositories on Mac OS X 10.10, HFS+, FileVault, SSD.

@UnderpantsGnome
Copy link

OK 262 repos, OS X 10.10, HFS+ FileVault, SSD

@cwoodcox
Copy link

Worked. Couple of zero-padded file modes and a few dangling blobs and commits (branches come and go in work repos.) Relatively new machine, only 15 repos.

OS X 10.10, HFS+, FileVault, Crucial CT240M500 SSD

@benhoskings
Copy link

All OK. 283 repos, git-1.9.3, Yosemite, HFS+ extended journaled (i.e. the default), Filevault on.

@brooksreese
Copy link

Checking object directories: 100% (256/256), done.
Checking objects: 100% (23604/23604), done.
OK

@mikker
Copy link

mikker commented Nov 12, 2014

OK. 48 repos. FileVault on. HFS+ extended journaled. git-2.1.3 from homebrew.
Lots of dangling blobs though.

@caius
Copy link

caius commented Nov 12, 2014

OK, 349 repos. HFS+ with Journalling & Encryption, under OS 10.10

@mrageh
Copy link

mrageh commented Nov 12, 2014

Checking object directories: 100% (256/256), done.
Checking objects: 100% (4708/4708), done.
OK

@tpinto
Copy link

tpinto commented Nov 12, 2014

73 repos
Mac OS X 10.9.5 with a Mac OS Extended (Journaled) filesystem
13-inch, Mid 2011 MacBook Air

OK

@joelanders
Copy link

68 repos, Linux, ext4, 2.5-year-old SSD, OK

@tylerdooling
Copy link

OK - 112 repositories - OSX 10.10 - HFS+

@jcoglan
Copy link

jcoglan commented Nov 12, 2014

OK On my full-time work machine of ~8 months, 42 repos, Ubuntu 12.04, ext4

@eightbitraptor
Copy link

OK on my work machine, OS X Yosemite, 10 repos

[~/code] sw_vers 
ProductName:    Mac OS X
ProductVersion: 10.10
BuildVersion:   14A389

[~/code] diskutil info /
File System Personality:  Journaled HFS+
Type (Bundle):            hfs
Name (User Visible):      Mac OS Extended (Journaled)
Journal:                  Journal size 40960 KB at offset 0xe8f000
Owners:                   Enabled

@gschueler
Copy link

OK, 227 repos. os x yosemite 10.10, Journaled HFS+

@tcrayford
Copy link

OK, 46 repos, Oh Sex Yo Sem Ite, 10.10, Journaled HFS+

@maxamillion
Copy link

OK
164 repos
RHEL 7 - XFS

@dmarkow
Copy link

dmarkow commented Nov 12, 2014

OK, 53 repos. Yosemite 10.10, Journaled HFS+. 2-year old Macbook Pro.

@wpp
Copy link

wpp commented Nov 12, 2014

OK, 31 repos

sw_vers
ProductName:  Mac OS X
ProductVersion: 10.10
BuildVersion: 14A389

diskutil info /
File System Personality:  Journaled HFS+
Type (Bundle):            hfs
Name (User Visible):      Mac OS Extended (Journaled)
Journal:                  Journal size 16384 KB at offset 0x388000
Owners:                   Enabled

@mildmojo
Copy link

No output, exit code 1 on an OS X 10.8.5 box, < 10 repos, git 2.1.1, journaled HFS+.

@garybernhardt
Copy link
Author

@mildmojo sounds like something is broken on your machine

@iangreenleaf
Copy link

OK, 135 repos. Arch Linux. EXT4 on a 2-disk HDD RAID0, recently copied over from a single HDD that was developing bad sectors.

@carols10cents
Copy link

+ git fsck --full --strict
Checking object directories: 100% (256/256), done.
Checking objects: 100% (346/346), done.
ruby-1.9.3-p550 is not installed.
To install do: 'rvm install ruby-1.9.3-p550'

Be mad.

... 33 repos, OK, Yosemite, Journaled HFS+.

@jlecour
Copy link

jlecour commented Nov 13, 2014

58 repositories, all OK

~/Projects → sw_vers
ProductName:    Mac OS X
ProductVersion: 10.9.5
BuildVersion:   13F34

~/Projects → diskutil info /
   Device Identifier:        disk0s2
   Device Node:              /dev/disk0s2
   Part of Whole:            disk0
   Device / Media Name:      Customer

   Volume Name:              MacSSD
   Escaped with Unicode:     MacSSD

   Mounted:                  Yes
   Mount Point:              /
   Escaped with Unicode:     /

   File System Personality:  Journaled HFS+
   Type (Bundle):            hfs
   Name (User Visible):      Mac OS Extended (Journaled)
   Journal:                  Journal size 24576 KB at offset 0x11502000
   Owners:                   Enabled

   Partition Type:           Apple_HFS
   OS Can Be Installed:      Yes
   Recovery Disk:            disk0s3
   Media Type:               Generic
   Protocol:                 SATA
   SMART Status:             Verified
   Volume UUID:              [redacted]

   Total Size:               250.1 GB (250140434432 Bytes) (exactly 488555536 512-Byte-Units)
   Volume Free Space:        9.5 GB (9492004864 Bytes) (exactly 18539072 512-Byte-Units)
   Device Block Size:        512 Bytes

   Read-Only Media:          No
   Read-Only Volume:         No
   Ejectable:                No

   Whole:                    No
   Internal:                 Yes
   Solid State:              Yes

@yaakov-h
Copy link

OK
38 repos
OS X 10.10 (14A388a)
Mac OS Extended (Journaled, Encrypted)

@mohlendo
Copy link

OK
86 repos
OS X 10.9.5 (13F34)
Mac OS Extended (Journaled)

@samsonjs
Copy link

OK
290 repos
OS X 10.11.1 (15B42)
HFS+ with FileVault2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment