[PLUG] Grub 0.97: convert VM with two disk to VM with single bootable disk

Robert Citek robert.citek at gmail.com
Tue Apr 23 22:05:36 UTC 2019


Greetings,

How can I turn a VM with two virtual disks into a VM with a single virtual
disk that boots?

I have a VM with two virtual disks, running CentOS 6.10.  The first disk
(vda) has the MBR and all the boot files, i.e. vda1 is eventually mounted
at /boot.  The second disk (vdb) has an LVM partition at vdb1 and contains
three LVs: lv_root (/), lv_home (/home), and swap.  What I want is a single
disk (e.g. vdy) that contains all the files on a single partition (vdy1)
and can boot.  And I almost have that.

That is, I detached all the disks from the original VM, created a separate
temporary VM with a new disk (vdy), and attached and mounted the disks from
the original VM.  I then partitioned, formatted, and mounted vdy1 at
/mnt/vdy1/.  All the lv_root files were copied to /mnt/vdy1.  All the
lv_home files were copied to /mnt/vdy1/home.  And all the /boot files were
copied to /mnt/vdy1/boot.  Given that the system is CentOS 6.1 and runs
grub 0.97, how can I install Grub at vdy from this temporary VM?

I imagine I have to modify /boot/grub/device.map, /boot/grub/grub.conf, and
/etc/fstab on the /mnt/vdy1 filesystem, and then run some grub commands.

Thanks in advance for any pointers and guidance.

Regards,
- Robert



More information about the PLUG mailing list