kanotix.com

Software - Backup Kanotix System

aYie28 - 26.06.2006, 06:30 Uhr
Titel: Backup Kanotix System
After satisfied for all setting like fstab, grub, file system, sofware, and etc, i think we better do backup .How to backup them ? In other way, how to backup KanotiX system ? In suse, we know that YasT can do that, how about in KanotiX ? I can Backup the whole partison using norton ghost, so that if something goes wrong, i can restore back, but it's take alot of time and space.... Sehr glücklich
devil - 26.06.2006, 06:36 Uhr
Titel: Backup Kanotix System
backup is easiest with cp command. a possible line is:

cp -avx /your/home /your/backup/dir
look at man cp for more options.

as an alternative look at:
http://kanotix.com/FAQ-id_cat-70.html

greetz
devil
aYie28 - 26.06.2006, 06:46 Uhr
Titel: RE: Backup Kanotix System
Thanks, i'll try that first...
aYie28 - 26.06.2006, 06:53 Uhr
Titel: RE: Backup Kanotix System
Ok, let say i've done the backup succesfully. and something goes wrong, i cant even log in gui, so, how to restore back from terminal ?
devil - 26.06.2006, 07:21 Uhr
Titel: RE: Backup Kanotix System
what did you do exactly?


greetz
devil
aYie28 - 26.06.2006, 07:42 Uhr
Titel: RE: Backup Kanotix System
now, not yet, i can log in smoothly...but, who knows ....last time it happens after im using apt-get install.....
devil - 26.06.2006, 08:16 Uhr
Titel: RE: Backup Kanotix System
ah, got you wrong, sry.
just copy back from terminal
btw, if you cp /home, just do the user(s) in your home, not home itself

greetz
devil
aYie28 - 26.06.2006, 10:02 Uhr
Titel: RE: Backup Kanotix System
oh ok, thanks...
markb - 27.06.2006, 01:44 Uhr
Titel: Re: Backup Kanotix System
devil28 hat folgendes geschrieben::

cp -avx /your/home /your/backup/dir

In general devil28, rsync is better for copies which you are likely to do repeatedly such as a backup. i.e.
Code:
rsync -avxH --delete /your/home /your/backup/dir
is better than cp here because it creates a mirror of the source but only actually updates (and deletes) what changes on second and subsequent invocations.
aYie28 - 27.06.2006, 04:48 Uhr
Titel:
If we used this command >rsync -avxH --delete /your/home /your/backup/dir , how to restore them back ?
slh - 27.06.2006, 15:39 Uhr
Titel:
Switch source and target (and most probably leave out --delete, unless you really want to do it - take care of the trailing slashes).
michael7 - 27.06.2006, 16:15 Uhr
Titel: rdiff-backup
This is a topic in which I'm interested. Here's a webpage about rdiff-backup that you may find helpful:

http://arstechnica.com/articles/columns ... 0202.ars/2

I have two hard drives on my computer. I wanted to backup my /home directory which is on the first hard drive to another partition on the second hard drive at hdb6. Here are the commands that I used:

Code:

mick@KanotixBox:~$ su
Password:
root@KanotixBox:/home/mick# mount /media/hdb6
root@KanotixBox:/home/mick# rdiff-backup /home/mick /media/hdb6/backup


(This is the much simplified version of the FAQ that devil28 mentioned above, which Swynndla wrote.)
h2 - 27.06.2006, 18:54 Uhr
Titel: RE: rdiff-backup
One thing needs to be modified with the faq on rdiff-backup, the last time I tried it, with a heavily modified version of that method, I found that rdiff-backup was only accepting one --exclude item. Previously, as in the sample on the faq page, it was accepting 2 or 3 before it would exit with a failure code. When I changed those two --exclude items to use the
rdiff-backup --exclude-globbing-filelist fileofexcludes.txt /backupsource /backupdestination
method instead, with the excluded files/directories in an external list, it worked fine again.

rdiff-backup works really well once you understand how to implement it, the easiest is to just write a small shell script to create the backup, with all your options preset.

I do four separate backups in mine, root, home, plus two different data partitions.

Plus the script accepts a parameter so I can write to one of two backup directories, which lets me alternate them when I feel like it, but that isn't necessary for a simple install, usually backing up the root directory and the home directory is all that is required for most users.
michael7 - 27.06.2006, 20:32 Uhr
Titel: Backup and restore with rdiff-backup
For my Kanotix installation, I have two partitions-- root and home. Initially, I made the root partition 10 GB and that has proved to be ample. For home, however, I used a 20 GB partition and after more than a year of creating and downloading files, I found that I was running out of space.

I needed to increase the size of my /home partition without breaking my installation because I've put a lot of work in it and it's running sweet (like a slice of cold watermelon on a hot Tennessee summer day Sehr glücklich). Using the rdiff-backup command, my Kanotix Easter Edition LiveCD, and the gparted program, I pulled it off without a hitch. Here's what I did.

First, I used rdiff-backup to make a backup copy of my /home partition on another partition of a second hard drive. (I backed up my /root partition, too, just to be safe.)

hda1 (primary)-- /
hda3 (primary)-- /home
hda5 (logical)-- unused partition
hdb6 (logical)-- partition on another harddrive used for backup

Code:

mick@KanotixBox:~$ su
Password:
root@KanotixBox:/home/mick# mount /media/hdb6
root@KanotixBox:/home/mick# cd /media/hdb6
root@KanotixBox:/media/hdb6# mkdir rdiff-backups
root@KanotixBox:/media/hdb6# mkdir rdiff-backups/root
root@KanotixBox:/media/hdb6# mkdir rdiff-backups/home
root@KanotixBox:/media/hdb6# cd /home/mick
root@KanotixBox:/home/mick# rdiff-backup /home /media/hdb6/rdiff-backups/home
root@KanotixBox:/home/mick# rdiff-backup --exclude '/tmp/*' --exclude '/proc/*' --exclude '/sys/*' --exclude '/media/*/*' / /media/hdb6/rdiff-backups/root


Next, I rebooted using my gparted.iso disk. ("gparted" stands for Gnome Partition Editor. I first used it after h2 recommended it and found it to be better than qtparted.) With gparted, I deleted my /home partition and hda5, an unused partition after it, created a new, larger /home partition and a smaller hda5 partition.

Then I rebooted using my Kanotix Easter Edition LiveCD and restored the /home directory to hda3 with these commands:

Code:

knoppix@0[knoppix]$ su
root@0[knoppix]# mount /media/hdb6
root@0[knoppix]# mount /media/hda3
root@0[knoppix]# rdiff-backup -r now /media/hdb6/rdiff-backups/home
/media/hda3
root@0[knoppix]#


You can find most of this at the FAQ that devil mentioned:
http://kanotix.com/FAQ-id_cat-70.html

The entire procedure took about 30 minutes and went very smoothly. No problems whatsoever.
kenyee - 27.06.2006, 23:29 Uhr
Titel: RE: Backup and restore with rdiff-backup
michael7: have a look at LVM if you haven't (I also posted a how-to convert Kanotix to LVM a while back). There's no need to repartition w/ LVM...you just add more space to a partition (live) as you need to. My / was initially 2GB but I found I was running out of space w/ kernel installs, so I bumped it to 2.5GB. No downtime at all and it was painless. Try to stick w/ ext3, ReiserFS, and XFS for partitions though...
michael7 - 28.06.2006, 01:05 Uhr
Titel: LVM
kenyee,

Thanks for the information on LVM. I'll check into it.
beavis - 28.06.2006, 15:19 Uhr
Titel: RE: Backup and restore with rdiff-backup
You could use sbackup, it uses rdiff to catch daily (or weekly etc) changes in the chosen directories.
michael7 - 29.06.2006, 23:59 Uhr
Titel: LVM HowTo
@kenyee
Here's a simple HowTo that I found about LVM:
http://www.debian-administration.org/articles/410

@beavis
I checked out sbackup. Interesting. Thank you for mentioning it. It has a nice, clean GUI, however, it is written for Gnome. Traurig

I found another, pyBackPack, but it's written for Gnome as well. https://sucs.org/~davea/trac
kenyee - 30.06.2006, 03:14 Uhr
Titel: RE: LVM HowTo
Here are a few more michael7, but these assume you're going to use the installer:
http://www.planamente.ch/emidio/pages/l ... m_raid.php
http://dev.jerryweb.org/raid/
http://wiki.archlinux.org/index.php/Ins ... AID_or_LVM

The tricky part was getting Kanotix migrated over and one of my postings a while back covers this...
jackiebrown - 30.06.2006, 04:19 Uhr
Titel: RE: LVM HowTo
well it is for local backups but I like grsync (also written for gnome) After the first backup it only updates new files or changed files. Makes things fast.
2radical - 03.07.2006, 22:11 Uhr
Titel:
Now that I've got my printing restored, I need to do a backup. I've read the FAQ's, examples, other threads, etc & am still confused. My brain is 57 yrs. old, so I need a little help understanding. Winken Plus I don't want to screw up doing this.

/media/hda5 is my main system & I want to create a backup to /media/hda6. Do I need to make a backup directory in hda6 beforehand? If so, would this be correct?

mkdir /media/hda6/backups
Also, does this look correct for making the backup?

rdiff-backup --exclude /tmp/* --exclude /proc/* --exclude /sys/* --exclude /media/*/* /media/hda5 /media/hda6/backups (assuming I have to make a backup directory)

To restore, do I have to use a live-CD and have the partitions unmounted, or mount both?
Does this look like it will do the job?

rdiff-backup -r now /media/hda6/backups /media/hda5

I'm probably overlooking some things I should include, but don't know what. Thanks in advance--kurt
devil - 04.07.2006, 08:32 Uhr
Titel:
kurt,
from the top of my 5 year younger brain:
i think, there is a bug with rdiff, when you use more then 1 --exclude.
there is a thread on the forum (use find) about that by H2.
but you dont really need the excludes or 1 should be enough.

greetz
devil
Swynndla - 05.07.2006, 11:27 Uhr
Titel:
@2radical ...

- Yep, make a backup directory (actually you may not have to, but I dunno if it'll work or not).

- Make sure that /media/hda6 is bigger than (ie is a larger partition ... ie more free space than) /media/hda6 ... as hda6 must not only hold an existing copy, but also some incremental backups.

- For backing up, what you wrote:
rdiff-backup --exclude /tmp/* --exclude /proc/* --exclude /sys/* --exclude /media/*/* /media/hda5 /media/hda6/backups
looks almost fine ... but I put the exclude directories in quotes, so you'd have:
rdiff-backup --exclude '/tmp/*' --exclude '/proc/*' --exclude '/sys/*' --exclude '/media/*/*' /media/hda5 /media/hda6/backups

The reason for the quotes is, well it's been a while since I've studied rdiff-backup ... but (and this is true for all bash scripts) it's so the rdiff-backup will be passed the * ... otherwise bash with expand it before it passes the arguments to rdiff-backup. The rdiff-backup wants the * so it can do the expanding itself. (but for all I know, rdiff-backup may work for you without the quotes, I can't rememer, but I wouldn't recommend it)

I've had to do a lot of backing up and restoring lately, and I havent had any issues with multiple excludes yet (but I'll watch out for it) (and make sure you use the quotes).

- To restore, yes, boot up via a live-CD, and mount both partitions. Then you can do just what you said:
rdiff-backup -r now /media/hda6/backups /media/hda5
(no excludes neccessary if you boot up from a live cd ... make sure you do or you may lose all your data like I did when I was experimenting!)
2radical - 05.07.2006, 16:55 Uhr
Titel:
Thanks for your reply. I've installed Easter & have a different partition scheme now, & am having a few difficulties. But thanks for the info. Once I get things straightened out I will be using it.
h2 - 05.07.2006, 19:33 Uhr
Titel:
devil, yes, the last time I used the latest rdiff-backup it no longer supported multiple --excludes.

However, even the first times I tested it there was a limit of I think 3 excludes before it would exit with errors. So the solution is to just use the:
--exclude-globbing-filelist

option, which calls a text file of excludes. Using a text file is a lot easier long term, and isn't as cluttered, and doesn't trigger whatever limit rdiff-backup has in the most recent version.

That's a much more flexible way to do it too, it allows within that file both includes and excludes, which can be very useful, for example, say you want to exclude all of /var/www except for 1 directory, you can simply say in the text file:

/var/www
+ /var/www/somefolder

The rdiff-backup manfile is unusually helpful and clear by the way, it's actually all you need to get rdiff-backup running.

Zitat:
Lines starting with "+ " are interpreted as include directives, even if found in a filelist referenced by --exclude-filelist. Similarly, lines starting with "- " exclude files even if they are found within an include filelist.

gardyloo - 05.07.2006, 20:32 Uhr
Titel:
Just to add to the thread, I've used rdiff-backup for several months (I worked hard to get the latest -- 1.1.5 -- version installed on several different distros; SUSE was difficult to get that on there, but I did) and there's no problem with more than three '--exclude' additions.

To one of the original posters, 'keep' is helpful for getting a GUI for rdiff-backup, but I find that getting it to run very consistently (at least in the current incarnation) is more difficult than using rdiff-backup itself.
Swynndla - 06.07.2006, 02:23 Uhr
Titel:
I use rdiff-backup version 1.1.5 too ... and I don't have a problem with multiple excludes (eg for my root partition I use --exclude '/tmp/*' --exclude '/proc/*' --exclude '/sys/*' --exclude '/media/*/*' ) ... but I do agree that it's messy, and using --exclude-globbing-filelist is a great idea Smilie

BTW - note the cunning use of '/tmp/*' instead of '/tmp' (not that I was cunning, someone else pointed it out to me) ... the /tmp directectory name is backed up, but none of the files/directories in it are backed up ... so it means that on a restore, the /tmp directory is restored as an empty directory (which is what I want) and with the permissions set right. If I used '/tmp' instead, then when I restore the partition, /tmp directory will be missing, and X will not boot up, but will complain bitterly. (I'd have to create the directory and set the permission right, and I'd have to try to remember how to set the special sticky flag that this directory has) This cunning trick is used for the other excludes listed above too (and the extra cunning '/media/*/*' ... eg /media/dvd will exist as a mount point). This means that when I do a restore of my root partition, everything works.

Ahhh yes the man page is great ... I love man pages that have actual examples.

I see the man page says to put quotes around directory globs on the command line (eg '/tmp/*' instead of just /tmp*) as it says:
"Remember that you may need to quote these characters when typing them into a shell, so the shell does not inter-pret the globbing patterns before rdiff-backup sees them."
... but the exclude-globbing-filelist file should not have the quotes the quotes around the directory glob names (according to the man page, although I haven't tested this).

So I could have is a file called "globbing-list.txt" (put in /root/ say)
- /tmp/*
- /proc/*
- /sys/*
- /media/*/*

... then all I'd need to call to back up my root partition is:
rdiff-backup --exclude-globbing-filelist /root/globbing-list.txt / /media/hdb1/rdiff-backups/192.168.1.5/root

Much nicer.
Swynndla - 06.07.2006, 03:54 Uhr
Titel:
I just tested that, and it works.
2radical - 06.07.2006, 06:55 Uhr
Titel:
My Easter installation is trashed. Boot errors, can't print, /etc/fstab was written wrong, have to start all over disabling all journaling & delete partitions. What a nightmare. It'll be my 4th attempt at installation. Ho-hum have to put everything else on hold till things are fixed. Keeping my fingers crossed.
Alle Zeiten sind GMT + 1 Stunde
PNphpBB2 © 2003-2007