Would it be relevant, or even efficient to use Git to recover a whole partition? If so, does it hold any advantage over creating a disk image or simply copying the file hierarchy?
4 Answers
Git is not meant for that use: most files in your partition are likely to be in binary format. Using a SCM (SVN, Git, etc.) is not the most efficient mechanism, especially if you consider that you don't need the whole history of a file but rather the latest version. I suggest you to use a periodic rsync command.

- 10,614
- 4
- 31
- 71
No. Since files on a partition may change very often, this leaves you only with the option of taking general snapshots every now and then, instead of the small commits Git specializes in managing. For this, a source-control system is not fit.
Git also doesn't track empty folders. Additionally, file systems, especially on Linux, may contain hard links, symbolic links, virtual files, sockets, named pipes, etc... Not to mention the fact that tracking binaries is not Git's specialty.
You might want to check out Acronis or Norton Ghost.

- 7,953
- 1
- 28
- 38
No, this is not a good idea.
Git doesn't do well with large files, or binary files, and it doesn't track permissions as well as you'd probably like (files in Git are executable or not, and that's about it).

- 127,765
- 105
- 273
- 257
-
Also symlinks -- just a nitpick ;-) – kostix Oct 15 '14 at 13:13
Git is the wrong tool, unless you only want to backup text files.
There are two types of backups, either just copy/archive files with directory structure or create a snapshot-image clone of the harddrive (sector by sector). For clones there is Clonezilla for copies on GNU/Linux rsync is good (like Claudio said), or if you prefer having a nice GUI use Back in Time.
(All tools are opensource)

- 1,795
- 2
- 18
- 25