Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3847

Troubleshooting • Re: Raspberry Pi Imager and Google Drive

$
0
0
Probably indeed a bug in Imager (or rather the drivelist library borrowed from Balena).


The method used there to match which drive letter belongs to which physical drive is kinda hacky.
Basically it opens each of the devices that represents a drive letter (\\.\A: \\.\B: etc.), asks: "what is your physical drive number?" and matches the results.

Catch 22 is that those physical drive numbers are not guaranteed to be globally unique, and each driver can make up its own numbers.
So the driver that handles the SD card reader can assign number 1 to the SD card reader. And the different driver that handles Google drive can also use physical drive number 1 internally...
The drivelist authors were aware of that, and as a workaround asked every drive for its type, which can be DRIVE_UNKNOWN, DRIVE_REMOVABLE, DRIVE_FIXED, DRIVE_REMOTE, DRIVE_CDROM, DRIVE_RAMDISK.
And then simply ignored drives that are not either DRIVE_REMOVABLE or DRIVE_FIXED: https://github.com/raspberrypi/rpi-imag ... #L276-L288
But I am guessing the Google drive does advertise to be such normal drive type, so that solution does not work...

A fix may be to not only look at the physical drive number, but also query the driver name used with SetupDiGetDeviceRegistryPropertyA() and use that as additional information in addition to the drive number when matching letters to actual devices.
But will leave that up to the current Imager maintainer...

Statistics: Posted by incognitum — Sun Nov 10, 2024 5:20 pm



Viewing all articles
Browse latest Browse all 3847

Trending Articles