Skip to content
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

Open
CarolineClark opened this issue Nov 5, 2014 · 6 comments
Open

Verify disk before performing operations on it #22

CarolineClark opened this issue Nov 5, 2014 · 6 comments

Comments

@CarolineClark
Copy link
Contributor

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.

@elyscape
Copy link
Contributor

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.

@elyscape
Copy link
Contributor

As a side note, id is a Python built-in function, so it might be a good idea to rename that variable.

elyscape added a commit to elyscape/kano-burners that referenced this issue Nov 13, 2014
Using just the last digit can cause problems, as per issue KanoComputing#22.
@elyscape
Copy link
Contributor

Bump. I've submitted a pull request that fixes this issue (#24).

@Ealdwulf
Copy link
Contributor

This was merged (Thanks @elyscape !) But I think there was one place where the single digit disk id was still being used: format_disk(). I' have made a fix here: dc3751c

@Ealdwulf
Copy link
Contributor

@rluz @FMog Does either of you have a multi-in-one card reader writer ? If not we need to acquire one before this can be tested.
This fault is caused by having a card reader which appears to windows as so many disks that there are 10 disks, so we ended writing to disk 0 instead of disk 10.

@rluz
Copy link

rluz commented Apr 28, 2015

@Ealdwulf I have a multi card reader, I can bring it tomorrow.

@rluz rluz removed their assignment Nov 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants