Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

If I want to make a backup of my entire OS (including but not just my home directory), how do I go about this?

Is it as simple as backing up everything in / and then when if I suffer a crash, just copying the files back over?
Will this cover grub, and how do I actually do this when the system is inoperable?

share|improve this question
you may want to take a look at this question for backup tools askubuntu.com/q/2596 – Decio Lira Oct 17 '10 at 1:03
May I ask why you want to do this? In most cases it is your files you will want to backup - the rest of the system is for most people easy to reinstall from the Ubuntu CD. – fluteflute Oct 17 '10 at 7:59
Because i hate reinstalling all my apps and PPAs, icons and themes. My HD crashes the installer sometime and I just generally hate installing everything from scratch. – rocker9455 Oct 17 '10 at 23:10

5 Answers

up vote 11 down vote accepted

FILES

Refer to this howto: http://ubuntuforums.org/showthread.php?t=35087

In simple terms, the backup command is: sudo tar czf /backup.tar.gz --exclude=/backup.tar.gz --exclude=/home --exclude=/media --exclude=/dev --exclude=/mnt --exclude=/proc --exclude=/tmp /. Add more --exclude= parameters if you need to.

It will create an archive of all your files at /backup.tar.gz, which you can then copy over to another computer/drive and restore your files if the install goes pear-shaped. You can do it from a LiveCD, by mounting the "bad" system under /media or /mnt and running tar xf /path/to/drive/with/backup.tar.gz -C /mnt (substitute for the actual path to the "bad" system).

GRUB

This will not cover GRUB, however you can easily reinstall it by following this guide here. You only need to do steps Three and Four.

share|improve this answer
Great post! Thanks a lot that pretty much answers all my questions – rocker9455 Oct 16 '10 at 22:32

You can use Remastersys to create a bootable live CD/DVD image. This will install like a normal Ubuntu CD.

To install Remastersys, you first need to add a repository:

deb http://www.geekconnection.org/remastersys/repository karmic/

You can then install it from the Software Centre as usual.

Once installed, use it to make a 'dist' backup. This means that user data will be excluded from the ISO image.

remastersys UI

This is often used to create custom distributions but is still useful for the backup task you have in mind. One caveat is that it may fail if the contents of / (minus user data in /home) takes up too much memory because the ISO file format can only hold ~4GB data. Remastersys uses a file system called squashfs to compress your data so you should be OK with up to ~8GB.

share|improve this answer
1  
I tried this but last time it got too big so taring / excluding the directories im not interested in is better for me, then when i backup i dont have to wait for the CD as my HD will be quicker thanks for the advice though – rocker9455 Oct 16 '10 at 22:47

Here is a good tutorial using PartImage.

share|improve this answer

Noone noticed clonezilla. It makes a complete image of your hard drive, so it backups absolutely everything. It's as easy as burning an iso or creating a bootable flash drive.

The actual backup takes a while, but is the most reliable.

share|improve this answer

I use a program called Back In Time that's similar to Apple's Time Machine.

It's easy to tell it where you want your backups to go and how often to do the backup.

Back In Time is in the Ubuntu repos.

share|improve this answer
That doesn't explain how to backup my system and how to restore it at all. When i can't even boot up back in time won't be able to help. If you can suggest how to use backup in time in this way I would be appreciative. Cheers – rocker9455 Oct 17 '10 at 9:11
Back in time uses is a frontend for rsync. You'll have to have Ubuntu installed to use it. I agree with fluteflute's comment above that it's easier to backup your files. That's what I thought you wanted. – gamerchick02 Oct 17 '10 at 16:21
I already backup my files ;) The amount of times i render ubuntu inoperable its easier to either reinstall or revert to a backup than fix the problem (generally i need it fixed as I have work to do in between fiddling and breaking!) – rocker9455 Oct 17 '10 at 23:11
Right. I tried back in time to setup an automatic backup but i get a whole bunch of errors. Most like this: (its just a small fraction, and im running in root mode) – rocker9455 Oct 18 '10 at 15:55
[E] Error: rsync: read errors mapping "/sys/module/videodev/sections/.altinstr_replacement": No data available (61) – rocker9455 Oct 18 '10 at 15:55
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.