Linux – How to i restore linux backup on virtual machine

backup-restorationcentoslinux

I have made the backup of my linux OS in bacukp.tgz which is centos 6.4.
Now i want to create a new virtual machine vmware from it.

So do i first need to install centos form cd or iso and then i overwrite all the files with backup or is there any way i can directly start with backup.tgz

Best Answer

  • boot a LiveCD, any Linux Distro is OK.
  • partition the disk
  • mount your partition (for example to /target)
  • mount your other partitions under /target if you plan to have separate /boot, /var, or any other partitions
  • copy your backup to /target
  • mount /dev, /sys, /proc with bind mount to the /target

    mount -o bind /dev /target/dev
    mount -o bind /sys /target/sys
    mount -o bind /proc /target/proc
    
  • chroot into /target

     chroot /target
    
  • install grub

  • reboot into your restored system