I have a git-annex repository on a USB drive (full of pictures), however, when I go to the actual drive:
$ cd /run/media/hinmanm/MINIDRIVE1/pics
$ ls -lh australia-2014-03
I get:
-rw-r--r--. 1 hinmanm hinmanm 1.1K Aug 22 2015 IMG_20140321_181130.jpg
-rw-r--r--. 1 hinmanm hinmanm 1.1K Aug 22 2015 IMG_20140321_181137.jpg
-rw-r--r--. 1 hinmanm hinmanm 1.1K Aug 22 2015 IMG_20140321_181221.jpg
-rw-r--r--. 1 hinmanm hinmanm 1.1K Aug 22 2015 IMG_20140321_181228.jpg
-rw-r--r--. 1 hinmanm hinmanm 1.1K Aug 22 2015 IMG_20140321_181233.jpg
... hundreds more .jpg files that are all 1.1K ...
It looks like the files think they are symlinks, instead of pictures:
$ cat australia-2014-03/IMG_20140321_181233.jpg
XSym
0201
2ac7522707415dfe67ad5afa1ab3e516
../.git/annex/objects/5F/Xw/SHA256E-s2499217--ad9525adf9a82e4ac83c89fd2bddfd2b2aef690ccbbddf38d91abc85f72509f6.jpg/SHA256E-s2499217--ad9525adf9a82e4ac83c89fd2bddfd2b2aef690ccbbddf38d91abc85f72509f6.jpg
Running git-annex fsck
doesn't do anything, and trying to do git-annex indirect
gives me:
$ git-annex indirect
git-annex: This repository seems to be on a crippled filesystem, you must use direct mode.
It looks like there is still a bunch of data in .git/annex
, as its 6.7gb. Is there a way I can get the files back and get git-annex working again, right now none of my photos are available
It seems like that is how OSX stores symlinks on FAT filesystems and how Samba stores symlinks on Windows. Did you initially make the drive on one of those systems? Using the same system again would probably make them appear like normal usable symlinks.
At the very least, since you said
.git/annex
is full of data, I think you should be able to find the photo at the location listed in the last line of those files:Thanks for the info, that was very helpful. This is indeed a FAT partition I created on OSX.
Unfortunately, I no longer use OSX, so I don't have a machine that can read this data. I'll write a script to grab it from the contents of the symlink file itself to hopefully retrieve everything. In the future, I'll partition my external harddrives with ext4
Thanks again!
Gold star for @jimparis!
Another way to get out of this situation would be to edit the files, and remove the initial lines so it contains a single line that is the link target of the symlink (the bit with .git/annex/objects in it).
Then,
git annex fsck
would be able to fix up the files.