Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Mar 18, 2004 1:47 pm 
Offline
Newbie

Joined: Thu Mar 18, 2004 1:23 pm
Posts: 4
I am trying to backup my entire linode (on 1 disk image) to another (blank) disk image.

I tried using both rdiff-backup & dump,however I can't seem to get them to work!

Any help would be greatly appreciated!

1. I tried using rdiff-backup with the following command:

rdiff-backup --force --exclude /dev --exclude /proc --
exclude /tmp --exclude /var/tmp --exclude /mnt / /backup

(Where / = the directory I am backing up and /backup = the 2nd
disk image mounted in this directory)

However, when I ran, this, I received the following error:

........
File "/usr/bin/rdiff-backup", line 523, in __call__
self.calculate_final_val()
File "/usr/bin/rdiff-backup", line 497, in calculate_final_val
self.state.branch_val)
File "/usr/bin/rdiff-backup", line 3599, in <lambda>
lambda dsrpath, x, y: dsrpath.write_changes(),
File "/usr/bin/rdiff-backup", line 3518, in write_changes
if not self.lstat(): return # File has been deleted in meantime
RuntimeError: maximum recursion depth exceeded

2. I tried using drump through the WebMin FileSystem Backup
module, however again, this didn't work. Here's the error:

Performing backup of / to /backup ..

DUMP: Date of this level 0 dump: Thu Mar 18 12:38:32 2004
DUMP: Dumping /dev/ubda (/) to /backup
DUMP: Added inode 8 to exclude list (journal inode)
DUMP: Added inode 7 to exclude list (resize inode)
DUMP: Label: none
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 753244 tape blocks.
DUMP: Cannot open output "/backup".
DUMP: fopen on /dev/tty fails: No such device or address
DUMP: The ENTIRE dump is aborted.


Can anyone suggest either (a) a way to get either one of these programs to successfully backup my Linode or (b) suggest an alternate method of backing up my Linode?

Thanks in advance! 8)


Top
   
 Post subject:
PostPosted: Thu Mar 18, 2004 2:52 pm 
Offline
Junior Member

Joined: Fri Oct 10, 2003 5:57 pm
Posts: 25
Have you tried cpio? If memory serves, something like
Code:
find / | cpio -p /mntptoftarget


Actually, you should probably use "find / -xdev". As in
Code:
find / -xdev| cpio -p /mntptoftarget


Top
   
 Post subject: Further Queries...
PostPosted: Thu Mar 18, 2004 9:03 pm 
Offline
Newbie

Joined: Thu Mar 18, 2004 1:23 pm
Posts: 4
bpendleton - thanks so much for your timely reply! 8)

I used the "find / -xdev| cpio -p /mntptoftarget" command and this worked! So what I did is I created a new debian image on a 2nd drive image, mounted this image as a /backup directory on my original linode, and then ran this cpio command to copy my current linode to the /backup image. This way, if I mess up my linode, I can simply shut it down and boot the 2nd debian image without loosing any data!

However, I still have a few questions:

1. In regards to "cpio" is there any way to: (a) exclude certain directories from being backuped and (b) run an incremental backup so that it doesn't have to compare each file each time it runs?

2. Also, does anyone have any ideas on how I can use an other utility, such as rdiff-backup or dump to successfully run a backup of my linode?

Thanks! :D


Top
   
 Post subject:
PostPosted: Thu Mar 18, 2004 9:27 pm 
Offline
Junior Member

Joined: Fri Oct 10, 2003 5:57 pm
Posts: 25
Uh, sure, I guess. I haven't used that kind of functionality much, but you should look at the man page for find. Particularly, you'll want to explore "-ctime" or "-newer" (then use "touch" to touch a file called "lastbackup" or something).

For exclusions, find can be a bit tricky. There's "! -name", but, at some point, it might be easier to chain in an
Code:
egrep -v "/myexcludedpath|/myexcludedpath2|etc"

Just pipe find to the egrep, to the cpio.


Top
   
 Post subject:
PostPosted: Thu Mar 18, 2004 10:09 pm 
Offline
Junior Member

Joined: Wed Feb 11, 2004 8:49 pm
Posts: 25
AOL: MattKCowger
I dony know if its possible in UML, but have you considered dd?

_________________
--Matt Cowger


Top
   
 Post subject:
PostPosted: Fri Mar 19, 2004 12:30 am 
Offline
Senior Member
User avatar

Joined: Wed Mar 17, 2004 12:35 am
Posts: 118
Website: http://www.necrobones.com/
Location: Sterling, VA
You can also run rsync to do quick updates. Set it to "whole file" mode with the capital 'W' parameter so that it skips a lot of the heavy calculation, and it won't take terribly long to run. You just have to make sure you skip things that don't need to be backed up. Here's a good example of some parameters that would be decent for backups, going from / to /backup as you're suggesting:

time rsync -Waql --ignore-errors --delete --exclude=/var/log/ --exclude=/home2/ --exclude=/dev/ --exclude=/mnt/ --exclude=/proc/ --exclude=/mirror/ --exclude=/sys/ --exclude=/backup/ / /backup

I put 'time' in front of it so you can get a measure of how long it takes. '--delete' deletes files from the backup if they've been removed from the source, so everything stays 100% up to date without extra clutter.

_________________
----
Ed/Bones.


Top
   
 Post subject:
PostPosted: Fri Mar 19, 2004 5:54 am 
Offline
Junior Member

Joined: Tue Sep 09, 2003 11:59 am
Posts: 47
Website: http://blog.griffinn.org/
If you (1) want an exact replica; and (2) have spare disk space for a third HD image, setup that 3rd disk with some sort of rescue boot image (RIP works fine for me), and then boot into it. Then you can mount the 1st and 2nd HD image and then pipe a dump into a restore.

The rescue image doesn't have to be large. Mine is 64Mb. Some rescue images can be as small as 2 floppies.


Top
   
 Post subject:
PostPosted: Sun Mar 21, 2004 6:19 pm 
Offline
Senior Newbie

Joined: Wed Jan 28, 2004 10:06 pm
Posts: 11
Note that it is dangerous to do backups of live filesystems that might change, since you might end up with your files in an invalid state. A better solution would be to consider using LVM on your Linode and taking a snapshot of your filesystems. Then you can just mount the snapshot and back that up however you like.

Perhaps someone else can post a link to a howto on LVM; making the switch from regular partitions is not usually easy.


Top
   
 Post subject:
PostPosted: Mon Mar 22, 2004 9:40 am 
Offline
Senior Member
User avatar

Joined: Mon Jun 23, 2003 1:25 pm
Posts: 260
Hi,

I recently did some copying of one image to another, if you do not mind shutting down your linode and have the available disk space, the easiest way is to create a small debian and image and mount both the source and destination and do the copy that way.

By doing this you are not copying from a live image.

Adam


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group