File: recover_data_from_lost%2Bfound.mdwn

package info (click to toggle)
git-annex 5.20141125%2Bdeb8u1
  • links: PTS
  • area: main
  • in suites: jessie
  • size: 37,832 kB
  • sloc: haskell: 42,603; sh: 1,080; ansic: 498; makefile: 316; perl: 125
file content (19 lines) | stat: -rw-r--r-- 800 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Suppose something goes wrong, and fsck puts all the files in lost+found.
It's actually very easy to recover from this disaster.

First, check out the git repository again. Then, in the new checkout:

	$ mkdir recovered-content
	$ sudo mv ../lost+found/* recovered-content
	$ sudo chown you:you recovered-content
	$ chmod -R u+w recovered-content
	$ git annex add recovered-content
	$ git reset HEAD recovered-content
	$ rm -rf recovered-content
	$ git annex fsck

The way that works is that when git-annex adds the same content that was in
the repository before, all the old links to that content start working
again. This works particularly well if the SHA* backends are used, but even
with the default backend it will work pretty well, as long as fsck
preserved the modification time of the files.