Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm looking for a way to backup my Ubuntu 9.04 installation on schedule while its running. Can I back it up with DD while it's running? If not, how can I do so?
In general no (simple) backup solution is valid for a running system. Unless of course you can be sure nothing being backed up is being updated. When I need to do something like that I do it from single user to minimize the exposure. And I agree, dd is about the worst option.
DD because I haven't really heard of any real alternatives. I tried to set up a RSYNC backup solution before and it was just too difficult (I needed it to be secure/over SSH) so I nixed it.
I basically want to make a whole drive backup without having to disrupt the running server and that I can easily restore (from a recovery/restore boot disc) like ShadowProtect does for Windows or the built-in Windows backup feature for Windows Server 2008 and Vista/7.
ramram29: good idea. I'll use that VMware ghettoVCB.sh script to do a offline style whole system backup twice a month (yes, it's a virtual machine) and use rsync for daily backups.
Didier: do you know of a good but easy to follow rsync over ssh tutorial/how-to for Ubuntu to a FTP server (is that even possible)?
Regardless of what people say above, no solution is ok for a running system. The issues are likely to be minor on a desktop system, on systems with higher loads the thing starts getting creepier.
The right solution to your problem is called "snapshotting", and it's a feature that some file systems have. In solaris there's zfs, which implements this feature. In linux there's no mature fs that supports it (btrfs does, but it's nowhere near mature, and the zfs port for linux is FUSE based, and it's not mature either). So, the only option that's left is to use lvm (logical volume manager).
A snapshot is basically a photo of your disk on its current state, you take the photo, then backup that. It's an oversimplified explanation of course, but the key is that this way you ensure that nothing is going to change while you are doing the backup, and so, the backup will be 100% consistent, no matter what your system is doing at the moment. Taking the snapshot is quick, just a second, and you can clean it afterward.
The only downside is that migrating to lvm if you are not using it already can be a pain if you don't have enough free space to do it incrementally. Another downside (if you are a GUI fan) is that there's no decent GUI for lvm (that I know of).
You can start googling for "lvm snapshot" and read a bit until you get the concept, then change that by "lvm snapshot backup" to discover the rest. As said, if you take this course of action, your main problem right now would be the migration to lvm.
ps. I guess you already know this by now, but *never ever* do a backup with dd of a system that's mounted as 'rw', you will get a broken fs image almost for sure. A single disk write is enough to get a broken fs inside your disk image, how bad that will be depends on the fs and the number of write operations.
Anyhow, a good understanding of commands you type is necessary. For instance, not knowing enough cp command's options I recently ended up with files properly copied... But the timestamps, not preserved
Last edited by Didier Spaier; 11-13-2009 at 02:19 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.