1

I'm having a bit of trouble porting my Linux physical partition to a VDI for running it in VirtualBox. First of all, Linux Mint Petra was on the same HDD as my Windows 7 and I was able to dual-boot fine. But then I wanted to port the Linux partition to a virtual drive.

I tried resizing it using EaseUS before porting, which is probably what messed some settings, I would suspect. However I successfully performed a backup of the partition using EaseUS (PBD file); converted it to a VHD file and finally, converted the VHD file to VDI.

Now, when I try booting from the VDI/VHD, I get an error: Missing operating system. FATAL: INT18: BOOT FAILURE.

When I boot from Linux ISO I see this in the partition section:

enter image description here

As you can see, there are two devices there: sda1 and sda5; the latter seems to be overlapping the former, which shouldn't be the case. I can confirm that /dev/sda5 was the correct physical partition when dual-booting.

I tried repairing things using Boot Repair Disk, but to no avail.

How do I ensure that VirtualBox successfully locates the OS device/partition and fix the /dev/sdXY overlap?

Cheers

4
  • I would repair the Grub installation on the vhdd.
    – Ramhound
    Commented Jun 20, 2014 at 11:00
  • Likw I said, I already tried that using the Boot Repair Disk. Didn't work. Commented Jun 20, 2014 at 11:02
  • When you view the contents of the vhdd do you see what you expect? You need to be specific when you say you tried the boot repair disk.
    – Ramhound
    Commented Jun 20, 2014 at 11:06
  • I booted from the repair disk and just clicked "Repair" which was recommended to be the fix to most issues. It didn't help. When going into "Computer" and trying to double click the "VDI drive" resulted into an error saying it couldn't be mounted or something rather. Commented Jun 20, 2014 at 11:07

1 Answer 1

1

Ok so I figured it out with some help from a friend. At the time of my issue I had the physical partition in a 50gig VDI file, which was not booting due to the error mentioned in the OP. The used space on the drive was 20gig, which included my Linux install + my files. I managed to not only boot it up again, but resize the 50gig partition to 20gig in a new dynamically allocated VDI drive.

To fix, I created a brand new VM (let's call it hurrdurr) with dynamically allocated drive of max size 35gig and I proceeded to load Linux Mint from the install ISO. I loaded up Gparted using superuser (sudo gparted) and proceeded to do the following:

  • Created 512MB ext2 partition with label "boot"
  • Created 8192MB swap partition with label "hurrswap"
  • Created 28gig ext4 partition using the remainder of the space with label "derp"

Then, I installed Linux Mint on the virtual drive. When it asks what you want to do, eg Erase disk and install Mint/Ubuntu (this will wipe the drive)/install alongside /Something else, choose something else. It will load up a Gparted-style section where you get to see the partitions of your drive. I double clicked the "boot" partition, checked the Format box and made sure the mount point was /boot. Then for the swap area I just left it the way it was (note, I chose to have an 8gig swap area because I has 8gig of rams on this machine and it's usually good to have the swap size equivalent to your installed ram) and for my ext4 partition, I made sure the format box was checked and the mount point was "/".

I installed Mint and this effectively configured the boot and the GRUB and the everything for me. Now it was time to overwrite the fresh install with my old one, because this way GRUB will know where to look to boot! So now, in a separate VM I configured VirtualBox to use the two virtual drives; the big 50gig partition and the fresh-install dynamically allocated one. I did this by going into Settings -> Storage -> Controller - IDE -> Add Hard Disk. This allowed me to select the two other VDI files. Then I booted into this separate install.

Using sudo fdisk -l I could tell which /dev/sdWX and /dev/sdYZ to load in order to mount the fresh "derp" partition and the partition I wanted to copy over respectively. I used sudo mount /dev/sda5 /mnt/drv1 (I mkdir'd the drv1 befhorehand) and sudo mount /dev/sdb3 /mnt/drv2 (the "derp" partition). Now, here you can copy stuff over in two ways: One is with dd, which completely clones your partition with empty space. But I used the simple copy command cp to transfer my desired data + Linux from the 50gig partition. The command I used was sudo cp -a /mnt/drv1/* /mnt/drv2/ the -a is to tell cp to transfer all the files with all attributes intact. Once that transfer was done, I just booted in my hurrdurr VM and voila - GRUB successfully booted from that partition that I wanted to recover! Not just that, but because it's a dynamic drive, it's only 20gig as well.

So in essence (tl;dr if I may):

  • Create new VM with correctly assigned partitions
  • Install the OS that was on the damaged drive
  • Boot up a VM which has access to both the damaged virtual drive and the new fresh install one
  • Mount the damaged and the fresh partitions
  • sudo cp -a the files over to the fresh install
  • Done.

I hope this helps someone like me out there.

Cheers

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .