Historic system state: Once there was an HDD with Win7, which had created a 100Mb hidden system partition at the beginning of the disk. After PC upgrade the new Win10 was installed on a new SSD drive, but it appears it kept using BCD data located in that hidden partition - it was only able to boot by selecting old HDD drive as boot device in BIOS, not SSD, but I was ok with that. Recently I've upgraded PC hardware again and decided to replace old HDDs with new bigger one. But that would remove the boot partition along with the disk. The plan was to use live GParted USB to shrink the only partition on SSD by 100Mb, move it to the right and copy hidden boot partition from old HDD to SSD. Then the usual procedure with Win10 recovery USB, bootrec /fixmbr /fixboot should have restored system's ability to boot. Reliable plan, eh?
Still, it partially worked. 4.5 hours to resize the SSD partition, then 5 seconds to copy hidden partition. Then I fumbled around recovery command line, restored MBR and recreated BCD until at least the loader started working - it showed up Windows logo and a spinning dots circle. Then it was black screen with spinning dots forever, with occasional sparks of SSD LED activity.
What I've tried so far:
unplugged all other drives, including those with additional Program Files folders - some big installations did not fit on a 256Gb SSD.
diskpart -> list volume: shows two primary partitions on SSD
Volume 0 C System Rese NTFS Partition 100MB Healthy
Volume 1 D NTFS Partition 238GB Healthy
- bcdedit /enum:
Windows Boot Manager
--------------------
identifier {bootmgr}
device partition=C:
path \bootmgr
description Windows Boot Manager
locale en-US
default {default}
displayorder {default}
timeout 10
Windows Boot Loader
identifier {default}
device partition=D:
path \WINDOWS\system32\winload.exe
description Windows 10 Pro
locale en-US
osdevice partition=D:
systemroot \Windows
resumeobject {22845d65-b58d-11ef-b0f7-806e6f6e6963}
bootmenupolicy Standard
bootlog Yes
no restore points available, no system images either
advanced options - startup repair: startup repair couldn't repair your PC. D:\Windows\System32\LogFiles\Srt\Srttrail.txt contents: Number of root causes = 1, 0 errors, Boot status indicates that the OS booted successfully.
sfc /scannow: runs until 100% without problems, but then says "Windows Resource Protection could not perform the requested operation." Later it started saying "Windows Resource protection found integrity violations", but it is impossible to use /offlogfile option with commands like /scannow or /verifyonly (when I do that it shows usage instruction instead), so I can neither find out which files are damaged, nor repair them automatically When I try to do /scanfile or /verifyfile it says "Windows Resource Protection could not perform the requested operation"
dism /online /cleanup-image /restorehealth - doesn't work, DISM does not support servicing Windows PE with the /online option (because I'm running it from live usb)
dism /image:D:\ /cleanup-image /restorehealth /scratchdir:D:\Windows\temp /logpath:D:\dism.log - version 10.0.19041.844, image version 10.0.19045.5131, the restore operation completed successfully, the operation completed sucessfully.
bcdedit /set {default} bootlog yes - sets the flag. Also removed ntbtlog.txt in d:\Windows. New ntbtlog.txt has a lot of BOOTLOG_NOT_LOADED lines.
booting into Safe Mode (option 4): does not boot, stuck in the same black screen; same for other safe mode options
removed d:\hiberfil.sys just in case I sent it into sleep mode before upgrading instead of turning off properly.
smartctl -ax /dev/sdd (SSD) - run from GParted live usb; 0 reallocation sectors, 0 other bad values, error log empty, extended comprehensive error log contains 7 errors(different LBA, different r/w operations) over 17302 hours of work (720 days) - probably related to my abrupt power downs during repairs, tried running short self-test which should've taken 2 minutes. an hour later it still showed "Self-test routine in progress 50%". Overall-health self-assessment test result: passed.
chkdsk d: - found no problems, but failed to transfer logged messages to the event log with status 6.
===
Conclusion: SSD is probably good, Windows somehow is not. The only option left to restore Windows is a new installation, that will ruin all settings. Anything I'm missing?