1

Does a PCIe SSD in an internal M.2 slot need a different driver from a drive of the same type sitting in an external USB enclosure?

The enclosure uses a Realtek RTL9210 USB to PCIe / SATA bridge, if that matters. The laptop is an LG gram 17 2022.

I ask because I am unable to boot from a clone of the internal drive that is sitting in the external enclosure, and I'm told this can happen when the drive you are trying to boot from requires a different driver from the one you cloned from. I have posted a specific question about the boot issue here. I don't want to duplicate that but in response to the comment asking for further detail, I have another external drive and am able to boot Win 10 from that drive so I don't think it's a general problem with Windows not being bootable from external drives. The cloned system is Win 11.

The drives themselves are supposedly1 the same type but I am not clear if the fact that one is in a USB enclosure means that it needs a different driver.


1: I say supposedly because the packaging for the drive that's in the enclosure says PCIe 4.0 but a sticker on the back says SATA, and the enclosure supports both. I don't know how to check which is actually in use.

culp
  • 35
  • 3
  • 1
    Pleased edit your question to add more details: What is the exact make and model on your system? What OS is this being attempted on? I am mainly a macOS/Linux user but I don’t believe any special driver is needed to access a drive in an external enclosure that was once an internal drive. This issue is most likely whether the OS you are using allows for USB booting. Ditto with the system itself; some OS’s need a BIOS tweaks to allow for USB booting. – Giacomo1968 Nov 23 '22 at 15:43
  • Are you trying to boot from usb? – Moab Nov 23 '22 at 16:52
  • @Moab Yes - I'm able to boot from one usb drive but not the other. – culp Nov 23 '22 at 16:54

1 Answers1

0

Does a PCIe SSD in an internal M.2 slot need a different driver from a drive of the same type sitting in an external USB enclosure?

Usually yes, because to the computer it's no longer a PCIe/SATA device but a USB device. The enclosure's controller does not tunnel the raw PCI or SATA connection through USB all the way to the computer (only Thunderbolt or USB4 can tunnel PCI; regular USB 3.x cannot).

Instead the bridge chip such as the RTL9210 itself acts as the PCIe or AHCI host controller for your SSD, while at the same time presenting itself as a USB "Mass Storage" device to the computer. USB storage devices always use the SCSI command set (or something like it, anyway), so the enclosure also translates between SCSI commands on the computer side and ATA or NVMe commands on the storage side.

So when the drive is directly in the motherboard's M.2 slot it needs either NVMe or AHCI & ATA storage drivers (e.g. StorNvme on Windows); when it's connected via USB enclosure it needs USB xHCI + UMS/SCSI storage drivers (and I'm not sure if those are even available as boot drivers on Windows).

(Different bridge chips used by enclosures do handle the translation differently, so it's possible that certain combinations will just happen to be outside the tolerances of either the OS or the disk itself. For example, the enclosure can appear as having removable or fixed storage. The logical sector size may differ, sometimes the enclosure deliberately pretends to have 4K sectors despite it being a 512b disk. I suspect the presence or absence of UASP support might have side effects even if the boot process doesn't use UASP.)

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • Thanks. That looks very much like the answer but I think the etiquette is to wait a bit before accepting. The device does show in the BIOS screen – does that mean that the necessary drivers have already been loaded at that stage? Also, is there any way to tell whether Windows sees the drive as removable or fixed storage? – culp Nov 23 '22 at 17:32
  • @culp: drivers are at the OS level, not a the BIOS level. If you want to know how Windows see the drive, just boot on the internal drive, and plug in the external drive. – PierU Nov 23 '22 at 20:13
  • The BIOS *does* have its own drivers for accessing storage – but Windows doesn't use them. (Only the bootloader uses BIOS-level access to load the Windows kernel as well as some "boot" drivers for it, but then Windows starts talking to the PCI devices directly.) – u1686_grawity Nov 23 '22 at 20:36
  • @culp: For checking it on Windows all I know is "look at which kind of icon is shown in Computer". On Linux, various outputs of `lsblk [-D] [-t]` and `hdparm -I` are useful. I have two USB to M.2 SATA enclosures and they give me completely different information about the exact same SSD in them – one reports 4K "physical sectors" while the other says 512b (though both at least agree on 512b _logical_ sectors, thankfully); one of them even marks the device as rotational=1 (i.e. claims it's an HDD and not an SSD); and so on. Similar mess with USB-to-2.5" SATA and USB-to-NVMe bridges. – u1686_grawity Nov 26 '22 at 11:39