-2

Is there anyway to make Windows detect a hard drive in the same or similar fashion as Linux does: Do not mount file systems automatically.

Windows can take forever to recognize a failing drive due it trying to mount file systems it recognizes, and thus put more strain on it, while the same drive in a Linux environment may load up with no issues.

  • 2
    Don’t use a VM for recovery. Only with direct hardware access is it feasible. – Daniel B Jun 04 '23 at 19:34
  • 4
    See https://serverfault.com/questions/443103/i-have-a-hd-with-bad-sectors-can-i-configure-windows-to-only-retry-a-failed-rea : "Windows keeps writing things (swap, logs, temp-files, etc.) to the disk continuously thereby increasing the chance things go from bad to worse. " If you're trying to recover data, do not boot from that drive. – DrMoishe Pippik Jun 04 '23 at 20:59
  • Start with a Linux on a usb pendrive. Follow for example https://superuser.com/a/980279/257269 with the updated options (--no-scrape ...) to minimize the risks to brick the disk. – Hastur Jun 06 '23 at 15:17

2 Answers2

3

Due to the inner workings of a Microsoft operating system connecting a failing drive to a computer running a Microsoft operating sytem is increasing your chances to fail as DrMoishe Pippik already outlined in his comment.

Do your recovery or your duplicating operation on a separate machine using linux either from a pendrive or from a regular installation. Duplicating a failing drives does not need enormous ressources. Outdated used older machines do the job as good as new ones.

There is no solution for your particular convenience requirement of simultaneously regularly operating a computer and running a recovery the same time.

Even Co-Linux is no solution as long as a Windows machine tries to access and auto-mount new disk that are being attached.

r2d3
  • 3,554
0

The main issue with Windows is that it will try to mount everything it recognizes. So basically any volume formatted with a file system it can work with. This results in two problems:

  • Windows will 'parse' the file system and immediately start writing to it. In this video I captured some of those interactions: https://youtu.be/mW7eGh8P24M. This is not what you want happening in a data recovery scenario.

  • If during this, Windows runs into a bad sector it will restart the process again and again. Which is al not what you want. A more detailed analysis of Windows 7 detecting a drive:

Windows 7 begins its mounting process by reading the Master Boot Record of the drive 9 times in a row. If successful, it will begin reading the Master File Table (MFT) section of the file system in blocks of 128 sectors while simultaneously sending occasional write commands to update various minor logs. If a drive fails to read a block within the MFT then Windows will automatically try to read the same block again, and again, and again... up to 9 times in a row. If all of those attempts do not work either, Windows will break down the problematic 128 sector block into smaller blocks equivalent to the cluster size being used by the file system (typically 8 sectors or 4KB). This same 128 sector block, which already failed to read 9 times, will then be attempted 8 sectors at a time. If any of those smaller 8 sector blocks fail to read, Windows will also try them 9 times each. If all of those attempts fail yet again then Windows will simply give up, reset the drive, and automatically restart the whole mounting process from scratch. If allowed, Windows will restart the mounting process as many times as it takes until the drive crashes and stops responding altogether.

You can to some extent try prevent Windows from mounting external drives using for example 'mountvol' or 'diskpart'.

  1. Open an elevated command prompt.
  2. Type mountvol /n to disable the drive automount feature
  3. The command mountvol /r will remove drive letters for previously connected drives.
  4. To enable again type mountvol /e

In my personal experience it may require a coupe of reboots for it to become effective.

Best is to use either specialized hardware that places itself in between Windows and the drive such as the DeepSpar USB Stabilizer or use Linux.

Your proposal to use Linux from a VM that itself runs in Windows kind of defeats the purpose. If it were possible to prevent Windows from performing these unwanted interactions, we'd not need Linux even.