Linux alternative to file history/shadow copies for internal backup

backupfileslinuxsnapshot

I am looking for (good) backup alternatives to the time machine of MacOS/OS X devices or file history on Windows machines. Actually what I am looking for is closer to Windows' solution than to the time machine.

So I know I can use rsync or – with a nice UI – Back in time.
However I am not looking for an external backup solution!

This means I rather want to have a file history as in Windows Vista (and above AFAIK). On Windows Vista/7 this worked with Shadow copies, so this is exactly what I'd like to have:

Windows 7 shadow copy: dialog "properties" opened in explorer showing tab "Previous Versions"

So I want to save the backup/file history on the same drive (and probably partition, but that does not matter). I'd also save it on another internal drive, but not on an external one.

Is there such a solution for Linux or how can I best replicate this behaviour?
That's why existing files should not be duplicated and a backup (copy of the file) should only be saved when I actually modify or remove it. This way it saves much space, especially for larger files, which you won't edit anyway. As opposed to rsync/backintime, where never-modified files are copied even with incremental backups.

Best Answer

The Windows 'Shadow Copy' aka 'Volume Shadow Copy Servce' does filesystem snapshotting. The Linux equivalent requires changing your filesystem/partitions, or possibly using 3rd party tools.

Options

  • LVM -
    • you must leave free space on your volume group, and has a pretty high performance cost. All though not super fast it is available, stable, and pretty usable out of the box on most Linux releases.
  • btfrs - not entirely stable
    • be careful to read the note about setups that should not be used. Apparently it has some major ways it can be broken and result in full data lose.
  • zfs - not natively available on most distributions yet.
    • Very popular option, but is very difficult to use as a root fs on Linux. Great for data filesystems
  • R1Soft Hot Copy - https://www.r1soft.com/free-tool-linux-hot-copy
    • I haven't used this, but I don't believe it is designed for long term snapshots, instead it is just used for getting a clean backup.

So, if you need to snapshot your root FS, I suspect you probably need to setup the system with LVM, and leave lots of free space in your volume group.

If you need snapshots for a data-only filesystem, I strongly suggest you look at zfs or maybe btrfs.

Related Question