Can't get P2V cloned partition to boot

Questions about virtualization software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
UrbanSatyr
Level 1
Level 1
Posts: 28
Joined: Sun May 19, 2013 11:47 am

Can't get P2V cloned partition to boot

Post by UrbanSatyr »

Hello all,
I use phatch for photo batch processing and since it's been abandoned none of the newer Linux versions will run it. So I have an old Linux Mint 18.3 partition on a second drive that I boot into for phatch. It is slow and annoying to have to reboot so I wanted to convert it to a virtual machine. I tried making a fresh install of Mint 18.3 as a VM in VirtualBox but phatch won't install properly for some reason. So the only way I can get phatch working is to clone the partition.
I used dd to copy the partition to an image file as thus:

Code: Select all

dd if=/dev/sdb3 of=imagefile.img bs=128K conv=noerror,sync
511640+0 records in
511640+0 records out
67061678080 bytes (67 GB, 62 GiB) copied, 163,087 s, 411 MB/s
Then I converted the image to a vdi file as so:

Code: Select all

VBoxManage convertfromraw imagefile.img imagefile.vdi --format VDI
Converting from raw image file="imagefile.img" to file="imagefile.vdi"...
Creating dynamic image with size 67061678080 bytes (63955MB)
Then I created a new virtual machine in VirtualBox, set it to Linux, Ubuntu 64-bit, and used the imagefile.vdi that I just converted.
When I try to boot it says "FATAL: No bootable medium found. Halted."
If I use a SuperGrub live cd it finds all the normal grub entries and boots the system just fine. And if I try to update or install grub it shows it working fine. But when I reboot the system without the live cd it just posts the "No bootable media" again.
When I boot into a Mint livecd it shows the partition as /dev/sda ext4 but no OS devices like /dev/sda1 or swap or whatnot.
Gparted doesn't seem to have a partition table listed and won't allow any flags to be set to it.
I tried to resize the partition to allow space to put in a small partition to install a partition table and grub to in case that was the issue, but after resizing sda the dynamic resizing takes over and absorbs the space I just made so I can't make a second partition.
I tried using a Boot Repair live cd but the "Recommended Repair" button just doesn't even exist when I boot into the disk.
Phatch still works in it so in the meantime I can still use the VM with supergrub but I'd like to fix this if possible. I also still have the original partition so if I have to remake the VM with advice from you all that is ok too. Thanks for any insight you can give!
Last edited by LockBot on Sat May 20, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
deck_luck
Level 7
Level 7
Posts: 1577
Joined: Mon May 27, 2019 6:57 pm
Location: R-4808 North

Re: Can't get P2V cloned partition to boot

Post by deck_luck »

UrbanSatyr wrote: Sun Nov 20, 2022 11:01 am ...
So the only way I can get phatch working is to clone the partition.
I used dd to copy the partition to an image file as thus:

Code: Select all

dd if=/dev/sdb3 of=imagefile.img bs=128K conv=noerror,sync
511640+0 records in
511640+0 records out
67061678080 bytes (67 GB, 62 GiB) copied, 163,087 s, 411 MB/s
Then I converted the image to a vdi file as so:

Code: Select all

VBoxManage convertfromraw imagefile.img imagefile.vdi --format VDI
Converting from raw image file="imagefile.img" to file="imagefile.vdi"...
Creating dynamic image with size 67061678080 bytes (63955MB)
The new .vdi is expecting a physical disk clone image, however your dd command is only cloning one partition. Without a physical disk clone you will not see a partition table. Your dd command should use the "if=/dev/sdb" argument to produce a physical disk image file. What is your reasoning for using /derv/sdb3. Without understanding the full scope of your needs and proper details, it would be premature to make any further cloning method suggestions.

For further assistance please post the output from the following commands:

Code: Select all

sudo df -hxtmpfs
sudo lsblk -f
sudo fdisk -l
The "-l" is the letter and not the number one. The code tag font represents the letter l and the number one as the same character.
🐧Linux Mint 20.3 XFCE (UEFI - Secure Boot Enabled) dual boot with Windows 11

Give a friend a fish, and you feed them for a day. Teach a friend how to fish, and you feed them for a lifetime. ✝️
UrbanSatyr
Level 1
Level 1
Posts: 28
Joined: Sun May 19, 2013 11:47 am

Re: Can't get P2V cloned partition to boot

Post by UrbanSatyr »

Hi, thanks for the reply.
Host system is running Mint 20.3 Cinnamon.
Guest system is running Mint 18.3 Cinnamon.
The whole drive of /dev/sdb on the host machine includes sdb1 which is 189 GB of encrypted ext4 storage space with no OS. I don't have enough free room to clone the whole drive, which is why I only cloned sdb3.
On host the relevant fdisk output:

Code: Select all

fdisk -l
Disk /dev/sdb: 238,49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: OCZ-VERTEX4     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x12ec449d

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1            2048 368715775 368713728 175,8G e8 unknown
/dev/sdb3       368715776 450709503  81993728  39,1G 83 Linux
On the guest system after using super grub to boot:

Code: Select all

fdisk -l
Disk /dev/sda: 39.1 GiB, 41980788736 bytes, 81993728 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
It doesn't list any Disklabel, identifier, or device information.

On guest system:

Code: Select all

sudo df -hxtmpfs
Filesystem             Size  Used Avail Use% Mounted on
udev                   3.9G     0  3.9G   0% /dev
/dev/sda                39G   16G   21G  44% /
/home/master/.Private   39G   16G   21G  44% /home/master
/dev/sr0                16M   16M     0 100% /media/master/ISOIMAGE
Host system:

Code: Select all

lsblk -f
sdb                                                                   
├─sdb1
│    crypto       71d27a41-41fd-425b-9b0e-4816da790bda                
└─sdb3
     ext4         ae77a7da-d9b7-4e1b-ab99-fa50bcb262e8
Guest system:

Code: Select all

lsblk -f
NAME FSTYPE  LABEL    UUID                                 MOUNTPOINT
sr0  iso9660 ISOIMAGE 2019-08-26-06-55-07-00               /media/master/ISOIMAG
sda  ext4             ae77a7da-d9b7-4e1b-ab99-fa50bcb262e8 /
sr1
The layout of the lsblk output is different between the host and guest systems. Maybe due to the different OS versions?

If I need to I suppose I could try to Tetris the data from the storage partition sdb1 onto flash drives or something and delete /dev/sdb1 in order to dd the whole /dev/sdb. Would that fill the image file with the whole 256 GB including empty space or would it keep the image file at the ~40GB size?
User avatar
MikeNovember
Level 7
Level 7
Posts: 1856
Joined: Fri Feb 28, 2020 7:37 am
Location: Nice, Paris, France

Re: Can't get P2V cloned partition to boot

Post by MikeNovember »

UrbanSatyr wrote: Sun Nov 20, 2022 11:01 am Hello all,
I use phatch for photo batch processing and since it's been abandoned none of the newer Linux versions will run it.
[...]
Hi,

"phatch" is available as a snap, see https://snapcraft.io/search?q=phatch

Regards,

MN
_____________________________
Linux Mint 21.3 Mate host with Ubuntu Pro enabled, VMware Workstation Player with Windows 10 Pro guest, ASUS G74SX (i7-2670QM, 16 GB RAM, GTX560M with 3GB RAM, 1TB SSD).
Locked

Return to “Virtual Machines”