Linode - How to Backup Entire Linode to another 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.calculatefinalval()
File "/usr/bin/rdiff-backup", line 497, in calculatefinalval
self.state.branch_val)
File "/usr/bin/rdiff-backup", line 3599, in
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 Replies
find / | cpio -p /mntptoftarget
Actually, you should probably use "find / -xdev". As in
find / -xdev| cpio -p /mntptoftarget
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!
For exclusions, find can be a bit tricky. There's "! -name", but, at some point, it might be easier to chain in an
egrep -v "/myexcludedpath|/myexcludedpath2|etc"
Just pipe find to the egrep, to the cpio.
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.
RIP
The rescue image doesn't have to be large. Mine is 64Mb. Some rescue images can be as small as 2 floppies.
Perhaps someone else can post a link to a howto on LVM; making the switch from regular partitions is not usually easy.
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