1

I have a problem with a old machine running Windows XP (32 bits), it has problems with the NTFS partition and I need to do chkdsk /r on the whole disk partition (single ntfs partition). Bad news I have no media to boot on it, no USB keys nothing at all except other computer running linux, and good news, a lot of iso files with installers for WindowsXP, Windows 7, BSD, GNU/Linux, even Plan9 (xD just for fun). Well the point is I know I can run a Qemu guest VM with one of those WinXP isos as boot and pass the whole damaged hard disk to the Qemu guest I mean something like (but if there is other alternative I really need to know)

qemu-system-x86_64 -cdrom /isofile -hda /dev/sdb -boot order=dcn

Then in the guest VM, Can I do

chkdsk /r /f C:

(or whatever needed to fix the disk) and trust that it will do the right job ?

Clarifying the question: Can I pass to qemu a real hard disk as parameter ? I say real hard disk because when I pass just using -hda the guest see the disk as Qemu virtual Hard disk

1 Answer 1

1

It may work.

Backup, backup, backup. Make a copy of the disk you want to recover and ideally work on that copy. If you need the original filesystem to remain on the physical disk then you can repeat the process on the disk and know that you have a backup should something go wrong. If you can't create a backup disk image, look at qemu's -snapshot option which allows read-only access to the backing disk.

I would remove c from the boot order since you want to run your check or repair on an offline filesystem. If the emulated cdrom fails to boot for some reason you may not want the VM to try booting from the disk you are trying to recover.

chkdsk is probably out of scope for this site. Can you "trust that it will do the right job"? It depends on several components working correctly, some of which were not designed to be run in a virtual environment. Make a backup first.

1
  • Of course I have a previous backup from all the disk, a dd approach, so I tried but it doesn't work, I actually run chkdsk but it doesn't work. I will clarify my question, because it think the problem wasn't clear even for me. I appreciate your answer Oct 28, 2016 at 18:27

You must log in to answer this question.

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