Author Topic: useful Clonezilla how-to  (Read 3456 times)

Offline ElCuervo

  • Hero Member
  • *****
  • Posts: 4147
  • I'm walking on sunshine!
"If there were no change, there would be no butterflies" - Walt Disney

http://linuxcounter.net/cert/433721.png

Offline Phil

  • Hero Member
  • *****
  • Posts: 768
Re: useful Clonezilla how-to
« Reply #1 on: November 30, 2010, 10:19:51 AM »
Sorry to say does not quite work out........(I thought I had recovered my system but parts of it still do not work, eg KPM no longer exists on my system and cannot be found, although top does)

Clonezilla makes it easy to clone the root system partition, it is more difficult to recover a system properly.

A synaptic update will also effect the /home directory, so this needs to be recovered, including any data stored there (eg kmail mail directory buried deep in .kde4) .kde4 is a critical item and needs multiple backups, easy to foul up.

I used to clone my / partition and use rsync to backup /home and any data files. May not be the right way.

I now think perhaps a combined root partition encompassing the system and /home directories is needed to do a proper recovery, due to all the config files in /home. The / and /home bits need to be of the same time, the same point when the synaptic update was applied to both of them. If an update effects the /home partition a few weeks after a the / partition has been cloned there seems to be a problem.

A recent update caused my mic to stop working, problematical sound card on mainboard. I have mostly recovered with a combination of clonezilla and rsync, but I have some issues. Waiting for a usb sound dongle and may then try another update.


Clonezilla backup - easy - from memory fire up the disk, select the target place to save your image (for me my backup partition is sdb5), select beginner options, select saveparts to save a particular partition of a disk, select partition to be cloned which for me is sda1. Thats it, easy.

Clonezilla recovery - CARE - not so easy. If you go the beginner route you end up with a borked grub and problems in booting the system.

For recovery select EXPERT option, initial target is where you have saved your image, for me sdb5, you select recoverparts as you are recovering part of a disk, target for me is sda1, and to get back exactly as before you must select:

NO reinstall grub
NO NTFS fiddling
NO resize


Then all is well and the system will boot as before.


If you get:

Grub loading Stage 1.5

Grub loading please wait........................................(and thats it)

In the words of the book "Don't Panic", it means that grub is borked.

Grab and boot from a live cd, log in as root, find the partition with grub on it (in my case sda1), find the file /boot/grub/menu.lst

Remove anything referring to UUIDs as they will be wrong. Only have the lines pointing to files, nothing else.

Then open a root terminal:

grub
grub> find /boot/grub/menu.lst
grub> find /boot/grub/stage1

For me I get the answer (hd0,0), yours may differ

Then for me:

grub> root (hd0,0)
grub> setup (hd0)

Now retry to boot, if menu.lst is ok you will boot. Once done go to PCC, boot item, go through it, save and it will re-do the UUIDs properly for menu.1st


Synopsis - I think to use clonezilla to properly recover your system you need to save a partition with both / and /home which have been updated by synaptic at the same time. If not you are likely to encounter problems as I am. For data rsync is good. However, I also have my mail directory in my /home directory and I also have some data files on my desktop. I therefore need to regularly backup the data files there, which change frequently. The .kde4 is a directory which each user needs to back up multiple times, pain when it goes wrong.

If / and /home are on one partition and cloned at the same time I think recovery will be seamless. If /home has had synaptic updates after / then issues arise. Data needs to be done separately.

This is more difficult that I originally thought. Needs care and its easy to get it wrong. Clonezilla is good and does work, although the reversal recovery process needs particular care. You need to end up with an identical clone, otherwise broken grub. I re-iterate / and /home must have matching synaptic update times, otherwise issues arise. Data does not matter clone wise and can be copied back.

Roll on btrfs and rollback.....







 

« Last Edit: July 16, 2012, 06:41:49 AM by Phil »

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1517
  • In theory, theory=practice, in practice ???
Re: useful Clonezilla how-to
« Reply #2 on: April 28, 2011, 09:01:01 AM »

Clonezilla recovery - CARE - not so easy. If you go the beginner route you end up with a borked grub and problems in booting the system.


Tried a whole disk restore, the same whole disk even, and it borked the grub unexpectedly.
What you're saying is to restore you need expert mode and select not to restore the grub
and/or the mbr ?    It's like a partition restore at that point, not a whole disk.

THX.
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Offline Phil

  • Hero Member
  • *****
  • Posts: 768
Re: useful Clonezilla how-to
« Reply #3 on: May 03, 2011, 03:34:58 AM »
Hi,

With the part disk recovery in expert mode tell it not to mess with anything, put it back exactly as is, bit-by-bit:


NO reinstall grub
NO NTFS fiddling
NO resize
YES use dd to recreate partition

(Note I have not done a complete disk recovery, just a partial partition sda1 which has grub on it.)

Additional to original post

I am getting issues saving partial images, gripes about disk space on target receive partition. Reality is originating partition is "3% non contiguous" and it does not like it. For saving if an issue go to expert mode and select repair partition, job done.

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1318
Re: useful Clonezilla how-to
« Reply #4 on: May 03, 2011, 04:39:54 AM »
DRBL has just been included in the repos. Use it with care though and best place is to use it in a lab environment. This will do a full bare-metal backup and restore of entire systems over LAN.

That said:

1. Install DRBL from Synaptic
2. Setup DRBL either in Clonezilla box mode or Full DRBL (here just start by using Clonezilla box mode):
- Configure IP address on server (recommended: 192.168.1.100, mask, gateway and dns (for dns i normally just use 8.8.8.8)) then install by:
/opt/drbl/sbin/drbl4imp (menu entries are on its way - waiting in Dropbox to be added to repos)

these above instructions are only needed to be done once - DRBL is configured once and for all after this is done.

3. Start DRBL services by:
/opt/drbl/sbin/drbl-all-service start (menu entry is on its way also) - I sometime need to start services twice. Make sure your network card is active (i.e. UP - connected to a switch/hub or directly to other system by crossover utp-45 cable).
4. Tell DRBL to copy a system to server:
/opt/drbl/sbin/dcs (menu entry is on its way) - select 'Start Clonezilla' - save image in server - accept to split the files (do not use 0) - they will -not- be split (due to the large default size) - and accept to check the resulting image.
5. PXE boot the system to clone/backup - perhaps you need to activate LAN boot in bios - normally the F12 key selects boot media. You will be presented with the DRBL menu - just wait a couple of seconds or press enter. Watch as the system is copied over LAN to the server /home/partimag folder with the name you given it (default is current date and time, but insert a more informative name in the default name).

After this you will have an image ready to clone back, or clone back to around 250 systems simultaneously using multicast (i.e. this will take 10-20 minutes cloning -all- systems).

Clone/restore it back by:
1. Start services (drbl-all-service start) in the server if they are not started
2. Set DRBL in restore mode: /opt/drbl/sbin/dcs - select 'Start Clonezilla' - restore image. Select the number of systems you want to clone to at a time (clients to wait). You can restore from one to the number of clients you choose in setup, theoretically up to 254 at a time.
3. PXE boot the system(s) that is the target of the image. When the last system is PXE booted the restore process will begin to all clients at the same time

I have successfully cloned XP, Windows 7 and Linux (both ext3 and ext 4 systems). And this is FAST!

To turn things up a notch, you can setup DRBL to Full DRBL mode, this means that you can PXE boot clients to your server and each client has its own full Linux desktop. This is of course without touching the client harddisks at all. Possibilities are endless.

If anything goes wrong and you would try to start over, then just delete the contents of the entire /tftpboot folder as root: rm -rf /tftpboot/* and setup DRBL again,

post back if you have any issues,

just remember that drbl sets up a dhcp server that conflict with your normal dhcp server - this is why I recommend to run it in a lab environment,

enjoy,

cheers,
MBantz
 
« Last Edit: May 03, 2011, 04:56:09 AM by MBantz »