Categories
VMware

Restore Acronis backup image into VMware

Restore Acronis backup image into VMware

Issue/Problem:

Restoring the backup image into VMware (or somether dissimilar harddware) might not work. The kernel might not able to detect the hard disk or root volume. Error like “waiting for device /dev/sda3 to appear”

Solution:

The solution below is tested to work in openSUSE 11.1 in  vmware player

1. Boot with rescue mode of the install CD and log in with root rights

2. Partition Listing
cat /proc/partitions
fdisk -l /dev/sda


Sample:

device      mount point
/dev/sda1     /boot
/dev/sda2     swap
/dev/sda3     /
/dev/sda4     /home

3. Unlock encrpted partitions (perform this if you have encrypted partition with LUKS
cryptsetup luksOpen /dev/sda3 root

4. Make the swap available
swapon /dev/sda2

5. Mount your file systems
Mount root file system
mount /dev/sda3 /mnt

Mount boot file system, if separate
mount /dev/sda1 /mnt/boot

Bind mount temporary file systems
mount –bind /dev /mnt/dev
mount –bind /proc /mnt/proc
mount –bind /sys /mnt/sys

Mount other partitions
mount /dev/sda4 /mnt/home

6.  Prepare and enter the new root
Copy your mounts and DNS resolution files (Optional)
cp /etc/mtab /mnt/etc/mtab
cp /etc/resolv.conf /mnt/etc/resolv.conf

Make the mount point the new root
chroot /mnt /bin/bash

7. Reload boot loader, if desired (Optional)

* Launch yast
* Navigate to System > Boot Loader
* Select boot loader installation
* Check Boot Loader Location > Boot from Master Boot Record

8. Include the nessesary drivers in /etc/sysconfig/kernel
to do this edit the section ‘ INITRD_MODULES=”…” ‘
ata_piix -> VMWare Mother board
mptspi -> VMWare lsi scsi
Example:
INITRD_MODULES=”processor thermal ata_piix fan ext3 edd mptspi”

9. Generate new initrd
cd /boot
mv initrd-<kernelversion> initrd-<kernelversion>.old
mkinitrd -d /dev/sda3

extra modules can also be added with the -m switch (e.g: mkinitrd -d /dev/sda3 -m mptspi )
more help on options : mkinitrd -h

10. Make sure the name of the created initrd is the same as stated in the menu.1st or that the initrd link points to the new initrd file.

11. Exit and reboot the system.

Note:
If using LVM:
# Executed “/sbin/vgscan”, then “/sbin/vgchange -ay” to make LVM volume/logical groups available
# Mounted my LVM-managed root dir via “mount /dev/mastervol/Suse10.1 /mnt”

References and Resources:

http://en.opensuse.org/Using_the_rescue_system_%28advanced%29

http://forums.opensuse.org/archives/sf-archives/archives-tips-tricks-tweaks/343785-good-things-know-when-imaging-linux-different-hardware.html