01.2013, debian 6.0.6

i used this procedure to backup and restore / move a linux based citrix xen vm to virtualbox. (acronis linux-full version made problems, windows/dos version was controlable but can only sector-copy a linux partition)

on the system that you want to backup you:

1. make shure you are root (#)

su

or

sudo bash

2. go to the root directory of your system

source: https://help.ubuntu.com/community/BackupYourSystem/TAR

cd /

3. find out what is the uuid if your partitions


root@sourceServer:/# blkid
/dev/sda1: UUID=”46dd30aa-30d3-4e55-9a68-332d267227fb” TYPE=”ext4″
/dev/sda5: UUID=”05b0a62c-a61b-423e-b55c-6dec2cc3d1fc” TYPE=”swap”

save this to file:

root@sourceServer:/home/canoodle# blkid > blkid_source.txt

4. backup the system with tar

tar -cvpzf backup.tar.gz –exclude=/backup.tar.gz –exclude=/proc –exclude=/lost+found –exclude=/sys –exclude=/mnt –exclude=/media –exclude=/dev /

5. install miniaml debian linux on target system with ssh server

http://ftp.hosteurope.de/mirror/ftp.debian.org/debian-cd/6.0.6/amd64/iso-cd/debian-6.0.6-amd64-netinst.iso

list of debian iso mirrors:

http://www.debian.org/CD/http-ftp/#mirrors

aptitude install ssh

passwd

-> give your root a password

6. scp backup.tar.gz root@targtSystemIP:/

( i recommend to have a copy of the backup.tar.gz. also somewhere else than the target system, just in case something goes wrong during the restore !!! do not immediately delete it from the source system )

restore backup

NOW JUST TO BE SHURE MAKE A SNAPSHOT OF YOUR TARGET WITH VIRTUALBOX
(so you can restore and correct if things won’t boot,go wrong, for some odd reasons if you abort the operation the backup.tar.gz IS ZERO!)

7. nohup tar -xvpzf /home/test/backup.tar.gz -C / &

(nohup = run also if session expires, & = run it as a job in background, so you can keep on doing some work)

recreate directories that were not backuped

8. mkdir /proc /lost+found /sys /mnt /media

DO NOT REBOOT NOW!

9. relabel (UUID) your root hd

(now that the backup is restored you can also check in

vim /boot/grub/grub.cfg

check with

blkid

what names the partitions have

tune2fs /dev/sda2 -U ‘46dd30aa-30d3-4e55-9a68-332d267227fb

or boot will fail like this

NOW JUST TO BE SHURE MAKE A SNAPSHOT OF YOUR TARGET WITH VIRTUALBOX
(so you can restore and correct if things won’t boot,go wrong)

VirtualBox Sicherungspunkt erstellen

also check that settings in fstab are correct
root@debian64template:~# blkid
/dev/sda2: UUID=”1b440b8f-9842-4e9d-b678-eabfd1f89484″ TYPE=”ext4″
/dev/sda3: UUID=”15b17cae-f290-4b59-92b6-09860dfa4d19″ TYPE=”swap”

fstab

10. after restore you will have to insert a linux-rescue-cd and make a fsck on your root device

i can really recommend knoppix,

download the iso: http://www.chip.de/downloads/Knoppix_13013232.html

it also “shows off” what a linux desktop can look like.

insert the iso into the virtual cd rom drive of your virtualbox target system and boot up to the desktop.

open a terminal window

hit

blkid

then when you know what is the root device

fsck -y /dev/sda2

knoopix fsck

 

now type

reboot

and hold your thumbs tight…

debian restored

WOHOOO! DEBIAN COMING FROM CITRIX XEN, NOW BOOTING INTO VIRTUALBOX!

and because this was a lot of boring text: BattleWrap

407764_548581388490174_1272029060_n

































liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin