4

My USB stick turned out to be read-only. I want it to be writable.

I've tried many ways to fix it, but it's not working out.

root@vk:~# mount -o remount,rw '/media/vk/C84D-2766/'
mount: /media/vk/C84D-2766: cannot remount /dev/sdb1 read-write, is write-protected.
Zanna
  • 70,465
  • Did you try to plug it into a Windows machine? Maybe the controller of the USB stick is damaged. – M. Dm. Oct 25 '17 at 08:58
  • 3
    When that happens out of the blue it usually means the stick is busted. Replace it as it will no longer work. –  Oct 25 '17 at 14:06

3 Answers3

3

just ran into this issue, found this solution for msdos-formatted drives at least.

1: Find out the name and partition name of the drive:

df -Th

2: unmount the drive:

umount /media/<your name>/<your drive>

3: fix the drive:

sudo dosfsck -a /dev/<your partition>

4: remove the drive and put it back in.

5: you're done!

NOTE: This will NOT delete your files assuming they are undamaged in the first place.

Olle
  • 31
3

Your USB stick might be failing physically

  • Please read the whole answer before you start doing things with your USB stick!
  • Save your files to another drive, while you can still read them!
  • After that, unmount and try to mount the partition manually with UUID=C84D-2766.

    sudo umount /dev/sdx?
    

    where x is the drive letter (in your question b, so /dev/sdb?)

    sudo mount -U C84D-2766 /mnt
    

    You can check with

    sudo lsblk -f
    

    and try to write to the partition.

  • If that does not work, try to repair the file system.

    The UUID tells me that it is a FAT file system, and it is best to repair it with Windows tools (either via the graphical user interface in Windows or with

    chkdsk /f X:
    

    where X: is the drive letter in Windows.

    This link has more details and alternatives,

    Repair the partition table and file system of a pendrive

  • If that does not work, try to restore the drive to a standard storage device with mkusb according to these links,

    help.ubuntu.com/community/mkusb

    help.ubuntu.com/community/mkusb/wipe

    Please notice that this will delete all files, so you must save the files before doing it.

  • If that does not work, the USB stick is probably 'gridlocked'.

    The following link describes with more details what you can do to analyze the problem and what you can try before giving up,

    Can't format my usb drive. I have already tried with mkdosfs and gparted

    1. The drive is read-only: I do not mean that there is a read-only file system, but that the drive is readable but not writable (like a CDROM or DVD). This might be caused by some help system or competing system, so it is worthwhile to try according to this list,

      • On some pendrives and on many memory cards there is a small mechanical switch for write protection, that can toggle between read/write and read-only. You might have set it read-only without intention.
      • Reboot the computer and try again to restore or wipe the first megabyte with mkusb.
      • Disconnect other USB devices. Sometimes USB devices can disturb the function for each other.
      • Try other USB ports, and/or other card adapters.
      • Try another computer.
      • Try another operating system (Windows, MacOS) in another computer.
      • If you still cannot wipe the first megabyte of the drive, and the drive is read-only, it is probably 'gridlocked', and the next stage is that it will be completely 'bricked'. There is a limit, when you have to accept that the pendrive is damaged beyond repair, at least with tools available to normal users like you and me. See this link: Pendrive lifetime
sudodus
  • 46,324
  • 5
  • 88
  • 152
  • X to doubt anythings failing – Penguin9 Nov 13 '20 at 03:31
  • 1
    Sadly, that very much sounds like my USB stick... it has been slow for a month or so and all of a sudden my computer crash. Then it could not find the drive at all on reboot. I've been using it for development so all the files are in my git repo, but that was rather surprising to me! I was not using much more than 25% of the drive so in 2 years you'd think that it would still be flying. Once I have a safe backup, I'll test with reformatting to see if I can use it again, but at the moment it says "read-only" and I only could use dd if=/dev/sda1 of=backup.img to copy the drive. – Alexis Wilke Oct 23 '22 at 01:03
0

The only thing that worked for me was to install GParted from Ubuntu Software, reformat and create a new partition on the device (/dev/sdb in my case). Not sure if this was a problem with the filesystem on the USB stick or a bug within Ubuntu.