View Full Version : Guide: How To Backup Operating Systems
IgnorantGuru
May 27th 2008, 05:11 PM
I have posted a new Wikibooks guide "How To Backup Operating Systems"...
http://en.wikibooks.org/wiki/How_To_Backup_Operating_Systems
This guide extends on the information in the older guide here...
http://kubuntuforums.net/forums/index.php?topic=13735.0
Comments and suggestions are welcome.
imneo
Jun 3rd 2008, 03:52 PM
here is the most simple guide ever, backup your hall disk or partition in a sec
http://scripts-net.com/viewtopic.php?f=6&t=73
askrieger
Jun 3rd 2008, 10:30 PM
@IG: Interesting and clear guide.
cpradio
Jun 14th 2008, 11:11 PM
My latest kick for backups is using rsync to make an entire duplicate of my hard drive on an external USB 2.0 drive. I have a 500 GB USB Drive that I have two partitions on (each 250), my Primarily drive is a 250, and I use rsync to make 1 full copy and then have it only update the files that change every 2 hours.
When it updates a file, I have it backup the original based on the date and time it ran. No compression, no worrying about space until the backups begin to take their toll, but for the most part, the backups are only the files I change often, and I have the piece of mind of being able to go back two hours ago, or 2 days ago.
I'll post the script I use when I get back home late tomorrow evening. In a nutshell, if you have the space to do it, I believe it is a very sound and good idea to make an uncompressed backup. Saves time in restoring any files and not having to have the space to restore 2 GB of data, you just have to copy the 1KB file you need.
Matt
Qqmike
Jun 15th 2008, 12:26 AM
cpradio,
Sounds like a useful topic. In fact, a basic how-to on using rsync at Konsole might also be interesting & useful. I've not used it yet, but keep seeing it pop up here and there in Linux circles. (I've used dd and have done a how-to on that here somewhere @ Kubuntu.)
The following is related and demonstrates a use of rsync
HOWTO: Copy kubuntu system, Rog131
http://kubuntuforums.net/forums/index.php?topic=11116.0
cpradio
Jun 15th 2008, 01:13 AM
Here we go. I found the original article I read that got me started with rsync, but I did alter mine as it had a few side effects I did not like.
http://matthewhelmke.net/wordpress/2008/04/08/using-rsync-to-back-up-my-laptop/
BTW, I strongly recommend that everyone add the feed:
http://planet.ubuntulinux.org/rss20.xml
It has a LOT of good information that gets posted daily and many of which I strongly recommend as good reads. All Linux based, and mostly Ubuntu/Kubuntu based too, though some could be generalized to Linux as a whole.
Anyways, back to rsync.
I took his example of
sudo rsync --force --ignore-errors --delete --delete-excluded --exclude-from=/media/disk/matthew-exclude.txt
--backup --backup-dir=`date +%Y-%m-%d` -av / /media/disk/backup/matthew-laptop
And change it to:
sudo rsync --force --ignore-errors --delete --delete-excluded --exclude-from=/media/backup/<username>-exclude.txt
--backup --backup-dir=/media/backup/<username>-backups/`date +%Y-%m-%d` -av / /media/backup/<username>
Now here is why, if you do not declare an absolute path for the backup directory, it does a relative backup. Meaning, your /media/backup/<username>/ will have a backup folder, so will /media/backup/<username>/home, etc.
I wanted all of my backup folders/files to be in a central location. It will still create the tree structure for my backups, but it won't mix them into where my actual files are backed up to.
Example:
/home/<username>/MyFile1.txt
Using the command by Matt H., it would back that file into /media/backup/<username>/home/<username>/2008-06-14/MyFile1.txt
With my change, it goes into:
/media/backup/<username>-backups/2008-06-14/home/<username>/MyFile1.txt
Its' a personal choice, but I feel most would prefer my approach.
Enjoy.
askrieger
Jun 15th 2008, 08:12 PM
@cpradio: Down in the discussion of the blog post you reference, there is a comment to the effect that there is a bug report in Launchpad saying that the version of rsync used in HH hangs for large files. it recommends the use of the Debian (Unstable) package which has a newer version of rsync in which the purported bug has been repaired. However, the Ubuntu developers don't seem to be too concerned. Have you encountered any difficulties?
cpradio
Jun 15th 2008, 09:01 PM
No I haven't and I honestly didn't read any of the comments (as I just got the idea from the feed I subscribed too). I have several files that are a few megs each and they backup just fine.
I can't say I have any over a gig, that are being backed up, but to my knowledge all of my data has always successfully backed up and the program has finished/completed in about 20+ minutes (after the initial backup). The initial backup took about 2 hours as it copied every file, from then on, only the changed files needed to be copied.
I'll give it a test later this week with a large file. I have had it backup ISO files which were 750+ megs, but I'd be interested in seeing what it does with a 1 gig file.
Matt
kevinc
Aug 26th 2008, 10:06 AM
IgnorantGuru - many thanks for the wiki - it is clear and detailed. I especially like your detail on MBR's.
There is one thing that I would like added - backup for encrypted partitions.
I'm using Kubuntu 8.04 and it allows encryption on installation, which is great for encrypting /home, swap and /tmp.
I haven't found anything yet, that allows simple backup of encrypted partitions.
I'm using an external hard drive, encrypted with dm-crypt, and tar to copy the files I want to that.
Do you have any advice about backup of encrypted partitions? Thanks.
IgnorantGuru
Aug 26th 2008, 10:48 AM
There is one thing that I would like added - backup for encrypted partitions.
I'm using Kubuntu 8.04 and it allows encryption on installation, which is great for encrypting /home, swap and /tmp.
I haven't found anything yet, that allows simple backup of encrypted partitions.
I'm using an external hard drive, encrypted with dm-crypt, and tar to copy the files I want to that.
Do you have any advice about backup of encrypted partitions? Thanks.
Thanks kevinc. I don't know enough about encrypted partitions to add that to the wiki. But AFAIK, because the filesystem is encrypted, a tool like partimage won't be able to read the partition. I think the simplest backup method for such a partition would be to copy the partition using the dd command. This way the encrypted data is copied to the destination with encryption intact. This is discussed here... http://ubuntuforums.org/showthread.php?t=880443
However, as that discussion notes, restoration to a different drive may be tricky (due to the UUIDs ,etc). Thus copying files to another encrypted partition (as you have been doing) may be your most reliable backup option.
Qqmike
Aug 26th 2008, 11:55 AM
AwesomeMachines states (in big red letters, toward the beginning of his how-to): "Warning!! Caution should be observed when using dd to duplicate encrypted partitions."
He doesn't say why, but you could read the thread (maybe someone has addressed it) then post to investigate further.
Learn the dd command:
http://www.linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/
dibl
Aug 26th 2008, 10:02 PM
Learn the dd command:
http://www.linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/
That is one marvelous tutorial -- thanks Mike! Although, I must say that "dd" is one of those operations that makes me want to physically disconnect my "real" hard drive (the one with the OS that I care about) before I issue the command. :P Call me "chicken" ..... ;D
kevinc
Aug 27th 2008, 09:22 AM
IgnorantGuru,
Many thanks for that link. I had searched without finding it. Thanks also for your great advice.
I appreciate it and will try dd with a spare flashdisk - I've only got one external hdd at this time.
Backup is a very important topic and with rapidly changing technology and options - something that needs constant revision.
kle
Oct 28th 2008, 09:40 PM
Gosh! Beautiful. Thank you.
IgnorantGuru
Jul 26th 2009, 04:26 AM
A fairly major edit to this book was posted today which includes an expanded section on the MBR & boot process, how to backup and restore the partition table (including extended partitions), and other additions.
http://en.wikibooks.org/wiki/How_To_Backup_Operating_Systems
IgnorantGuru
Jan 13th 2010, 02:08 AM
A fairly major rewrite and update of How To Backup Operating Systems (http://en.wikibooks.org/wiki/How_To_Backup_Operating_Systems) is available. This includes a method which supports ext4 using the new FSArchiver, and it is now both GRUB v1 and v2 friendly.
http://en.wikibooks.org/wiki/How_To_Backup_Operating_Systems
And a PDF version for printing...
http://en.wikibooks.org/w/index.php?title=Special:Book&bookcmd=render_article&arttitle=How+To+Backup+Operating+Systems&writer=rl
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.