converting rhel 7 disks to virtual machine

This is for discussing general topics about how to use VirtualBox.
Post Reply
echoman2
Posts: 8
Joined: 14. Apr 2016, 18:46

converting rhel 7 disks to virtual machine

Post by echoman2 »

I had server running rhel 7 suffer a hardware failure. I need to convert the machine to a virtual one. I know the data is ok as I was able to mount both partitions and read the data. I then took a snapshot of the whole disk and it looks readable. I split out partitions to individual img files. converted them to vdi and they are still readable but I can't boot from root partition. I'm not at the system right now so I don't have the exact error message but it was something about not being marked as boot-able.

any suggestions on this kind of recovery p2v?


disk image partition table.
hdx.img1 * 2048 2099199 2097152 1G 83 Linux
hdx.img2 2099200 3905945599 3903846400 1.8T 8e Linux LVM
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: converting rhel 7 disks to virtual machine

Post by mpack »

Are you asking for suggestions on how to make it bootable? If so then the easiest way would be to start from the original backup before you fragmented it. Working out what your OS requires from the various fragments would not be fun.

It's unclear to me what you have. Is it a backup or just the older server drive?

If the latter, put it in a caddy, attach it to a Windows PC and create a Macrium image of it. Then run the Macrium recovery software in a VM and "restore" the Macrium backup into the VM (I like to extract the Macrium recovery CD/stick into a host PC folder, place the image file to be restored in the same folder, and point the VirtualBox "virtual ISO" feature at the whole thing: that way I don't need to worry about access USB or network while booted from a recovery CD with limited functionality).

If you have a backup, rather than the physical drive, then likewise: run the appropriate restore tool in a VM.
echoman2
Posts: 8
Joined: 14. Apr 2016, 18:46

Re: converting rhel 7 disks to virtual machine

Post by echoman2 »

Yes, I am looking for suggestions on how to make it bootable. I have the physical drive and it is a linux OS drive (Red Hat Enterprise Linux), not windows, Windows does not see the drive which is why some of the p2v tools do not work and why macrim probably won't work either.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: converting rhel 7 disks to virtual machine

Post by mpack »

Yes, I'm aware of what RHEL means.

Macrium does recognize EXTx partitions for backup and restore purposes so that isn't a problem. The only thing Macrium can't do is mount an EXTx backup on a Windows host for individual file access purposes, because that feature relies on the Windows host filesystem code, so is limited to filesystems supported by Windows.
echoman2
Posts: 8
Joined: 14. Apr 2016, 18:46

Re: converting rhel 7 disks to virtual machine

Post by echoman2 »

thank you for clarifying. how is macrum images different from dd images?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: converting rhel 7 disks to virtual machine

Post by scottgus1 »

Different formatting, different source programs, same concept. dd doesn't run natively on Windows. Macrium doesn't run on Linux. Macrium comes with a restore ISO that can boot a computer for recovery. dd might require a Linux LiveCD ISO, or it may have a restore ISO. Use the tool you're most used to, but the process is the same:

Put the rhel drive in a caddy, and image the whole drive. Mpack suggests copying the contents of the restore ISO to a folder on the host computer, then putting the image in the folder too, then using a Virtualbox VISO to put the whole shebang in the VM's CD drive. If you find that the copied ISO does not boot the VM, here is another option: Add another CD drive to the VM, Put the restore ISO in the VM's first CD drive, then put the image in a VISO in the second CD drive. Then using either method, boot the VM and restore the image to the VMs hard disk. Reboot, then get the restored VM running.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: converting rhel 7 disks to virtual machine

Post by mpack »

echoman2 wrote:how is macrum images different from dd images?
The main difference is due to Macrium being relatively smart, and dd being as dumb as a plank of wood. So Macrium (by default) will not include unused sectors in the copy, the copy will be compressed (both together alleviate some of the issues involved in transporting humungous files), and the Macrium recovery tool will automatically handle most differences (e.g. drive size, partition types too perhaps) between the PC that was backed up, and the PC you restore the backup onto.

Both have free versions, so it isn't even a contest of economics.

The only negative for Macrium is that it uses a proprietary format, which could be an issue if the backup is expected to be valid for a very long time, like decades. For protecting against hardware failures (<1 year) it's ideal. For P2V it's almost ideal (ideal would mean an option to restore directly to a virtual drive file on a host).
Post Reply