After I installed and setup some apps on my Lintop system like the sysnergy-project I thought: “What the hell happens if this installations for any reason may be corrupted?” I would need to setup everything again. This means hours of work and sometimes you even can’t remember how exactly you configured an app to get it to work. A backup would be great, or?
So but how to backup and what to backup? I read the Ubuntu community post about backupYourSystem.
I came to the conclusion that I need:
- an automated backup approach with as less manual interaction as possible
- full backup of the whole disk
- a backup into an image not a clone. So I save space and can have more than one backup
- a solution which can be booted via USB
and for this I decided to used Clonezilla.
- Lintop with Ubuntu 14.04.2
- USB Stick
- Backup USB drive with 1 TB capacity
1. Prepare a backup USB drive
I connected the backup USB drive to Ubuntu and created one big partition with the pre-installed gnome disks tool “disks”. I created NTFS as file system. You can choose any file system Clonezilla is able to mount.
2. Create a bootable USB stick with Clonezilla
There is a nice tool called Tuxboot which creates everything you need. So lets install it first.
I used these step for Ubuntu:
sudo apt-add-repository ppa:thomas.tsai/ubuntu-tuxboot
sudo apt-get update
sudo apt-get install tuxboot
Connect your USB drive and use “disks” tool to create a partition with FAT file system. Mount it.
Run tuxboot (Version 0.7)
The default settings worked for me.
!!! Choose the right USB device !!! /dev/sdc in my case.
In my case I am using the UEFI boot with Lintop so I am editing the /EFI/boot/grub.cfg
Open the grub.cfg with a texteditor (gedit for example).
(optional) set timeout=”30″ to a smaller value “5”
Copy and paste the menu entry from Clonezilla-EFI-boot-grub.cfg into your grub.cfg just before the first menu item
which should start like: menuentry “Clonezilla live (Default settings, VGA 800×600)”
and save the file.
So what are we doing here?
The most important parts are:
ocs_live_run=“ocs-sr -q2 -j2 -z1p -sc -p poweroff savedisk autoname sda”
This runs Clonezilla ocs-sr and use partclone (-q2) in first place to backup the device /dev/sda (Os disk in my case). -j2 means clone hidden data with dd, -z1p parallel gzip, sc skip the check, -p poweroff turns of the pc after the backup, savedisk means a whole disk, autoname generates a name for your backup image.
ocs_prerun=“mount /dev/sdb1 /home/partimag/“
This mounts the backup USB drive at /home/partimag which is a default location for the disk images used by ocs-sr.
For a complete list of Clonezilla ocs-sr parameter go here.
3. Run the backup
In my environment I’ll do backups before i stop working in my home office. So I restart my Lintop machine, put in the USB drive and go sleep. Lintop boots from the USB stick and automatically starts the Clonezilla backup to the backup USB drive. When it is finished it powers off.