Ask Slashdot: Asynchronous RAID-1 Free Software Backup For Laptops?
First time accepted submitter ormembar writes "I have a laptop with a 1 TB hard disk. I use rsync to perform my backups (hopefully quite regularly) on an external 1 TB hard disk. But, with such a large hard disk, it takes quite some time to perform backups because rsync scans the whole disk for updates (15 minutes in average). Does it exist somewhere a kind of asynchronous RAID-1 free software that would record in a journal all the changes that I perform on the disk and replay this journal later, when I plug my external hard disk on the laptop? I guess that it would be faster than usual backup solutions (rsync, unison, you name it) that scan the whole partitions every time. Do you feel the same annoyance when backing up laptops?"
You can find | sort | diff ahead of time (maybe in the background) and then constrain the rsync to only the files recorded to have changed.
Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
Just buy a mac :-)
Use mdadm -C -b internal to create a bitmap. Detach and readd the mirror at will and it will only sync the difference.
Time Machine on a Mac laptop does exactly this - it uses a journal of filesystem changes to update only the files it needs to. While this is probably not much use to you since I'm guessing that if you had a Mac you would not be asking this question it would be a system to look at if there is no FOSS alternative and you want to code your own.
Take a look at DRBD.
RAID is not backup.
Its called time machine. It basically takes a series of snap shots with lvm then offloads them when you reconnect. You could achieve the same thing with shadow copy and a script as well.
You could try DRBD (whole disk level) or ZFS with detached mirror or snapshots. Both will keep track of changes and resync only things that changes from the last sync.
Cleanest implementation of this I've seen is with ZFS.
You do a snapshot of your filesystem, and then do a zfs send to your remote backup server, which then replicates that snapshot by replaying the differences. If you are experiencing poor speed due to read/write buffering issues, pipe through mbuffer.
The only issue is that it requires that you have your OS on top of ZFS.
You want two ZFS filesystems. One local laptop pool, one backup pool (and it really should have two disks, but one will work fine). Snapshot your laptop filesystem periodically (cron or something), and then zfs send/receive that snapshot to the backup pool when you have access.
Are you backing up EVERYTHING on the laptop -- OS and data included? Even if you are only backing up your home directory there is stuff you don't need to backup like the .thumbnails directory which can be quite large. Try using rysnc's exclude option to restrict the backup to only what you care about.
DNA
AKA mrascii
In this case, it sounds like you want a fast on-demand sync rather than a RAID.
However, you could possibly use dm-raid for this if you're a linux user.
Have the internal disk(s) as a degraded md-raid1 partition. When you connect the backup disk, have it become part of the RAID and the disks should sync up. That said, it likely won't be any faster than rsync, quite possibly slower as it'll have to go over the entire volume.
Alternate solutions: /home is a combination of /mnt/home-ro (ro) and /mnt/home-rw (rw, COW filesystem). When external media is connected, /mnt/home-rw is synced to external media, then back over /mnt/home-ro
* Have a local folder that does daily syncs/backups. Move those to the external storage when it's connected.
CAVEATS: Takes space until the external disk is available
* Use a differential filesystem, or maybe something like a COW (copy-on-write) filesystem. Have the COW system sync over to the backup disk (when connected) and then merge it into the main filesystem tree after sync
For example,
Is to not try to keep 1TB of crap on a laptop... or anywhere for that matter. Travel light says me ;)
The OP doesn't mention which OS he's on - the tools he mentions both run across multiple OS's. Would be helpful to know. I know as a group we probably assume some form of Linux but..... I use MS Home Server at the house to back up my family's multiple Windows machines. Runs on crappy hardware, does incrementals on a schedule, allows file level or bare metal restore, keeps daily/weekly/fulls as long as I ask it to. I know we aren't a Windows friendly crowd but this product does exactly what it promises and does it pretty well.
"Would you, could you, with a goat?" Dr Seuss
Well, all my research work from the last 20 years, that makes some data, and you never know which data you need when you travel. So, when I change laptop, I copy all my data from the old disk to the new disk. That's why also I want to backup only the diff, and not spend my time scanning the disk to find these differences (which can be spread all over the disk).
CrashPlan is free, but not open, and I think will do everything you need. You can backupto an external disk, over the network to one of your own machines, or back up to a freind who also runs it. Great key based encryption support. If you want, you can pay them for offsite backups (which is a great deal as well, in my opinion). It's cross-platform, and easy to use. Never underestimate the benefits of off-site backups.
RSync. Pretty simple, works on multiple operating systems.
It doesn't do exactly this, but it gets the job done efficiently.
Such as CrashPlan [www.crashplan.com]. You can do local backups to an external hard drive or a friend for free. You only need to pay if you want to use their cloud storage instead of or in addition to local storage. You'll capture versions, it will be differential, and the data is deduplicated. Plus, CrashPlan is extremely fast for data that is compressible and/or dedup-able.
Windows Backup (since Vista) use Volume Shadow Copy (VSS) to do block level reverse incremental backup. I.e. it uses the journaling file system to track changed Blocks and only copies over the changed Blocks.
Not only that, it also backs up to a virtual harddisk file (VHD) which you can attach (Mount) as a seperately. This file system will hold the complete history, i.e. you can use the "previous versions" feature to go back to a specific backup of a directory or file.
Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
Get a raspberry Pi, plug the drive into it, and have it run rsync daemon (set it up to auto-start in case of power failure triggering a reboot). Plug the Pi's ethernet cable into your router, and then on your laptop run a script to trigger rsync (works via Cygwin too for Windows users) via a scheduler / cron. Have it verify that you are connected to your home (work / whatever) network, and if so call up the pi and start the backup.
I set mine to try this on my work system at 11 am every day, because by that time I had come to work, dealt with my morning emails etc, and gone off to do something else, so by and large it would happen when I was not at the keyboard. You probably won't notice the slowdown anyways, even if you are there.
For bonus points add a second script that checks the logs and alerts you if you've gone a while without backing up (in case the Pi dies or something)
From the back, or in its throat?
I've calculated my velocity with such exquisite precision that I have no idea where I am.
Holy cow people, your missing the OP point. It's taking 15 minutes to SCAN the 1TB drive.
I've run into the same problem on windows and Linux. Especially for remote rsync updates on Linux on slow wireless connections. It's not the 1TB that kills since I can read 4TB drives with hundreds of movies in seconds. It's the amount of files that kill performance.
My solution on windows is to take some of the directories with 10,000 files and put them into an archive (think clipart directories). Zip, Truecrypt, tar, whatever. This speeds up reading the sub-directories immensely. Obviously, this only works for directories that are not accessed frequently. Also, FAT32 is much faster on 3000+ files in a directory than NTFS is. Most of my truecrypt volumes with LOTS of files are using FAT32 just because of the directory reading speed.
On Linux systems, I just run rsync on SUB-directories. I run the frequently accessed ones more often and the less-accessed directories less often. Simple, No. My rsyncs are all across the wire, so I need the speed. Plus some users are on cell-phone wireless plans, so need to minimize data usage.
Religion and science are both 90% crap..but that doesn't negate the other 10%.
1. For keeping two drives synchronized, check out GoodSync. It's powerful, and I use it to keep two separate computers holding identical copies of two major folders of data synchronized, so if one goes down, there's minimal loss of data (1 hour, max) I use this, for example, to keep a client's two 1TB collections of photos and iTunes synchronized. http://www.goodsync.com/
2. For making backups that are compact, efficient and easy to recover, look at "Disk Snapshot". It's inexpensive, robust and I've never experienced a restore failure. I make "Disk Snapshot" images of every computer, every night, in a development environment. That way, if the thing I just did breaks the system, I can restore a 100 GB Drive is less than an hour by booting from a CD and pointing to the backup on an external drive. http://www.drivesnapshot.de/en/index.htm
I'd think to use LVM and filesystem snapshots. The snapshot does the trick of journaling your changes and only your changes. You can ship the snapshot over to the backup volume simply by netcat-ing it over the network. The backup's logical volume needs to have same size as the original volume. It's really a minimal-overhead process. Once you create the new snapshot volume on the backup, the kernels on both machines are essentially executing a zero-copy sendfile() syscall. It doesn't get any cheaper than that.
Once the snapshot is transferred, your backup machine can rsync or simply merge the now-mounted snapshot to the parent volume.
A successful API design takes a mixture of software design and pedagogy.
How about BtSync?
It's based on the BitTorrent protocol, and it can sync over the internet as well.
"Knowledge makes us accountable." - Che Guevara
If you are spending time messing with a system that is not going to provide you with a running computer after a quick trip to the store for a new hard drive, then maybe you should rethink your goals.
And perhaps you would regret the time spent less if you knew that in the event of an emergency, your backup would not only save your data, but prevent a re-installation and updates and more updates and more updates, and hunting for installation media and typing in software keys.
AIX had/has a nice system for backups: it created a bootable backup tape. Just turn the key, boot from the tape, say go and your machine was recovered completely. The closest I have see to that recently is clonezilla.
Making a mirror every now and again is not a backup strategy to use. This is the canned RAID is NOT a backup and never will be advice. For a single laptop something like backblaze is probably a better bet.
No sir I dont like it.
Yes, there is a product named ActiveImage Protector from Japan. There is an English version available from www.activeimage.net. It creates a log of changed blocks between backups (incremental backups). Base backup is full disk or volume image (smart sector to only backup sectors in-use), subsequent incremental backup only backs ups changed blocks. Very good compression and very fast backup. Versions for Windows and Linux. You can mount backup images to restore file selectively or boot from a recovery CD to restore boot volumes and disks.
You are unlikely to find anything faster than rsync, nor as reliable. 15 minutes to synchronise your backup with your live data is an impressively short time - did you ever look at the "speedup" claim that rsync includes in its final message? This is the ratio of time taken to synchronise versus the time that would be required to transfer the complete dataset over the same bandwidth. USB3 has an absolute maximum of 4.8 Gbit/s, which is 600 MBytes/s (or 2 TBytes per hour), but you are unlikely to get better than 1 Gbit/s (0.4 TBytes per hour) sustained disk data transfer.
I do wish Linux had something like mksys/sysback.
Unfortunately, there isn't much in the way of bare metal restorable backup utilities for Linux unless I reboot to another OS and run an image program. Even wbadmin.exe in Windows can create for me boot images where I just boot from recent Windows OS media, run wbadmin to restore, walk off, and reboot into a functioning OS.
If I were to recommend a backup utility for Linux, I'd probably just worry about syncing off application data and documents, since it takes -far- less time to reinstall the OS than apps, than to try to piece together a working Linux box from backups.
You're holding it wrong. ;)
rsync 2.x was horribly slow as it would scan the entire source looking for changed files, build a list of files, and then (once the initial scan was complete) would start to transfer data to the destination.
rsync 3.x starts building the list of changed files, and starts transferring data right away.
Unless you are changing a tonne of files between each rsync, it shouldn't take more than a few minutes using rsync 3.x to backup a 1 TB drive. Unless it's an uber-slow PoS drive, of course. :)
We use rsync to backup all our remote school servers. Very rarely does a single server backup take more than 30 minutes, and that's for 4 TB of storage using 500 GB drives (generally only a few GB of changed data). And that's across horrible ADSL links with only 0.768 Mbps upload speeds!
Going disk-to-disk should be even faster.
two pools, internalPool, externalPool
use ZFS send and receive to migrate your data from internal to external, you and do whole fs or incremental if you keep a couple of snaps local on your internal disk, this can get excessive if you have a lot of delta or you want a long time.
http://docs.oracle.com/cd/E18752_01/html/819-5461/gbchx.html
of course you will need a system that can use ZFS, there are more options for that than time machine, its block level and its fast, and it doesn't depend on just one device, you can have multiple devices (I like to keep some of my data at work, why? my backup solution is in the same house that would burn, if it burned...)
Unix, an obscure operating system developed by bored researchers in an attempt to get a better game playing experience.
Setup DRBR on the initial configuration to the secondary drive. I haven't used it for a while but IIRC the changes sectors would be flagged for replication and when the secondary device was brought online it would replication. I know this what designed for a machine to machine block replication but it might be plausible on the same machine. It might be a good feature request if it doesn't (but then that wouldn't help you right now)
Lsyncd plus some of queue to sync when destination device is available.
I currently backup 2.5TB of data using rsync. It takes about 2-3 minutes to determine the changes and then whatever time to do the actual copying. Post your actual rsync command, maybe you are doing something strange that isn't necessary.
git-annex with a running assistant maybe (in direct mode)? But would like to hear how does it work. Would create git directory for holding metadata about files. Would be constrained to your home.
Ubuntu documentation lists some alternatives: https://help.ubuntu.com/community/BackupYourSystem one that is not listed there, and that I used many years ago is "UNISON"... I found it faster and better then rsync, also it does binary diff, so for big files that only "metadata" changed, it transfers faster.
Not free but reasonably priced and worth every penny. rebit.com keeps track of all changes, sends new versions of a file to a local harddisk, a network share or both. In case of a crash you can recover from a boot CD-ROM and I've used that to transfer my files to a new computer too. They have cloud-enabled versions too.
To Terminate, or not to Terminate, that's the question - SCSIROB
I usually hate making posts where I am questioning the questioner, rather than providing an answer but with 1 TB of information you should put on the patience cap. It will take as long as it takes.
To break down what you are wanting:
I want a backup based on a journal file system sorta of thing that works incrementally slowing down every disk operation by a few milliseconds so I can shave 15 minutes off of a backup procedure, but I still have to send the same data. I don't think that would be very wise. The best existing method is to use mirror a volume but you're still experiencing the same "15 minutes" of delay.
The best thing you can have is a "fire and forget" procedure where you can walk away and let it run.
locate (based on updatedb) does not capture/sort on file modification dates so you are going to be left with a recursive file system search no matter what.
You could use find to generate a list of files that have been modified since a certain date and then feed that to tar. That way you can pre-generate an incremental backup in a file that you can copy over. Then let whatever backup solution you like make a full backup from time to time. You can setup a script that would run a few times in your work day to generate the file so at least every 24 hours there is a tar file you can copy over when you get a chance.
Good luck!
"Don't fear death... fear not living..." -me
i know this post won't help much but i just want to say that mechanical laptop drives are really slow. i haven't tried using a laptop with an solid state drive though. i just did a benchmark of an old 900 MHz Celeron Netbook. the average read transfer rate of the drive was about 33 megabytes per second vs 60 megabytes per second of my desktop SATA drive.
come to think of it, my external USB drive has an average transfer rate of about 30 MB/s too. copying big files takes a long time. i remember spending about 40 minutes or more to copy a 20 GB MMORPG so that I can move it from one computer to another.
Btrfs send/receive should possible be doing the trick. After first cloning the disk and before every subsequent transfer create a reference-snapshot on the laptop and delete the previous one after the transfer.
$ btrfs subvolume snapshot /mnt/data/orig /mnt/data/backup43 /mnt/data/backup42 /mnt/data/backup43 | btrfs receive /mnt/backupdata /mnt/data/backup42
$ btrfs send -p
$ btrfs subvolume delete
I havn't tried this for myself, so the necessary disclaimer: this may eat your disk or kill a kitten ;-)
rsync + hard links, works just like time machine. http://www.rsnapshot.org/
Btrfs has tools for doing this. It also comes with find-new that allows to find exactly which files have been changed between snapshots, and it does it basically instantenously.
Though Btrfs might not be the solution for ensuring data integirity at this point.. But setting up hourly snapshots of your drives can be quite nice when you accidentally destroy something you've created after the last backup.
http://lwn.net/Articles/506244/
Sorry, but something doesn't sound right here. Even with the amount of data your g about, it sounds like something else is slowing it down. Namely, system/kernel config.
Do some I/O observing if you haven't. You may have some task or process priority problem slowing things down.
Just a thought...
It will duplicate the file blocks the requested(2, 3, ..) number of times. Kind of like a single disk raid, or as close as you can reasonably be. With checksums it will also figure out which block(s) are corrupted.
I use iFolder for this. It has clients for Windows, Linux, and Mac platforms, and works reasonably well. The server was a bit of a pain to get set up though. It used to be a Novell product but has spun off as its own open source project. You can check it out at ifolder.com
It is relatively straightforward to use DRBD to loopback across 127.0.0.1 and protocol A to set exactly this up. I'd link to the blog which demonstrates how I did this, but don't want to get slashdotted. (Googling "drbd-for-ssdusb nz" should hopefully show you how to do this if you care enough to google for it)
It sounds more like you have a slower USB 2.0 external drive or some other sort. If your laptop offers eSata go with that as it is faster than USB 2.0. If you have USB 3.0 your eSata can still be faster assuming your motherboard has the SATA 6.0 gbps speed.
It performs actions on file changes. It can also create a list of updates/created/deleted files on the fly.
Then, you just have to use this list to sync juste the changed files.
Put your filesystem on a DRBD device?
You'll get a consistent clone every time you leave your laptop connected to your home network long enough for it to sync the changed blocks
Use XFS with xfsdump, do a level 0 and then subsequent level 1 and level 2 backups. It'll finish in seconds.
Do you modify all your research work from the last 20 years? If not, exclude it from backup, since you already have it backed up and are not changing it.
Real backup and since 6.3 does journal based backups for Ext2, Ext3, Ext4; XFS, ReiserFS, JFS, VxFS, and NSS.
The other option I have seen (surprisingly for GPFS as TSM does not do journal based backups for GPFS even though both are IBM products) is to register to the DMAPI (this would only work for XFS I think) and then use that to capture all activity on the file system. You could then use that to generate your list of files to backup. Admittedly this is going to require you to get your hands dirty and do some coding. I am also not sure what state DMAPI support is in XFS either.
Come on, this is 101 stuff, though very entertaining to see the usual geek overkill suggestions of RAID mirrors, ZFS pools, and other fun stuff. We sure love our overkill, huh? (I'm guilty too)
Anyways, what I would do is 1st ask myself "why am I watching a backup run?" Whether it takes 5 minutes or 50 minutes is irrelevant; who watches their backups run? You log the job output and email the results, or whatever your favorite technique is.
Second, set up your daily cron to launch a shell script a little before the earliest time you expect to arrive home. In this shell script you insert a simple loop that does a check to see if you're at home (more below); if you're not at home, the loop sleeps for 10 minutes (or whatever) and runs again. Set an upper bound on the cumulative total amount of time to sleep (6 hours or so); in the event you're out really late/all night, then the script exits cleanly without performing the backup and runs the next day. It can identify you are at home and ready to launch the rsync by one of several conditions: look for the presence of an NFS mount; look for a certain IP range; look for your USB drive mounted that perhaps has a file named ".backup_device"....whatever. When this condition is TRUE, break out of/exit the loop, and the next line contains the rsync command. Easy!
One of the most important aspects of a backup job is that it is scheduled and runs automatically. If you have to rely on a person to manually start it, then sooner or later (like, within a week) you'll start putting it off or simply forget to do it.
Effectively syncs dirs (like /home) and versions files too. Put raid/drbd under it and you are set.
ZFS snapshots and incremental send/recv do exactly what the person here wants. See Oracle's documentation for details of how the commands work:
http://docs.oracle.com/cd/E19253-01/819-5461/gfwqb/index.html
You can use ZFS on Darwin, FreeBSD, Illumos, Linux, Mac OS X and Solaris.
lsync (http://code.google.com/p/lsyncd/) is what you are looking for. It watches changes and copies them over, avoiding the scanning of a complete directory tree.
When starting up, it uses rsync to make sure both sides are in sync.
I used it in the past and it worked as advertized. Nowadays I use rsync over night though and let it run weekly, so the long time to run is not an issue anymore.
The agency where I work is all Microsoft, all the time. They use Active Directory for everything. After I had been working there a year, security did a scan of the network and found out I was running Linux. I ran Linux for a year in that environment and had no trouble. My Linux desktop played just fine with their AD forest. LibreOffice had no trouble with any of the Microsoft Office documents I needed to handle. I've heard that some version of LibreOffice had some trouble with some feature as implemented by some version of MS Office. I saw no problems, though.
I did get in trouble for running an unauthorized OS. Now I'm still at a command line, but on a Mac when I need to be connected to the office network. Mac is certified Unix.
If it's linux, we use a thing called lsyncd that I'm pretty sure will do what you want. It monitors for file changes using inotify and ships modified files back to the remote host via rsync. https://code.google.com/p/lsyncd/
That's a great solution, and one that actually answers the OP's question, assuming he can do a little shell scripting. I spent YEARS designing a great enterprise grade backup solution using LVM. I'm the maintainer of Linux::LVM, but I hadn't heard of lvmsync before. I'm sure I'll use it sometime.
using lvm (i hope), use snapshots.
I use BackInTime under similar conditions and it works fast and perfect. It uses diff, rsync and symbolic links to preserve the history of every snapshot. Check it out: http://backintime.le-web.org/
https://wiki.archlinux.org/index.php/Backup_Programs
Casteism