-
Notifications
You must be signed in to change notification settings - Fork 11
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
Verify disk before performing operations on it #22
Comments
The problem is with this line, which takes only the last character of the DeviceID. If the system has more than 10 drives attached (e.g. the user has a multi-card reader) and selects, for example, the drive with DeviceID=\.\PHYSICALDRIVE12, the tool will select the last character and format drive 2. A solution would be to replace the offending line with something like this: drivenum = output_lines[index].lower().find('physicaldrive') + len('physicaldrive')
id = output_lines[index][drivenum:] I moved everything to lower case because I don't know if WMI uses the same casing on all systems. |
As a side note, id is a Python built-in function, so it might be a good idea to rename that variable. |
Using just the last digit can cause problems, as per issue KanoComputing#22.
Bump. I've submitted a pull request that fixes this issue (#24). |
@Ealdwulf I have a multi card reader, I can bring it tomorrow. |
We had a report of a customer wiping his 1TB internal hard drive after apparently selecting the SD card in the dropdown list. We need to verify the disk selected is the disk we're formatting and burning.
The text was updated successfully, but these errors were encountered: