0

I have a physical CentOS 5.11 machine and I created a tar of it using:

sudo su
cd /
tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /

I created a Hyper-V virtual machine, installed CentOS 5.11 and restored the backup using:

 tar xvpfz backup.tgz -C /

Now the machine won't boot. This is the screen I'm confronted with upon boot: (sorry, I can't post images yet) https://imgur.com/a/ZVTIY

I've tried all sorts of reinstalling grub both from a CentOS recovery image and from third party disk recovery images, mkinitrd and so many other things that I can't even remember. I've hit a wall here. Does anyone know why this is happening and how I might fix it? Thanks.

Edit: I've posted the contents of grub.conf, menu.lst, fstab and lvdisplay in the comments. I'm unable to post them here as I don't have enough rep points.

Edit 2: I solved this issue! Thanks to everyone in the comments for your assistance. It was seriously appreciated.

To resolve the problem I booted into a Fedora live cd and mounted my file systems as I mentioned in the comments. Once mounted I issued the following: mkinitrd --with=hid-base-hv --with=hid-hyperv --with=hv_utils --with=hv_vmbus --with=hv_storvsc --with=hv_netvsc /boot/initrd-2.6.18-408.el5.img 2.6.18-408.el5 -f Then I rebooted the machine and it came alive.

  • 1
    can you add your grub.conf, boot/grub/menu.lst and /etc/fstab? It seems like there is a missing label or option mismatch? Did the physical have the same kernel as the VM? – Tux_DEV_NULL Sep 22 '17 at 07:31
  • Plus add your LVM info. – fuero Sep 22 '17 at 11:15
  • @Tux_DEV_NULL I booted to a Fedora live cd and followed up to step 5 from here to mount the drive: [link](https://goo.gl/kxj5x4) When I look in /etc this is what I see for grub.conf [grublink](https://imgur.com/a/dFc7N) And here's the contents of grub.conf [grub contents](https://imgur.com/a/pFcy9) Here is the contents of boot/grub/menu.lst [menu.lst](https://imgur.com/a/p1CfJ) And here is the contents of /etc/fstab [fstab](https://imgur.com/a/dXRyt) I'm researching how to answer the kernel question you asked. Thanks for the help – TheKoolestIP Sep 22 '17 at 15:35
  • @fuero Here is the contents of lvdisplay. If you were referring to anything different please let me know. [lvdisplay](https://imgur.com/a/rkAtQ) – TheKoolestIP Sep 22 '17 at 15:51
  • @Tux_DEV_NULL I run a "uname -r" on my physical and get 2.6.18-408.e15 but I can't do that from my vm as it's running off of a live image and it just keeps bringing back Fedora info. If I cat /etc/redhat-release I get CentOS release 5.11 (Final) on both machines. – TheKoolestIP Sep 22 '17 at 16:04
  • It looks like it can't find your volume group, which makes me wonder if the kernel has the right module for accessing the disk exposed by Hyper-V. In Hyper-V, how is your disk image configured? Plain IDE/SATA or SCSI should be used. – Alastair McCormack Sep 22 '17 at 16:25
  • @AlastairMcCormack I booted to a Fedora live cd then 'mkdir /mnt/sysimage' and '/mnt/sysimage/boot'. Then 'mount /dev/VolGroup00/LogVol00 /mnt/sysimage' and 'mount /dev/sda1 /mnt/sysimage/boot'. After that 'mount --bind /dev /mnt/sysimage/dev', 'mount --bind /proc /mnt/sysimage/proc' and 'mount --bind /sys /mnt/sysimage/sys'. Finally 'chroot /mnt/sysimage' – TheKoolestIP Sep 22 '17 at 16:30
  • Sorry, new question. See above. Also `backticks` are your `friends` in comments :) – Alastair McCormack Sep 22 '17 at 16:31
  • @AlastairMcCormack Sorry for the quote mess. I fixed it up. In Hyper-V, the disk is connected to an IDE Controller. – TheKoolestIP Sep 22 '17 at 16:35
  • Ok, let's assume the kernel can see the disk. Perhaps the kernel thinks the vg is foreign because of a systemid mismatch. Try clearing the systemid: Boot up with a live cd and issue: `vgchange --systemid "" VolGroup00`. There's no need to mount your filesystems – Alastair McCormack Sep 22 '17 at 16:45
  • @AlastairMcCormack I rebooted to a live cd and issued `vgchange --systemid "" VolGroup00` and received Empty system ID Supplied. Volume Group system ID is already "" – TheKoolestIP Sep 22 '17 at 16:52
  • @AlastairMcCormack I started investigating the kernel module thing you mentioned earlier. I did a `uname -r` on the physical and got 2.6.18-408.e15. On my vm I issued mkinitrd as in [this image](https://imgur.com/a/CpIVi) and got the no modules message. Edit: wait a second..I was using 1 when it should be l.. – TheKoolestIP Sep 22 '17 at 16:55
  • I think disk duplication `dd` will be more quickly than the time will spent for LVM recovery. You had deleted the new `/etc/lvm/lvm.conf` file by rewriting the old one. – Mikhail Khirgiy Sep 22 '17 at 18:29
  • @MikhailKhirgiy I understand `dd` should probably be used on an unmounted disk and that's my problem. I couldn't shutdown my machine for that long. – TheKoolestIP Sep 22 '17 at 18:40
  • @TheKoolestIP Then you need to move only those data what is really needed for your services. – Mikhail Khirgiy Sep 23 '17 at 05:59

0 Answers0