1

The machine in question is an intel-based windows laptop with a defective SSD that works for the most part but accessing specific addresses causes it to not respond any more until the whole machine reboots.

I am trying to write an automated tool to recover it's data, and as part of that tool, in case a read operation does not respond within a set time, I want it to force-reboot the machine and then continue from where it stopped + single sector.

I have tried to force-reboot with the following command:

shutdown -r -t 0 -f

But it just stuck at Windows "Restarting ..." screen. I have to use the physical button to make it actually reboot. So I'm searching for a way, whether it be a command line tool or a Win32 API, to hard-reboot automatically without the need of using the physical button.

9
  • Is it stuck in the bios or while booting Wwindows ? Is it stuck if you reboot via Windows command? Jan 29, 2023 at 13:00
  • It stuck in Windows, while it is still shutting down.
    – DxCK
    Jan 29, 2023 at 13:40
  • Try adding in /p Turns off the local computer only (not a remote computer)—with no time-out period or warning. Doesn't say if it will still reboot or just shutdown.
    – Baa
    Jan 29, 2023 at 13:48
  • Might also be worth checking that you have write cache turned off. I'm just guessing here but Windows might be trying to write the cache to the disk on shutdown but of course, it can't and hangs forever.
    – Baa
    Jan 29, 2023 at 14:04
  • Thanks for your suggestions, I tried them both but the original problem persists.
    – DxCK
    Jan 29, 2023 at 20:05

1 Answer 1

1

Before you try to recover data, make a disk image as best you can, without booting from that drive. Each time it reboots, the machine inevitably writes more to the SSD, causing additional damage.

There are many tools to make bootable rescue imaging media, such as Macrium Reflect Free and alternatives.

Using Reflect, for example,

  • Create rescue media, perhaps on a USB flash drive of 8 GB or larger.
  • Get an external disk drive at least as large as the SSD.
  • On the afflicted PC, boot to BIOS and enable boot from USB.
  • Reboot, using the USB made above, possibly selecting boot device (depending on BIOS).
  • Insert the external drive USB cable (you can unplug the flash drive if need be after booting).
  • Refresh the list of drives shown in Reflect.
  • "Set Macrium Reflect to ignore bad sectors when creating an image" and make a full drive image. This hopefully will proceed without interruption.
  • Recover your files from this image, not from the original SSD causing issues
2
  • 1
    This will hit the error OP describes: Reading certain logical addresses will freeze the SSD entirely.
    – Daniel B
    Jan 29, 2023 at 22:35
  • 1
    @DanielB, is it the SSD or the OS that is freezing? Perhaps setting Macrium Reflect to ignore bad sectors when creating an image will bypass that issue -- or not. Worth a try. Jan 30, 2023 at 1:17

You must log in to answer this question.

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