0

I have the following disks:

C:                SSD, disk 1, boot disk
D:                HDD, disk 3, partition 1
E:                HDD, disk 3, partition 2
F:, G:, H:, I:    HDD, disk 2, partitions 1-4

I want to replace D: with a new SSD, but Windows loads various background services from that drive, so I want to avoid trying to 'hot-swap' the drive letter while the OS is up.

My plan was:

  • Install the new SSD, let it auto-assign to J:
  • Clone D:'s partition to J:
  • Reboot into recovery mode
  • Use diskpart to switch drive letters for J: and D:
  • Boot back into Windows

However when I load diskpart in recovery mode, the drive letter assignment is different to when Windows is loaded - it's defaulting to auto-assigning by-device-then-partition, eg D: is assigned to disk 2, partition 1.

How can I edit the drive letter assignments that Windows uses once loaded, but without loading it?

jlmt
  • 101
  • 3

2 Answers2

0

I ended up using safe mode to do the drive letter swap; As far as I was able to tell by reading around, 3rd-party background services don't get loaded in safe mode, and that turned out to be the case for those running from the old partitions here.

It was useful to first enable F8 safe mode by, per this post, issuing the command:

bcdedit /set {default} bootmenupolicy legacy

(Otherwise the only way to enter safe mode without first loading normal mode is to kill the power during boot over and over again until Windows panics and tries to repair itself.)

I suspect that it might have been possible to edit the drive letter assignments by loading and editing the registry in recovery mode, but that was a rabbit-hole that I didn't want to explore unless absolutely necessary.

jlmt
  • 101
  • 3
0

Whenever I've done a drive replacement, even for Windows, I've used Linux to clone the old drive to the new drive using dd (making sure to shrink/move any partitions first if the replacement is smaller, and expand to fill the drive space once cloned). I have Linux installed, but most live installers or miniature distros would include all you'd need for this.

Using dd to clone a disk is a risky exercise as you can permanently lose all the data on your disk(s) if you don't get the input and output flags for dd correct - you need to make doubly and perhaps triply sure that you get the drives correct. It's definitely a "do this at your own risk" solution, I am not recommending that you do it and can offer no support if it goes wrong. If you already know how to to this, you are comfortable with accepting the risks, and you have good backups on another drive (preferably offline), there are instructions on how to clone a disk using dd here: https://medium.com/codex/the-art-of-cloning-disks-the-dd-command-primary-usage-patterns-ff377b7616c9

The same can probably be achieved by other disk cloning tools that are more user-friendly than dd, so those may be a better option for you if you're not familiar with Linux or want to keep the solution Windows-only.

However, after doing that, you can remove the old drive, insert the new drive, and Windows will (or at least should) use the new drive as though nothing happened. Cloning the drive copies across the device/partition/volume identifiers, so you don't need to tell Windows to look somewhere else for the disk it's trying to find.

hartacus
  • 151