Score:0

Used P2V to reduce size opf LVM VHDX - Issues with grub and booting now

ph flag

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

djdomi avatar
za flag
restore the latest version of the vm from the backup
jm flag
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?
Chayne avatar
ph flag
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
Score:0
ph flag

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 avatar
cn flag
What does "complete failed clone" mean in step 1?
Chayne avatar
ph flag
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.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.