Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using Ubuntu 12.04 Server. I am totally new to Ubuntu and I want create a backup of my full operating system and restore it to another system or the same system.

Could you possibly to explain the step by step process to make a backup and restore it?

share|improve this question

3 Answers 3

Image type backups have several problems:

  1. They can not do daily/incremental backups
  2. Most of them can not extract an individual file or set of files you realize you deleted/overwrote
  3. They can not restore to a disk that is smaller than the original, even if there was plenty of free space
  4. Restoring to a larger disk often requires extra steps to make use of the additional space

It is best to to stick with the tried and true methods: tar and dump. I use dump because it is much faster at backing up and extracting individual files than tar, and handles incremental backups better. It also uses multithreaded compression, which is nice on today's multi core machines. Either way, when making the backup, you need to shut down your services to make sure no files are being written while you make the backup. If you use LVM then you only need to do this long enough to make a snapshot, then you can bring your services back online, and backup the snapshot. Here is the script I have cron automatically run every night:

#!/bin/bash
set -e
declare -a LEVELMAP=(1 5 4 5 3 5 4 5 2 5 4 5 3 5 4 5 1 5 4 5 3 5 4 5 2 5 4 5 3 5 4 5)
DATE=`date +%-d`
LEVEL=${LEVELMAP[$DATE-1]}
echo Performing a level $LEVEL dump
#shutdown services here
sync
lvcreate -s -n snap devserv/root -L 500m
#start them back up here
dump -$LEVEL -quz9 -b 1024 -f /backup/dump.$LEVEL /dev/mapper/devserv-snap
lvremove -f devserv/snap

I make a level 0 ( full ) dump usually every ~6 months when I upgrade the server, then this script makes a level 1 dump ( all files changed since level 0 ) on the 1st and 17th of the month, and alternates between level 2-5 the rest of the days.

This means to restore the system I have at most 5 dumps to restore, sometimes less ( if the server dies right after the level 1 dump then you just need to restore the level 0 and 1 ), and I have several dumps stretching back over the last days, weeks, months I can go pull an old file out of if I need to, possibly multiple versions of it as it changed at different points.

If you don't care about having multiple points to go back and pull older files out of, a simpler alternative is to do a level 0 once every 6 months, level 1 every Monday, and level 2 every other day of the week.

share|improve this answer

You can use programs such as Clonezilla It looks like Acronis and true image for windows http://clonezilla.org/ tutorial for clonezilla can be found here.

share|improve this answer

You can also look into Redo backup. It also makes a complete image like CloneZilla. I prefer it cos it is faster and more user friendly in approach. You can find info on it here : http://redobackup.org/

share|improve this answer

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.