4. Lintop – Safety first – Automated backup with Clonezilla booting from USB drive

Lintop is a post series related to my linux desktop

full course
  1. 1. Lintop – A new world – Linux desktop based on ASRock Q1900m µATX
  2. 2. Lintop – long live the Queen or “GO Ubuntu”
  3. 3. Lintop – One keyboard/mouse to rule them all – Synergy-project.org
  4. 4. Lintop – Safety first – Automated backup with Clonezilla booting from USB drive

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.

Environment:

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

Backup_USB_drive

 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:

Connect your USB drive and use “disks” tool to create a partition with FAT file system. Mount it.

format_usb

Run tuxboot (Version 0.7)

The default settings worked for me.

!!! Choose the right USB device !!! /dev/sdc in my case.

tuxboot-config tuxboot_done

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.

Example:

grub_cfg

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.

Done.

Go CEPH.

 

 

 

One thought on “4. Lintop – Safety first – Automated backup with Clonezilla booting from USB drive

  1. Vasile M.

    Hello,

    You are using a static device identifier (sda and sdbX) and its very dangerous because if you are booting from the USB (hdd or memory stick) the same BIOS is changing the USB from sdb to sda.

    You should to make 3 scripts to run before starting a clone or restore.
    -script 1 -> prerun.sh (ocs_prerun=prerun.sh). This script should find the external partition and mount it. (If is neccesarry can mount a binded folder to /home/partimag)
    -script 2 -> run_savedisk.sh (ocs_live_run=run_savedisk.sh) -> find the windows/linux hard drive and make a clone
    -script 3 -> run_restoredisk.sh (ocs_live_run=run_restoredisk.sh) -> find the windows/linux hard drive and restore a clone

    With this universal way you can have a USB to create clone and restore automatically.

Leave a Reply

Your email address will not be published. Required fields are marked *