Proxmox – recovering a Windows 7 machine having “Missing operating system”
Posted by jpluimers on 2018/01/12
This is not what you like when you reboot a VM in Proxmox:
Booting from Hard disk...
Missing operating system
This case was a Windows 7 UK Professional x64 SP1 virtual machine.
Luckily the ISO is at https://archive.org/download/en_windows_7_professional_with_sp1_x64_dvd_u_676939_201606/en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso via https://archive.org/details/en_windows_7_professional_with_sp1_x64_dvd_u_676939_201606 (later I found out I had the image in my backup vault as well).
I put that one in /var/lib/vz/template/iso so proxmox will automagically provide it in the local storage of iso images.
Now for some screenshots some based on what I learned at [Archive.is] How to use System Recovery Options for repairing Windows Vista or 7 installations:
- Mount the Windows 7 ISO image and ensure your disk is sata as well (as only Windows 10 and higher will understand virtio disks):
- Boot from the DVD into repair mode:
Boot and press any key to get into the GUI.
Now start the recovery process:
Choose “Command prompt”
Type “diskpart” followed by the “list volume” command to see which volumes have what state. In our case all non CD-ROM partitions became RAW (but should be NTFS)
With that list, find out which drive letters have corrupt NTFS partitions and try to recover them with chkdsk.
diskpart
list volume
exit
chkdsk D: /F /X
chkdsk C: /F /XThe last statement will likely fail, but it doesn’t hurt to try.
Then exit diskpart, exit the command prompt and press the Shutdown button. Wait for the VM to actually shutdown, mount another SATA drive with a good 100 megabyte System Reserved Partition in a raw file and mount a CD with Parted Magic or GParted.
(you can copy/move the raw image using ssh, not from the web UI)
Boot and start GParted, then copy the good 100 megabyte partition over the bad one:
Boot Parted Magic or another ISO having GParted installed. The 32-bit RAM version suffices for our copy action.
Select the good disk on the right and the goot System Reserved partition on the bottom, then press the “Copy” button.
Logoff, shutdown, then wait for VM to actually shut down.
- – remove second SATA disk
- – remove CD/DVD
If you originally moved the secondary SATA disk here, then move it back using ssh before removing it below!
Boot to the Windows 7 DVD again and continue repairing the now restored System Reserved partition.
Boot one more time from the Windows DVD to do the final repairs.
https://www.dropbox.com/s/s7nayovja1lvtev/Screenshot%202016-12-15%2012.31.15.png?dl=0
Chose “Use recovery tools” and observe we’re making progress: the partition has size. But a wrong drive letter.
Windows now has assigned drive letters that are wrong, so we need to change them again.
diskpart
list volume
select volume 1
remove letter=C
select volume 2
assign letter=C
active
list volume(the last active will make volume 2 active)
bcdboot C:\Windows
bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd
bootrec /scanosThis is one of the scenarios that “Startup Repair” fixes for us. It helps to know these commands so you can do it manually.
for MBR, this extra step is needed:
bcdboot C:\Windows /S C:
Now optionally change the disk type to virtio, then mandatory verify the boot order and remove the CD
We have Windows!
Sometimes Windows will magically assign a drive letter to the 100 megabyte System Reserved Partition. If that happens, use diskpart to remove that drive letter again.
Here is when the disks suddenly were corrupted from NTFS to RAW:
–jeroen
[WayBack] How to transfer large ISO to ProxMox? | Proxmox Support Forum


















































Leave a comment