0

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

user1865341
  • 291
  • 1
  • 3
  • 7

3 Answers3

1
  • 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
Stone
  • 6,941
  • 1
  • 19
  • 33
0

Of course first of all you need to install fresh centos-6.4 and then untar backup.tgz

ALex_hha
  • 7,025
  • 1
  • 23
  • 39
0

This started life as a comment but grew too long.

If you untar directly over the system you are running in, it will most likely crash when you overwrite libraries, so you'd need to experiment with excluding various system directories. It would also probably not boot afterwards owing to wrong device paths and missing drivers.

As ALex_hha says, your best plan might be to install a fresh copy of Centos, then selectively restore non-system directories. Or boot your VM off an external iso image, or mount it to another VM, then untar but you'd face the same device problems.

For the future, read up on AWS's VM export, Vmware's Converter, and so-called p2v generally.

ramruma
  • 2,730
  • 1
  • 14
  • 8