0

Hi All hoping for some Linux genius advice

I inherited a VMWare VM cluster with a few production VM's

they were all way over provisioned and all have 1tb Thick drives

But are only using 100gb odd each

I want to reduce the size of the VHDX but with it being lvm it is proving tricky

I have used P2V to "move" a test vm on the same host but with a smaller vhdx,

The process went fine until +-97% (which i have read is common)

but now my vm doesn't boot is says

Error Loading operating system.

Below are screenshots of the blkid and fstab and the grug.cfg of the mounted partitions on the broken VM

Here is the grub.cfg file - https://justpaste.it/9ks66

fstab of mounted vm drive - https://i.stack.imgur.com/IKmWF.jpg

blkid - https://i.stack.imgur.com/UgS08.jpg

I know i need to update fstab with the new uuid's but i just don't know which one to use.

Also how do I recreate grub? Can i use somethign like supergrub2 or do i have to go through grub file and manually change uudi?

Any advice or assistance would be greatly appreciated

Chayne
  • 1
  • 1
  • 1
    restore the latest version of the vm from the backup – djdomi Apr 03 '23 at 15:18
  • Did you shrink the partitions and file systems on the original VM before trying to P2V? You do not need UUID's in fstab to mount the partitions. If you know the device names (/dev/sda1 or /dev/mapper/vg0-root) you can mount using them. Finally, did you try booting from a live cd to see if your partitions and data are present and complete? – doneal24 Apr 03 '23 at 18:41
  • Hi, I did not manually shrink the partitions i left all that to P2V I have mounted both the /dev/sda and the dev/mapper partitions from a live cd and the data is present all seems to be there except it doesn't boot – Chayne Apr 04 '23 at 07:46

1 Answers1

0

I figured it out This solution is only valid for LVM systems

  1. carry out the clone operation and let it fail at 97%
  2. boot failed clone to live cd
  3. mount file system
  4. run in terminal pvdisplay & vgdisplay & lvdisplay & blkid to get the new UUID of your system
  5. edit fstab and boot.cfg and replace the current UUID with the new ones you got in the previous step ( i ran the same commands on the old system for cross reference)
  6. boot new system with supergrub2 iso this should get you into your "new" VM
  7. run sudo grub-install /dev/dsa
  8. run sudo update-grub

System should now boot without issue

Daniel K
  • 649
  • 1
  • 4
  • 16
Chayne
  • 1
  • 1
  • What does "complete failed clone" mean in step 1? – Daniel K Apr 13 '23 at 15:44
  • When using VMware convertor, the conversion process will get to 97% and fail, stating some sort Grub failure. all has been cloned and is accessible but there is a broken grub boot loader the following steps are to fix that. – Chayne Apr 14 '23 at 16:04