Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 – 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. – 8128 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. – Will Oct 17 '10 at 23:10

12 Answers 12

up vote 28 down vote accepted


Refer to this howto:

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).


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 – Will 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 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
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 – Will Oct 16 '10 at 22:47

Try Remastersys.
With that program you can do liveCD (just the same as Ubuntu installation iso file) of your system with ability to install it on hard drive. Works pretty simple (if you know how to burn iso to USB/CD/DVD).
Works perfectly on my 11.10 and 11.04, and older ones as well.

edit file /etc/apt/sources.list
add: # Remastersys
deb karmic/ and save
Then run in terminal:
sudo apt-get update
sudo apt-get install remastersys

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

To clone your system to another system.Or make a backup. In terminal type

      dpkg --get-selections | grep -v deinstall > ubuntu-files

this command makes a file list of all installed packages in ur system(and stores it in present working directory).Backup this file in hdd,email, etc...(file is very small)

in the freshly installed ubuntu system


      sudo dpkg --set-selections <./ubuntu-files (will set it up and)

      apt-get -y update
      apt-get dselect-upgrade

will install only those packages you had installed (with apt-get) in the older system.


u could back up all the .deb packages from /var/cache/apt/archives/ and install them manually.


      dpkg -i *.deb

and after that running an update cycle later.

share|improve this answer

Here is a good tutorial using PartImage.

share|improve this answer

go to ubuntu software center find Déjà Dup backup manger install it`` run it and give path where to backup your data select files to be backup make a back up

later on you can chose backup by giving location of your external hard drive gud luck source []

share|improve this answer
I want to backup my entire system not just my music or videos. – Alvar Nov 19 '11 at 12:27
@Alvar you can select the "/" or "File System" and can back that up (that is the ENTIRE SYSTEM). – jaorizabal Mar 23 '12 at 22:27
how do I install it? how do I backup my system with it? – Alvar Mar 23 '12 at 22:32

Crashplan will back up all your system files and data and allow you to recover it - either on your current PC or allow you to adopt it to another install.

You can back up to their online system, another computer or any attached hard drive.

share|improve this answer

If you hard-disk where Ubuntu is installed isn't too big, you can try booting from a live cd (any linux distro will do) and running:

    dd if=/dev/sda of=/path/to/external/hardisk/mybackupfile

This makes a backup of your whole hard-disk, not just Ubuntu, and it'll also do all the empty bytes, but it's the only solution I can think of. To restore the backup, use:

  dd if=/path/to/external/harddisk/mybackupfile of=/dev/sda
share|improve this answer
so how would I restore my Ubuntu distro from a copy om my whole HDD? Because you can't do that... – Alvar Nov 19 '11 at 13:54

I have found you a detailed and recent how to on using Clonezilla. Clonezilla will let you make an image of your complete system including all hard drive partitions etc and later restore it.

The tutorial is at

share|improve this answer

We can also do backup of system with rsync & exclude files & folders that we don't want. Here is the following command to do this :

#rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /* /path/to/backup/folder

Using the -aAX set of options, the files are transferred in archive mode, ensuring that symbolic links, devices, permissions and ownerships, modification times, ACLs and extended attributes are preserved

The --exclude option will cause files that match the given patterns to be excluded.

REFERENCE : Full system backup with rsync

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 – Will 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!) – Will 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) – Will Oct 18 '10 at 15:55
The backup commands noted above would probably work best for you. I only suggested Back in Time as a frontend for the rsync, etc. You can choose what you want to make a backup of, including all of the system files. – gamerchick02 Oct 18 '10 at 23:46

Your Answer


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.