LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Disk read error for Windows 7 partition (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/disk-read-error-for-windows-7-partition-882656/)

deesto 05-25-2011 01:03 PM

Disk read error for Windows 7 partition
 
I've converted a physical Windows 7 partition to an image file using `dd`, and can't get the partition itself or the image to boot virtually, via either virt-manager or kvm. Both fail on boot with the error: "A disk read error occurred."

Perhaps I've used a bad `dd` command, but I simply did: `sudo dd if=/dev/sdb7 of=my-w7-image.img conv=noerror`

Also tried converting the image to qcow2 format with `qemu-img` and that seemed to work (and the new image checks out without errors, though I suppose that means nothing if the original image is bad). I get the same error what booting this qcow2 image virtually.

I've tried to fix the boot loader with a W7 boot disc, and it wants an admin password that I don't have. I've also tried booting with other recovery discs, but they either don't find the disk or partition, or they don't think it's a bootable W7 partition.

jefro 05-25-2011 03:53 PM

I might be inclined to use a P2V app.

I have dd's many a distro over to a file. It is a raw file then and you can just use it like that to see where you stand before you go converting it.

Otherwise you could create a drive and boot to a live cd (image or usb or such) and then dd over ftp to the new file.

deesto 05-26-2011 03:45 PM

Quote:

Originally Posted by jefro (Post 4366916)
I might be inclined to use a P2V app.

I have dd's many a distro over to a file. It is a raw file then and you can just use it like that to see where you stand before you go converting it.

Otherwise you could create a drive and boot to a live cd (image or usb or such) and then dd over ftp to the new file.

Well, I tried VMware's P2V converter app before I went this route, and I got the same errors when trying to boot the resulting image file, so I assumed I'd be better off with a pure dd.

I don't necessarily want to convert the image to another format, just boot the image (or the original partition) from within my current OS. So far I've not been able to boot either one.

jefro 05-26-2011 07:31 PM

Oh darn, I should have seen this.

dd if=/dev/sdb7


You didn't get a drive you got a partition. You need a mbr.

deesto 05-27-2011 08:01 AM

Quote:

Originally Posted by jefro (Post 4368131)
Oh darn, I should have seen this.

dd if=/dev/sdb7


You didn't get a drive you got a partition. You need a mbr.

Ack. Right. Thanks. So I can use `dd` to copy the MBR, but is it possible to add the MBR to the existing image of the partition I'd created, or to re-image and somehow include the MBR? Or do I need to image the entire disk in order to get one W7 partition to boot?

jefro 05-27-2011 03:03 PM

Well, possible but not practical. You have to create a virtual hard drive (you lack a lot) so you could maybe do a binary copy of mbr + part.img to get a copy of the drive. One issue also exists is the sda7 deal. You'd at least have to fix either boot or partition structure.


All times are GMT -5. The time now is 10:38 AM.