-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SD Card not detected #3
Comments
Thank you for the tips, indeed the SD detection requires some improvements. |
While The code below list all the USB Devices (https://learn.microsoft.com/en-us/powershell/module/storage/get-disk) $usbDevices = Get-Disk | Where-Object -FilterScript {$_.Bustype -Eq "USB" -Or $_.Bustype -Eq "SD" }
foreach ($device in $usbDevices) {
Write-Host "[$($device.Number)] $($device.Manufacturer) - $($device.Model) | Size: $($device.Size / 1GB) GB"
} In my case
Then with the number we can format the drive $usbDeviceNumber = 9999
Clear-Disk -Number $usbDeviceNumber -RemoveData -Confirm:$false
New-Partition -DiskNumber $usbDeviceNumber -UseMaximumSize
Format-Volume -DriveLetter (Get-Partition -DiskNumber $usbDeviceNumber).DriveLetter -FileSystem FAT32 -NewFileSystemLabel "OnionOS" -Confirm:$false I would also recommend to double check the device serial number between the enumeration and the formatting because the user could have connected and disconnected some devices on its PC and we don't want to format a random drive. |
Yes powershell can do that in an easier way but as ODT use RMPARTUSB to format the SD card in FAT32 it makes sense to see first if the SD card is well detected by this one first. Because no use to engage the user to a process where the SD card must be fomated if RMPARTUSB doesn't detect this one correctly. It could be an alternative for other tasks (like simple install, emulators and applications manager or checkdisk) which don't require any formating. |
The Regex still doesn't work in my case because the firmware version (
In my previous message I suggested to also use PowerShell to format the SD and since RMPARTUSB is only used to enumerate and format it should be no longer be necessary. I see another "issue": the name RMPARTUSB suggest to me that it only detects USB, meanwhile with powershell SD and USB can be filtered. |
Probably a different issue but related. My AZUS G14 (2022) laptop has a built in SD card reader, which is reasonable fast, so I use it rather than a USB stick. The Onions Tools can't detect it is available. I suspect outside the scope to read SD cards computer slots. Easy to work around use a USB SD card reader. Just reporting it if late decide to support built in SD card slots. |
This regex fixed it for me. replace the to if statements in the Disk_Selector script. if ($drive -match '*?DRIVE (\d+) -\s+([\d.]+[KMGTP]?iB)?\s+(.*?)\s+Fw=(\w+)\s+Sno=(\S+)\s+(\w):') { |
My SD Card is not detected.
This is the output of
.\RMPARTUSB.exe LIST
:The regex at
Onion-Desktop-Tools/Disk_selector.ps1
Line 52 in a47445a
@
in theSno
, I fixed it by replacing it withI don't know if
Sno
can contain more special characters.The text was updated successfully, but these errors were encountered: