Is there a simple way to write protect USB drive?

Discussion in 'all things UNIX' started by mattdocs12345, Feb 17, 2014.

Thread Status:
Not open for further replies.
  1. mattdocs12345

    mattdocs12345 Registered Member

    Joined:
    Mar 23, 2013
    Posts:
    1,785
    Location:
    US
    Is there a simple way in KDE to write protect USB drive? I have permanently attached Clonezilla USB live session and I have by accident deleted files on it and broke the USB. Im just trying to prevent this accident from happening again.
     
  2. amarildojr

    amarildojr Registered Member

    Joined:
    Aug 8, 2013
    Posts:
    1,977
    Location:
    Brasil
    The question is: Who are you trying to protect it from?
     
  3. mattdocs12345

    mattdocs12345 Registered Member

    Joined:
    Mar 23, 2013
    Posts:
    1,785
    Location:
    US
    Myself.
     
  4. oliverjia

    oliverjia Registered Member

    Joined:
    Jul 21, 2005
    Posts:
    1,517
    If there is no physical switch to turn on write-protect, I think it could be very hard to achieve.
     
  5. Enigm

    Enigm Registered Member

    Joined:
    Dec 11, 2008
    Posts:
    188
    Depends on how good you are at soldering -
    Almost all controllers have the capability but very few implement it these days .
    But if you can find the product-sheet for your controller you can see what legs to solder a switch onto ...
     
  6. mattdocs12345

    mattdocs12345 Registered Member

    Joined:
    Mar 23, 2013
    Posts:
    1,785
    Location:
    US
    Okay let me rephrase my question. Is there anything simple that would let me hide my USB drive from the Dolphine File manager?

    I just want to prevent myself from accidentally deleting files. I don't need malware proof read only protection.
     
  7. NormanF

    NormanF Registered Member

    Joined:
    Feb 20, 2009
    Posts:
    1,439
    Try this:

    o to the DISK PARTITION utility - press start button and type "diskpart.exe" into search, open that file and click yes if prompted by the user account control,

    In the black command prompt window type "LIST DISK"
    now look for the drive you want to write protect (I use the sizes to identify the correct drive) and note the number it has to the left

    Now type "SELECT DISK 1"
    if 1 is the drive number you want to select

    Now type "ATTRIBUTES DISK SET READONLY"
    Should say it attributes set successfully

    Now close the black command prompt window and make sure it worked by trying to move something over to it and also trying to delete a file.

    If you set your disk read only, you can read but NOT write to the disk.

    A software utility that allows you to enable/disable write protection on a USB flash drive can be found here:

    http://www.irongeek.com/i.php?page=security/thumbscrew-software-usb-write-blocker


    Good luck!
     
  8. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    8,696
    You can always write to the raw device or use hdparm or any other utility to cause damage. There's no truly effective way to protect from yourself really, except a bunch of maybe workarounds.

    How about you unmount the usb drive and access it only when needed?

    Mrk
     
  9. mattdocs12345

    mattdocs12345 Registered Member

    Joined:
    Mar 23, 2013
    Posts:
    1,785
    Location:
    US
    Opensuse is wierd, according to their forume usb drives are unmounted by default. However they still show up in the Dolphin file manager and when you click on them they automatically mount...

    I went to Preferences --> removable drives and i confirmed that auto mount is unchecked and grayed out.

    I just kind of want a simple utility or an option. If there isn't any then it's fine.
     
  10. amarildojr

    amarildojr Registered Member

    Joined:
    Aug 8, 2013
    Posts:
    1,977
    Location:
    Brasil
    Did being careful now work out? :rolleyes:
     
  11. WSFuser

    WSFuser Registered Member

    Joined:
    Oct 7, 2004
    Posts:
    10,632
  12. mattdocs12345

    mattdocs12345 Registered Member

    Joined:
    Mar 23, 2013
    Posts:
    1,785
    Location:
    US
Loading...
Thread Status:
Not open for further replies.