Sunday, February 9, 2020

[SOLUTION] BootCamp ThunderBolt Device Not Working


TL;DR

  • ThunderBolt devices only get recognized by BootCamp on boot.
  • If you unplug your ThunderBolt device while using BootCamp, you'll have to shut down then reboot your OS to get it recognized again.
    • If still not recognized after a full shutdown-boot cycle, keep trying.
  • Disable Fast Startup in Windows 8/10.
    • Also try holding Shift when you click Start > Shut down.
  • Wait a solid chunk of seconds after shutdown, on the OS select screen (that appears when holding Option during boot), and on the login screen after boot, to allow BootCamp to configure Thunderbolt devices.
  • Sleep simply does not work in BootCamp with a ThunderBolt device connected.



Story Time


Choosing Thunderbolt Over USB


In theory, using a Thunderbolt 2 peripheral in place of a USB peripheral in MacOS BootCamp is great: You get to attach a peripheral to your computer in a perhaps-otherwise-never-used port while avoiding using up a precious onboard USB slot. "If you need more slots for peripherals, why not just use an external USB hub?" you ask. Well, as I explain in this blog post, I fried 2 external drives  connected to a USB hub simply by transferring files. I'm now trying to avoid USB hubs at all costs. That's why I've started searching for Thunderbolt 2 alternatives to some of my USB peripherals: I'll get to reap the same benefits that came form using my old USB peripherals without the pain of using up one of my MacBook's 2 precious USB slots.


Anyway, as I said, the idea of using a Thunderbolt 2 device in place of a USB device is great. However, in practice, using a ThunderBolt 2 device in BootCamp kinda sucks. But going through the pain of getting those Thunderbolt 2 devices working and dealing with their limitations is still worth the serene satisfaction of not using any of those precious, precious USB ports.



Finding a Thunderbolt Replacement


In my quest to free up my onboard USB ports, I found the perfect device: the Sonnet USB 3.0 + Gigabit Ethernet Thunderbolt Adapter. You see, one USB device I always have plugged in at home is a USB-to-Ethernet adapter. (Need consistent speeds for all those lonely nights of playing League of Legends ARAM.) Not only does the Sonnet Thunderbolt adapter have an RJ-45 Ethernet port built in, but it includes an additional USB 3.0 port as well! A USB 3.0 port, mind you, that I trust much more than the ports on USB hubs that have 3 or more ports like my old one did. Considering most USB hubs don't have an external power adapter, I'm not surprised to learn that the correct amount of power doesn't get consistently distributed to all the USB devices connected to a hub, especially when there are 2, 3, 4 devices plugged into one at once. However, despite my increased confidence in the USB port on Sonnet's adapter, and their product page boasting the [presumably "safe"] use of large external USB drives, I'm still never going to plug my own external drives into it.
So according to the product page's URL, this thing is considered "legacy" hardware at this point. It must also be considered niche/posh/bougie hardware because it was dam* expensive! And not many floating around, either. (What was just as hard to find--and more expensive--were Thunderbolt-to-USB adapters...as in, they only have a USB port and nothing else. Huh?? I was thinking something like that would be like 10 bucks, tops. The only ones I found still in stock were in European Amazon listings and AliExpress.)



Driver Config Misery


Anyway, I grabbed the adapter's Windows driver from Softpedia (because the driver download on Sonnet's site didn't work) and, after a few minutes of hiccups, got everything working quite quickly. I restarted my PC just to be sure everything still worked after a reboot, and...oh no. Ooooh no. Nothing worked. More reboots. Sometimes the Ethernet worked but not the USB. More reboots. No dice. What is going on? I troubleshooted for what felt like hours, unplugging and plugging back in, uninstalling and reinstalling drivers in Device Manager, rebooting over and over. Funnily enough, what I avoided doing was shutdowns. Why? Well, at my past 2 IT jobs, we'd discussed multiple times how Windows 10 (and Windows 8)'s shutdowns don't completely shut down the machine, and actually save your OS state in a hibernation file for faster startup times. After some Googling later on, I was reminded this is what's called Fast Startup.

Obviously, I do not want Windows to store my computer's state on shutdown because, in its current state, Thunderbolt devices are not working! Reboots, however, were supposed to be the answer to this problem: Reboots "truly" shut down your machine without saving your OS state. Welp, as I said, rebooting the machine did not get my Thunderbolt devices working again. I couldn't for the life of me replicate that magical 1 moment in time where everything functioned as it should.

At some point I disabled Fast Startup. (The "Restart isn't affected" note you see under that setting rings true: reboots still don't solve my Thunderbolt driver problem, even after disabling Fast Startup.) Somewhere down the road I finally attempted an OS shutdown through the Start menu (instead of a forced shutdown), but after waiting for 3+ minutes, the shutdown indicator was still circling around (with no indication that updates were being installed or some software was hindering the shutdown process), so I tried a force shutdown by holding the power button while the "Shutting down" circle was still spinning. I turn it back on, and voila! Everything was working again! "OK, that's the answer," I told myself. "Force shutdown, then my Thunderbolt devices will work every time on boot. Hooray?"


WRONG


The Solution


I realized forced shutdowns did not consistently get my Thunderbolt devices to work after all, so I started shutting down through the OS Start menu (and waiting for it to finish) instead. That actually worked...for the most part. However, it seems if I boot too quickly after shutdown, or log in too quickly after boot, the device drivers will still sometimes not get configured properly (especially the USB half of the adapterπŸ™„). So now, to be extra sure, I hold Shift when I click Start > Shut down (which disables the Fast Startup feature for that particular shutdown alone) in addition to having the Fast Startup option disabled in the Control Panel. (I don't care if doing both is redundant and makes no difference; I am applying redundancy everywhere I can if it brings me peace of mind in being a potential contributor to my solution.) I now also wait a few good seconds after shutdown and on the login screen after each "cold boot" to let the OS completely configure the Thunderbolt drivers. As of today, so far, so good...Well, good enough, I guess. I still need to sometimes do multiple shutdown-"cold boot" cycles to get Windows to recognize both the adapter's Ethernet jack and USB port.


Broken Sleep & Apple's Statement


One new super-annoying thing I noticed after finally getting my Thunderbolt device working [semi-]consistently is that the Sleep option has completely disappeared from the OS. Are you kidding me? Will I never know peace?😭 So, being the tech genius that I am, I finally had the bright idea to search "the Googles" (as my boss calls it), finally using terms that are applicable to my specific situation(🀦) and stumbled upon some articles discussing the limitations of Thunderbolt devices in BootCamp. These articles linked to a now-gone FAQ from Apple, which--along with the articles themselves--outlined the following major points:

  • BootCamp only searches for and configures Thunderbolt devices on boot, and never again.
  • If you unplug a Thunderbolt device while Windows is running, you'll have to reboot the entire system to get it recognized again. Or, as I discovered, shut down the entire system; not just reboot.
  • Sleep is disabled while a Thunderbolt device is plugged in.
  • You can't use Target Display Mode in BootCamp (which is using your iMac as a secondary display for your MacBook).

Don't Conduct Large File Transfers Through a USB Hub!

TL;DR:

  1. NEVER transfer large amounts of data to an external device over a USB hub--can lead to drive corruption!
    • In fact, just try to avoid plugging external drives into USB hubs altogether.
  2. Sometimes corrupted hard drives lock themselves down into a read-only mode after corruption to protect themselves from further damage.
  3. Don't try to read the last directory you were copying over before the drive got corrupted--Windows Explorer could hang.
  4. The files on read-only drives are still recoverable and you can copy them over to a new drive (but you'll probably have to skip at least a few unrecoverable corrupted files).
  5. You can't/shouldn't try to make a corrupted drive usable again, at risk of more data loss. One clear indicator of a truly unusable drive is if "phantom files" remain on the drive after wiping/formatting it with 3rd-party tools.



Story Time


I hate how few USB-A ports are on my MacBook Pro Late 2012 (on which I'm always running Windows/BootCamp). There are 2 USB-A ports (which is better than current-day MacBooks' USB-A counts, which is 0. Ugh). More frustrating still, there are these dumb Thunderbolt 2 (a.k.a. mini DisplayPort) ports taking up space where I feel there should be more USB-A's. So, to add more USB ports to my setup, I used a Targus ACH124 USB 3.0 hub for a while without issue.

However, during a backup project involving some massive file transfers to hub-connected external drives, I ended up killing a good-condition 32GB micro SD on the 1st day of my transfers, and then killed a good-condition (only-few-months-old) 1TB external HDD on the 2nd day. (Why did I try a large file transfer again on the 2nd day after I had already fried my MicroSD on the 1st day, you ask? Well, I thought the MicroSD failure was due to the card's age; I hadn't narrowed the problem down to the hub yet.) Turns out, according to this Amazon review, frying drives is a known fault with this particular hub:


Pathetic. Also turns out, it's an accepted fact that file transfers to drives connected through USB hubs can lead to data loss/drive corruption, particularly by means of voltage spikes or "brownouts," caused by insufficient power to the drive. (I imagine brownouts are the cause of both of my drives getting fried. I wouldn't be surprised if that dinky USB hub was unable to provide a steady stream of sufficient power to keep external drives running in peak condition during massive file transfers, without risk of corruption/data loss.)

Luckily, the contents on the 1TB external drive were still read-only, so I therefore could copy them to a new 1TB drive. (I just had to be careful to not attempt to open in Windows Explorer the last directory that I had been copying before the drive fried: That folder seemed to be the epicenter of the HDD's disease, and Windows Explorer hung when I attempted accessing it.) The MicroSD was a total goner, though: Formatting through Windows wouldn't work, and 3rd-party wipe & format programs failed to erase the "phantom files" left on the defunct card, even after wiping and writing over the card with the highest security setting and highest number of passes possible on MiniTool Drive Wipe [DoD 5220.28-STD (7 passes)].