Results 1 to 8 of 8
  1. #1
    Joined
    Jan 2008
    Posts
    32

    Remove usb flash drive write protection

    I have this flash drive that is write protected and in RAW format. I need to change that so the drive is usable again. I have used the Gnome Partition Editor, but it can't do anything because the drive is write protected.
    I have tried:
    sudo chmod 777 /dev/sdb
    sudo chmod 777 /dev/sdb1

    Those are the only names I can find for the drive as it doesn't have a location in the file system because of the RAW format.

    Anybody know how to change read-write permissions for a flash drive?
    (Also, I'm a super Linux noob.)

  2. #2
    Joined
    Oct 2001
    Location
    Southern Ontario
    Age
    40
    Posts
    13,183

    Re: Remove usb flash drive write protection

    Anyone looking into this thread should quickly look at this thread as it contains a bit more info about this case: http://forums.pcper.com/showthread.php?t=473397

    Okay. Considering you were trying to format it in Windows I'm going to assume you don't need to save any info that's currently on it as it sounds like the drive is currently completely messed up.

    Also, I haven't heard of any USB memory sticks that has a software based read only feature. I have, however seen them do, um shall I say, interesting things as they start to die. That being said, I did get a little more use out of a couple of sticks using Linux after Windows has all but given up on them. I was able to format them in Linux when formating would fail in Windows. The only problem was once I'd try to write back on the failed portion of the drive, the entire drive would corrupt again. So if we do get it working, don't put any critical information on it until you've tested it out throughly.

    I'm going to assume you're using a Ubuntu live CD to try and do the repair. If you're using a different distrobution of Linux, the sudo command may not be installed, and instead you'll have to use su to switch into root user (like the admin account on Windows), then type all the command without sudo.

    With the USB memory stick not attached to your computer, insert the Live CD into your computer and turn it on. After the OS has started, open up a terminal window. Now plug in your USB memory stick and wait a few seconds. If Gnome detects the drive it'll probably ask you if you want to mount or open it. Just cancel that for now, we're going to do everything by the command line.

    After its been plugged in for a few seconds, type the command dmesg into the terminal. It should respond with whole bunch of gibberish. But what we're looking for is the stuff at the end. You should see something along these lines:
    Code:
    [ 1072.933450] usb 2-10.3: new full speed USB device using ohci_hcd and address 8
    [ 1073.040450] usb 2-10.3: not running at top speed; connect to a high speed hub
    [ 1073.058567] usb 2-10.3: configuration #1 chosen from 1 choice
    [ 1073.085553] Initializing USB Mass Storage driver...
    [ 1073.085767] scsi16 : SCSI emulation for USB Mass Storage devices
    [ 1073.088041] usbcore: registered new interface driver usb-storage
    [ 1073.088045] USB Mass Storage support registered.
    [ 1073.093577] usb-storage: device found at 8
    [ 1073.093580] usb-storage: waiting for device to settle before scanning
    [ 1078.093781] usb-storage: device scan complete
    [ 1078.097773] scsi 16:0:0:0: Direct-Access     Generic  STORAGE DEVICE   9451 PQ: 0 ANSI: 0
    [ 1078.098412] sd 16:0:0:0: Attached scsi generic sg5 type 0
    [ 1078.432767] sd 16:0:0:0: [sde] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
    [ 1078.440763] sd 16:0:0:0: [sde] Write Protect is off
    [ 1078.440768] sd 16:0:0:0: [sde] Mode Sense: 03 00 00 00
    [ 1078.440771] sd 16:0:0:0: [sde] Assuming drive cache: write through
    [ 1078.466758] sd 16:0:0:0: [sde] Assuming drive cache: write through
    [ 1078.466763]  sde: sde1
    [ 1078.493766] sd 16:0:0:0: [sde] Assuming drive cache: write through
    [ 1078.493772] sd 16:0:0:0: [sde] Attached SCSI removable disk
    The line I highlighted in red above is where it starts to detect the drive. The blue is device ID that was given to the drive. Mine is listed as sde (so if I was to type the commands you were doing in the first post I'd need to use /dev/sde). The portion I marked in orange will be interesting to see. If it says Write Protect is on we are probably dead in the water as I don't know any commands to fix this as this usually applies to a locking switch on the disk (which you say you don't have in your other post). Finally the green portion is the partition name given to your USB stick.

    Assuming that it says the drive's Write Protect is off, then we'll begin by trying to format it. The portion above that I highlighted green was the partition name given to my drive: sde1. We'll try and format it as FAT32 since that allows the maximum compatibility with other devices. Try the following command:

    sudo mkfs -t vfat /dev/sde1

    If that does not produce an error message, then you should be good. Try unplugging the drive, wait a couple seconds and plug it back in. Gnome should then detect it and ask if you want to mount it. Mount it and open up the Gnome's file explorer, Nautilus and see if you can now create a new folder on the drive. If it works, you should be laughing. But just watch out as this could happen again at any time. You may want to consider RMAing the drive as its probably still faulty.

    If that doesn't work, post back and we'll go from there. And if you can, please cut 'n past the last few lines of the dmesg command after inserting the drive into the computer.

  3. #3
    Joined
    Oct 2001
    Location
    Southern Ontario
    Age
    40
    Posts
    13,183

    Re: Remove usb flash drive write protection

    Quote Originally Posted by Dance Commander View Post
    I have tried:
    sudo chmod 777 /dev/sdb
    sudo chmod 777 /dev/sdb1
    BTW, the commands you typed here would only affect the permissions within the Linux file system. It wouldn't affect the drive its self. If you needed to run a command and used sudo at the start, then you'd have full permissions over all of the Linux file system. Hence sudo allows you to read/modify/delete any file that is stored on a device that allows modifications to its data.

  4. #4
    Joined
    Jan 2008
    Posts
    32

    Re: Remove usb flash drive write protection

    Ok, thanks a lot. I feel like I'm actually making progress now.
    Here is what I get when I type dmesg from the usb driver line on down:
    Code:
    [  120.114789] Initializing USB Mass Storage driver...
    [  120.115059] scsi2 : usb-storage 1-3:1.0
    [  120.115247] usbcore: registered new interface driver usb-storage
    [  120.115252] USB Mass Storage support registered.
    [  121.113122] scsi 2:0:0:0: Direct-Access     Generic  Flash Disk       8.00 PQ: 0 ANSI: 2
    [  121.114287] sd 2:0:0:0: Attached scsi generic sg2 type 0
    [  121.117954] sd 2:0:0:0: [sdb] 65536000 512-byte logical blocks: (33.5 GB/31.2 GiB)
    [  121.118443] sd 2:0:0:0: [sdb] Write Protect is off
    [  121.118451] sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
    [  121.118457] sd 2:0:0:0: [sdb] Assuming drive cache: write through
    [  121.122967] sd 2:0:0:0: [sdb] Assuming drive cache: write through
    [  121.122981]  sdb: sdb1
    [  121.374976] sd 2:0:0:0: [sdb] Write Protect is on
    [  121.374984] sd 2:0:0:0: [sdb] Mode Sense: 03 00 80 00
    [  121.374990] sd 2:0:0:0: [sdb] Assuming drive cache: write through
    [  121.374998] sd 2:0:0:0: [sdb] Attached SCSI removable disk
    There are two devices there. When I look in the Disk Utility it says the device name is sdb, and the volume name is sdb1. Not quite sure what that means, so I'm not sure if the fact that the first is not write protected and the second is.
    Here's what happens when I enter the format command:
    Code:
    matt@ubuntu:~$ sudo mkfs -t vfat /dev/sdb1
    [sudo] password for matt: 
    mkfs.vfat 3.0.9 (31 Jan 2010)
    mkfs.vfat: unable to open /dev/sdb1
    matt@ubuntu:~$ sudo mkfs -t vfat /dev/sdb
    mkfs.vfat 3.0.9 (31 Jan 2010)
    mkfs.vfat: unable to open /dev/sdb
    Edit: Also I have a Ubuntu partition installed on my hard drive. No slow Live CD for me.
    Last edited by Dance Commander; 10-13-2010 at 03:36 PM.

  5. #5
    Joined
    Oct 2001
    Location
    Southern Ontario
    Age
    40
    Posts
    13,183

    Re: Remove usb flash drive write protection

    Do you have a make and/or model number of this drive? Linux says it is write protected. Why it loaded read/write then switched to read only I don't know yet. But inquiring minds want to know!

  6. #6
    Joined
    Oct 2001
    Location
    Southern Ontario
    Age
    40
    Posts
    13,183

    Re: Remove usb flash drive write protection

    Quote Originally Posted by Dance Commander View Post
    There are two devices there. When I look in the Disk Utility it says the device name is sdb, and the volume name is sdb1. Not quite sure what that means, so I'm not sure if the fact that the first is not write protected and the second is.
    A volume is the proper term for a formatted partition. Unlike Windows where they are often confused with a completely different drive (aka C: and D: can be two volumes on the same drive).

    I'm thinking that its starts out connecting to the drive in read/write mode but then reconnects in read only mode. But this is puzzling behavior.

    Edit: Also I have a Ubuntu partition installed on my hard drive. No slow Live CD for me.
    Even better !

  7. #7
    Joined
    Jan 2008
    Posts
    32

    Re: Remove usb flash drive write protection

    I head back from Kingston tech support, and I found out that my drive isn't a real Kingston drive. So who knows what crappy hardware is in it. Also, they said that it being on read only mode means there was a hardware failure, but the drive and volume being in different modes has me doubt the finality of that statement in my case.

  8. #8
    Joined
    Jul 2009
    Posts
    553

    Re: Remove usb flash drive write protection

    Have you tried this Apacer utility everyone (on the internet) seams to swear by? I've never used it myself but never had a read only USB drive either .

    http://www.fixya.com/support/t345484...tect_usb_drive

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •