Menu

#14 Prevent writing to usb hard drives

1.0
open
None
2019-03-12
2016-05-20
No

Google and you'll see it happens.
I like to feel safe. I often use my usb hard disk connected to the PC, especially when playing around with images. The safety to have the tool check for me is better than me being aware and careful, because the chance is exisiting that one day i'm making the mistake.
I guess there are various ways to distinguish (larger) hard drives from SD/... card writers. One simple way is to put a little menu/configuration item that specifies the maximum size of disk to show in the pull-down menu where the disk is selected. A portable USB drive has a size likely in the order of terrabytes, far away from the kind of images one typically wants to read/write. So it is fairly easy to put a default limit that is fair. Yet, any other method to distinguish portable drives is fine, any sort of flag/configuration to disable/enable/change the filter will do.

Discussion

  • Jeff B

    Jeff B - 2016-05-20

    We do have checks in place currently. We ensure that the device is on the USB bus, it's marked as removable, and it's not above a certain size (which exact value escapes me at the moment, but it's on the order of 130GB or 250GB or something along those lines, I believe). These checks have caused problems with some card readers already, so any check is a bit of a trade-off.

    I don't mind the idea of exposing that value to the user, making it configurable, but I believe that one of Tobin's main goals for the project is a very simple interface. He can comment on that, but I believe that he wants to keep it uncluttered. Not a bad idea though, as time will eventually make any static value "inappropriate".

     

    Last edit: Tobin Davis 2018-01-27
  • Pieter Blommaert

    Thx for the feedback.
    I currently have a portable WD 2TB USB disk connected and it is listed in the drop down. (I obviously don't plan to check what happens if i actually try to write to it). So the check doesn't seem to be complete or maybe not in place for some reason? (just installed version 0.9.5)

    As for GUI, no point. I'd prefer a (maybe somewhat hidden) setting, but as you say, that just assures flexibility/future safety.

     
  • Jeff B

    Jeff B - 2016-05-20

    Appreciate the input - sounds like something in the condition isn't working if your device is showing. Nothing 2TB should appear, as far as I can recall. Something to look into. Thanks.

     
  • Tobin Davis

    Tobin Davis - 2016-12-02

    I will look into this with the next release (coming soon). Jeff is right, the code is there to check, but it may have been put in post-v.0.9.5 release. There are a lot of other enhancements that have gone in as well, like the ability to detect USB Floppy now. Part of the problem is that the Windows API's are very scattered. There isn't a single query that gives the programmer all of the information of a device, it requires multiple IOCTL calls and reading of nested structures returned from those calls. Some calls won't work for some devices, others only work on specific devices (one call will return one enum of fixed, removable, or ~20 different floppy formats)..

    Add to all of this that my primary work and focus is Linux based (I'm a Linux programmer developing a Windows app - what could go wrong?) and you get a better sense of the complexity.

     
  • Bacsó Márton

    Bacsó Márton - 2017-03-11

    Unfortunately my 6Tb WD MyBook is still shown in the list in 1.0.0. As for what happens if somebody tries to write on it: the program wipes everything from the hard drive. I know it, because I did it once by accident. Fortunately I could bring most of my data back that time.

     
  • Tobin Davis

    Tobin Davis - 2018-04-28
    • assigned_to: Tobin Davis
     
  • Tobin Davis

    Tobin Davis - 2018-04-28

    I am aware of this happening. Unfortunately, the current code base and GUI doesn't give many options for more selective control, and the WIndows APIs are horrid to say the least.

    I also have a dilema; on one hand I have users (such as yourself) wanting this fixed, but I also have an open feature request wanting the exact opposite.

    I will make no promises for the next release (I'm taking vacation time soon to start working on it again). Main priority is to address SD detection and possibly image compression support. I may be able to add drive sizes to the dropdown as well, depending on the complexity.

     
  • Bacsó Márton

    Bacsó Márton - 2018-04-29

    Thank you in advance :-) Btw, Libreelec's image burner application doesn't allow me to write on my external usb hdd. Ethcer would allow, but at least it gives me more informaton about the destionation (like: capacity and name).

     
  • Slappy McPhee

    Slappy McPhee - 2018-05-16

    I cannot upvote this enough. I just had a behavior that caused me to have to spin up SuperScan in Active File Recovery Pro because even though I selected the media to write a linux image to once I actually selected the .img file for some stupid reason the drive tree refreshed. I was in need of writing to the N drive which is the microSD card however when it refreshed it detected my M drive at the top of the tree and selected that. A 1TB drive full of data! I have a dozen drives on this machine so having the ability to see the drive size especially as a secondary sanity check would be wonderful. I personally can't fathom why someone wouldn't want to have the drive size or hell even the nomclature shown in the lilst for tracking purposes? To me the GUI should have a wizard of sorts that would show you something similar to like what you see for example in backup software or file recovery like the attached image.

     
  • me

    me - 2018-08-13

    why not just have a warning on write saying this is a large device are you sure you want to overwrite it? This warning would activate above the 250gb limit or whatever you think is appropriate.

    Doing it this way would keep everyone happy as those who genuinely want to image something that big will still be able to.

     
  • me

    me - 2018-08-13

    PS I can see how people can make this mistake, as if there's any kind of error on write DI will change the destination drive letter. If you're not paying attention you could easily overwrite the wrong device when you try again.

     
  • iaakki

    iaakki - 2019-03-12

    Ok I just wrote 16gib SD image on my 1 terabyte HDD having all my personal backups etc. Thank you XOXO.

     

Log in to post a comment.