# How do I backup the whole ubuntu OS (v 16.04) inluding apps, drivers etc

Totally new to Linux. My goal is to backup (or copy), in the simplest possible way, all necessary os files, drivers apps etc. I backup my home folder regularly so data recovery is covered. I have no problem with reinstalling Ubuntu from a LiveCD usb stick (I have done this many times). Obviously I would investigate and attempt any simple fixes first.

I do not want to do a complete system image of whole disk as I have data backups done regularly. Also it would not fit on a LiveCD DVD or USB stick plus I would have to do a complete disk image every time I wanted a system backup.

What I would like to do in the event of a crash / system failure is as follows:-

1 - Reinstall Ubuntu (possibly to a new disk if disk has failed) from my existing Ubuntu LiveCD of original system

2 - Restore / Copy all backed up system folders files

The end result being an identical system to before, with all drivers, applications, desktop, personal preferences etc. Bearing in mind it may be a new HD, possibly different size / structure.

What I would like to know is

1 - simplest way to backup or copy all necessary folders / files to preserve the system and bring original system up to date

2 - how to restore / copy back, again in simplest way

All my system files are on a single ext4 partition booting to /. I have Duplicity but am unsure how to use it. Apologies in advance if I have missed anything du to my inexperience.

Thanks

• Trying to copy the whole system, including drivers and customizations, for easy restore is a frequent newbie mistake...which you should already know having reinstalled Ubuntu many times. There are many, many ways to make backups easy (and easy to restore). What's best for you depends upon your actual needs and resources. – user535733 Nov 16 '17 at 17:44

Yes its possible to tell backup aka duplicity to backup certain files in certain folders.

Ass you can see there are options to chose:

1. Folders to save
2. Folders to ignore, among others

And for Ubuntu Gnome:

Its no different. And of course duplicity is intelligent enough to know what to back up so letting it do so is ok. It will do a comprehensive backup of your system and make it possible to do a restore when needed.

• OK - problem is as a new linux user I do not know which folders to backup to give me a re-installable system with drivers, applications etc – kerry Dec 22 '16 at 9:04
• Then allow duplicity do its normal backup it knows what to backup :) – George Udosen Dec 22 '16 at 9:06
• But I dont want to backup whole disk - I have data backups - documents, videos etc - I just want to be able to recreate the current ubuntu system in case of a disk crash - if I have to backup 500 GB every time I dont have enough storage – kerry Dec 22 '16 at 9:38
• Then your question should be creating system image, then something like clonezilla would be useful. Note there are others also just make your choice. – George Udosen Dec 22 '16 at 10:06
• So can anyone actually tell me how to create a bootable re-installable copy of my existing ubuntu operating system with current drivers and apps - thanks for your help George but 'something like clonezilla ' or 'there are others also just make your choice' is not that helpful – kerry Dec 23 '16 at 1:22

You should create a disk image of your entire hard drive.

This has to be run from a live CD or USB.

NOTE: You will need to install Disks, if it isn't already installed. You can install it with sudo apt installgnome-disk-utility

1. Open Disks. Either open it from the dash, or type gnome-disks into the terminal.
2. Select your hard drive from the panel on the right.
3. Click on the cog in the top right corner.
4. Select Create Disk Image....
5. Choose the location for the Disk Image. NOTE: The disk image will be the size of your whole hard drive. The location that you are saving the image has to be on an External Hard Drive or USB that is bigger that your Internal Hard Drive.

To use this image, reopen up Disks on your Live CD or USB, follow the steps for creating a disk image, but instead of selecting Create Disk Image... you have to select Restore Disk Image....

• The thing is I expressley DO NOT want an image of the whole disk - it will not fit on a DVD or usb stick, also when things change I will need to create a whole new image. As the question states I have a separate data backup, I have a LiveCD of initial system. I have explained clearly what I need in the question but will edit to include what I do not want - thank you for your advice but not applicable in my case. – kerry Jun 10 '17 at 5:05
• Do you want all of the files? From the root? – user689314 Jun 10 '17 at 5:07
• Thing is - I don't know - what I want is all files / folders restore my applications, settings, drivers etc. I have the original system on LiveCD so reinstalling original is easy. Its all the stuff that changes daily - applications, drivers, preferences etc – kerry Jun 10 '17 at 5:15
• So the entire OS, but not the whole disk? – user689314 Jun 10 '17 at 5:16
• What about creating an image of just the / partition – user689314 Jun 10 '17 at 5:55

I use clonezilla http://clonezilla.org
It lets you create a complete copy of your system to an external drive. It also only copies what you need so you won't have a backup the size of your disk every time.

Clonezilla runs from a liveCD

It is really easy to use for both save and restore, just follow instructions or watch a video demonstration

• Can I copy to an internal drive? and could I combine it with my original Live CD installation so I just restore changes since then as I have tried solutions like this before and things did not go well. It lost my login and password, other attempts lost apps and drivers. Really I want to install my original system from my original LiveCD. Then backup restore the changes since then. Problem is only way to test it is to do it, and when Ive done that in the past it's messed up my system. – kerry Jun 10 '17 at 5:24
• You can copy to an internal drive, as long as it is different from the one you are backing up. This creates a complete image of the system, upon restore, everything will just like it was when the system was backed up. Including everything. I have used it many times with Ubuntu, and it saved me a huge amount of time. Every time I want to try some 'shady' installation process, I create a backup. If something goes wrong, I restore and get right back to where I started. – amanusk Jun 10 '17 at 8:31

Homefolder backup in conjunction with apt lists

#!/bin/bash
sudo apt-get update
xargs -a <(awk '/^\s*[^#]/' "/home/$USER/aptlists-folder/myapt-getlist1.txt") -r -- sudo apt-get install  && install scripts for sources #!/bin/bash cd /home/$USER/mysourcesscriptsdir
`