Somehow I messed up and accidentally made my usb stick into a read only file system. I have tried a bunch of things to delete the files, including the basic (rm -f myfile) and attempting to allow writing (sudo chmod +w myfile) and then deleting, but none of this seems to work. Any ideas on what I can do. I don't have anything on the usb stick that I need, but I don't want to throw away an otherwise perfectly good piece of equipment.

How can I make it work? Am I going about this completely the wrong way?


Commands like rm and chmod are done on a mounted file-system. So if the file-system is read only those do not work. What you need to do is to mount the file-system as writeable.

Some USB sticks have a switch on the stick to mount them read-only. Maybe that is the reason. It could also just be broken or damaged due to not correctly umounting it.

Before you do anything: copy the files over from the stick.

If it is not a hardware switch unplug and plug the USB stick and issue a

dmesg | grep -i panic

This will show you any panic messages. If you are seeing alot of them related to the USB stick and if it is a FAT partition you can use dosfsck to fix it.

You can find out how it is mounted with


and use

dosfsck -a /dev/sd{xn}

to fix an MS-DOS partition table or sudo mkfs.vfat /dev/sd{xn} to format the disc. Where {xn} is a letter and digit you got with the mount command.

You can also use gparted to format it by the way.

| improve this answer | |
  • 1
    I had to use sudo mkfs.vfat (I almost forgot to try that), but now it seems to work. Thanks. – Jonathon Aug 28 '11 at 17:29
  • 1
    um.... this doesn't work if the usb stick is not formatted dos/fat but mine is formatted ext4... how do I make it mount writeable? – Joshua Robison Aug 10 '12 at 6:35
  • 1
    @Rinzwind this method isn't working for me. Output of sudo mkfs.vfat /dev/sdc1 is mkfs.fat 3.0.28 (2015-05-16) mkfs.vfat: unable to open /dev/sdc1: Read-only file system. What can i do? – KVS Apr 22 '17 at 1:38
  • As root i get: fsck.fat 3.0.28 (2015-05-16) open: Read-only file system Also gparted is powerless. – Scorpion Sep 28 '18 at 17:20

I encountered this. The fault was corrupted partitions. Check your partition on the USB stick. This can get corrupted if you try formatting on Win and then on Ubuntu. use "gparted". You should see only 1 active partition. If you have an "unallocated" partition as well, the USB stick wont work. If so, delete all partitions, and create one active partition only for the full gb size of the usb stick. unplug then plug in again, and you should have R/W again.

| improve this answer | |
  • This answer makes a bit more sense than the others in my particular situation. The extra partition laying around looks like the symptoms I have. – Gustavo Carreno Sep 30 '12 at 18:24

Yes, if the filesystem is read-only, then setting modes on files will not have any effect at all. You can see in /etc/fstab if the filesystem is mounted read-only. But if you don't have anything on it, then you can also just make a new filesystem for it in gparted or palimpsest (the latter is installed by default in Ubuntu and is called Disk Manager or something).

| improve this answer | |

Check if you have the package ntfs-3g installed. Worked for me ;-) (remove and plug in your usb drive again after installing ntfs-3g)

| improve this answer | |

As I mentioned here I had a similar problem.

ntfs-3g already installed, chmod commands also did not help, did not see any significant error codes. Gparted did not work either. In fact, I found no USB worked. $dosfsk command did not help either.

All I did was reboot the ubuntu 16.04 machine with the stick in and now the USB sticks work.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.