aboutsummaryrefslogtreecommitdiff
path: root/doc/walkthrough/recover_data_from_lost+found.mdwn
blob: 6e2c241485d2f97ae0b3aefc1650fa8c71a22b1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
	git annex add recovered-content
	git rm recovered-content
	git commit -m "recovered some 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 SHA1 backend is used, but even
with the default backend it will work pretty well, as long as fsck
preserved the modification time of the files.