LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-11-2009, 02:30 PM   #1
digity
Member
 
Registered: Apr 2005
Posts: 105

Rep: Reputation: 15
Use DD while Linux is running?


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?
 
Old 11-11-2009, 03:00 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Just wondering... why use dd to make a backup ? rsync is more appropriate, IMHO. And of course you can use it while it's running.
 
Old 11-11-2009, 05:17 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.
 
Old 11-12-2009, 02:50 PM   #4
digity
Member
 
Registered: Apr 2005
Posts: 105

Original Poster
Rep: Reputation: 15
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.
 
Old 11-12-2009, 03:11 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Backula maybe?
 
Old 11-12-2009, 04:05 PM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Quote:
Originally Posted by digity View Post
I tried to set up a RSYNC backup solution before and it was just too difficult (I needed it to be secure/over SSH).
Why too difficult ? rsync seems to be the right tool through SSH, just read the manual.
 
Old 11-12-2009, 04:10 PM   #7
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
rsync will do it for you. What I recommend is to do an offline backup using a system rescue cd then you can do online backups using rsync after that.
 
Old 11-12-2009, 08:39 PM   #8
digity
Member
 
Registered: Apr 2005
Posts: 105

Original Poster
Rep: Reputation: 15
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)?
 
Old 11-12-2009, 09:43 PM   #9
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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.

Last edited by i92guboj; 11-12-2009 at 09:47 PM.
 
Old 11-13-2009, 02:05 AM   #10
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Quote:
Originally Posted by digity View Post
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)?
In that regard, there is no difference between distributions AFAIK. And you are the admin so never follow blindly any advise

That said, some links follow:
http://ubuntuforums.org/showthread.php?t=238672
http://troy.jdmz.net/rsync/index.html
http://www.adamsinfo.com/rsync-over-...mated-backups/
http://sial.org/howto/rsync/
http://www.adamsinfo.com/rsync-over-...mated-backups/
http://www.unix-tutorials.com/go.php?id=3707

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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
program running time comparison under Linux Desktop, Linux Server and Windows Xp crs_zxf Linux - Newbie 2 05-07-2009 10:27 AM
Windows running Firefox more secure than linux running it? moxieman99 General 14 04-04-2009 10:12 AM
Problems installing and running Frostwire on Acer One running Linpus Linux ricky1981 Linux - Newbie 1 12-19-2008 08:24 AM
any linux distro can running in RAM , not need CD_ROM reading when running. wangcity Linux - General 3 09-18-2003 05:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration