How to fix read only USB pen drive in Ubuntu
While copying some large file I mistakenly taken out USB pen drive before the copy get completed.Later I again attached the USB pen drive in Ubuntu system but found that the USB pen drive showing read only filesystem message. I was not able to copy,create and delete any file.To solve this issue I followed some steps which I am sharing with this post.
To fix USB pen drive read only in Ubuntu,follow the given below steps
Step 1: Attach USB pen drive in system’s USB port. Automatically the Ubuntu will mount the USB pen drive and show icon on Desktop or Menu bar.
Open the terminal and become super user by running below given command
sudo su -
Step 2: First we have to find out in which directory the USB pen drive has been automatically mounted.For this run the df -Th command.
In given below output you can see,in my system the USB pen drive is mounted in /media/linux/C38C-099C ,partition is /dev/sdd1 and filesystem is vfat.
Note: When you run df -Th command in your system,the USB pen drive may mount in different directory and the partition might also be different.Hence the output value which you will get, use the same values in further steps.
[email protected]:~# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda5 ext4 28G 25G 1.3G 96% / udev devtmpfs 2.0G 4.0K 2.0G 1% /dev tmpfs tmpfs 796M 1.1M 795M 1% /run none tmpfs 5.0M 8.0K 5.0M 1% /run/lock none tmpfs 2.0G 528K 2.0G 1% /run/shm none tmpfs 100M 104K 100M 1% /run/user cgroup tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup /dev/sda7 ext4 9.2G 8.2G 539M 94% /partition7 /dev/sda8 ext3 46G 38G 6.2G 86% /partition8 /dev/sda9 ext3 74G 67G 3.1G 96% /partition9 /dev/sda21 ext4 14G 4.9G 8.3G 37% /partition10 /dev/sdd1 vfat 15G 12G 3.6G 77% /media/linux/C38C-099C
Step 2: Now unmount the directory in which the USB pen drive is automatically mounted . (As you can see mounted directory path in above ‘Step 1’)
Note: Replace the/media/linux/C38C-099C with the mounted USB pen drive directory path which is showing output in your system after running df -Th command.
umount /media/linux/C38C-099C
Step 3: As we know the USB pen drive got /dev/sdd1 partition
and filesystem is vfat(see in Step 1). Now we will run dosfsck command to check and repair the filesystem
Note: The dosfsck command check and repair MS-DOS filesystems.Because the filesystem of USB pen drive is vfat hence we are using this command
dosfsck -a /dev/sdd1
Step 4: After the dosfsck command get completed.Remove the USB pen drive from system and then re-attach back to system.Now your USB pen drive should working and it should not have read only filesystem.
Note** After mounting the USB pen drive you may see a new file with extension .REC which was created because of dosfsck command.
Step 5 Reboot the system after completing all the steps. (This step we have added after receiving lots of suggestion in comments section from our readers around the world. Thank you for providing feedback and sure it will help many people.)

Owwww GOD! I t Is Wooooooork Thank You.. so much Guys ..
You Really Save My Time; God Bless Your Skills.
.
.
I Bookmark Your Website …. and finally I will share this for my friends and other… Have a good day!
Worked perfectly!!! Thank you!!!
Thanks for the tip. It worked for me in ubuntu 17.10 x64
To my regret it didn’t worked for me…
[email protected]:/home/dam# dosfsck -a /dev/sdc1
fsck.fat 4.1 (2017-01-24)
open: Read-only file system
Also not after a reboot.
Is there another solution?
Thanks!
I really appreciate your great help. A locked memory is not worth much.
Thanks.
Oscar Dominguez
I cannot do step 2 because my usb label consists of two separate words so when I try to do
umount /media/mike-casa/GMAC LINUX
I get
umount: /media/mike-casa/GMAC: No such file or directory
GMAC LINUX is the label of my usb
I get this for my first step
[email protected]:~$ df -Th
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs tmpfs 390M 6.3M 384M 2% /run
/dev/sda1 ext4 19G 7.8G 9.6G 45% /
tmpfs tmpfs 2.0G 292K 2.0G 1% /dev/shm
tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/loop0 squashfs 80M 80M 0 100% /snap/core/2312
/dev/loop1 squashfs 81M 81M 0 100% /snap/core/2381
/dev/loop2 squashfs 80M 80M 0 100% /snap/core/1689
/dev/loop3 squashfs 91M 91M 0 100% /snap/writefull/5
/dev/sda2 ext4 193G 41G 144G 23% /home
tmpfs tmpfs 390M 80K 390M 1% /run/user/1000
/dev/sdb1 vfat 7.5G 2.6G 4.9G 35% /media/mike-casa/GMAC LINUX
[email protected]:~$ umount /media/mike-casa/GMAC LINUX
umount: /media/mike-casa/GMAC: No such file or directory
I cannot do step 2 because my usb label consists of two separate words so when I try to do
umount /media/mike-casa/GMAC LINUX
I get
umount: /media/mike-casa/GMAC: No such file or directory
GMAC LINUX is the label of my usb
Hey Mosololi,
Change your USB drive name without any space. Eg. “GMAC” instead of “GMAC LINUX” then it’ll work
Try in this way if you do not want to rename –
umount /media/mike-casa/GMAC\ LINUX
Regards
Sharad
Hello Sharad Chhetri
This has helped me immensely.
Thank you for this great article/tip.
Rock On buddy!
share the knowledge with others too.
Regards
Sharad
Just perfect, thanks.
Welcome Stuart!
Regards
Sharad
Thank you very much. It works for me.
Thank you very much!
The only solution that worked for me.
Thanks from me too Sharad, I rebooted and can use the usb drive again 🙂
Thank you for giving the feedback. Another addition in list of happy people.
Regards
Sharad
Thank you from me too! Your solution worked easily. Best regards!
Thank you!
worked perfectly! 😛
Thanks for this! been looking for a solution to this for ages and this one actually worked! Would be nice to see it as a function or built into an app though.
Hi Alien,
Thank you, your idea is good but I hardly invest time on development. If time allows, will try some hand on GTK+Python.
Regards
Sharad
thanks a lot!!!
Worked perfect, just make sure to reboot afterwards.
Thanks!
I followed all the steps but it is not worked for me,still I am not able to delete any file and format the drive.
Any other suggestion…?
Last command response:-
[email protected]:~$ sudo dosfsck -a /dev/sdb1
fsck.fat 3.0.28 (2015-05-16)
open: Read-only file system
Didn’t work for me, follow the steps, no errors or anything, but the USB is still read-only :s
OK, after testing a bit more, apparently if you reboot your PC after doing the solution above (or any of the other ones on the web), you might solve the issue, at least it did for me.
Hope it works for you guys!
It did. Thank you
sorry boss it is saying permission denied.
” [email protected]:~$ dosfsck -a /dev/sdb1
fsck.fat 3.0.28 (2015-05-16)
open: Permission denied “
It requires here sudo permission.Like this –
sudo dosfsck -a /dev/sdb1Regards
Sharad
Thanks very much 😉
brilliant mate , thanks very very much , it worked 1st time after a lot of searching . great . much appreciated your doing this .
vern FROM MELBOURNE .
Welcome Vern,
Keep sharing the knowledge.
Regards
Sharad
Crappy regression on Ubuntu/Mint. Now is year 2016 and I cannot write to USB!!! and have to apply several steps from command line instead of get it fixed with first critical system update asap.
Very very useful information.
Thank you
Good to know that I’m not the only one who still use this when I encounter such problems. Works like a charm.
very very useful information. Thank you.
Superb! I wrestled with a new USB for hours yesterday, and this fixed it in seconds. Thanks for the clear explanation of the process.
nice! thanks for feedback.
Regards
Sharad
Thanks Sharad. My filesystem reads as hfsplus and the last statement seems like not working. I am getting the output as this.
fsck.fat 3.0.26 (2014-03-07)
Logical sector size is zero.
Any suggestions?
Hi Albert,
Unfortunately it seems the disk is corrupted and could be sectors are also affected.
Use the ‘testdisk’ [please,google it] , if there is any ray of hope then most probably you have to rebuilt the file system by using ‘TestDisk’
You have to “Do it yourself” because I am forgotten and these kind of issue rarely come [once in a blue moon] .
All the best!
Regards
Sharad
Thank you
Welcome Fabio!
Regards
Sharad
Hello sir
please solve my problem i tried these steps but ihe didnt work
sudo su –
df -Th
umount /media/govind/5A85-E61F
/dev/sdb1 vfat 7.5G 3.2G 4.3G 43% /media/govind/5A85-E61F
dosfsck -a /dev/sdb1
fsck.fat 3.0.28 (2015-05-16)
open: Read-only file system
Hello Henmant,
Try formatting USB pen drive in GUI mode. http://sharadchhetri.com/2015/05/11/gui-format-usb-drive-on-ubuntu/
Regards
Sharad
Hi,
I have same problem which Henmant has.
I followed your steps but it didn’t change anything.
Then I tried GUI mode. After formatting when I plug in my pen drive again I received a message:
Error mounting /dev/sdb1 at /media/grarysz/Linux Mint 18 Cinnamon 64-bit: Command-line `mount -t “iso9660” -o “uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500” “/dev/sdb1” “/media/grarysz/Linux Mint 18 Cinnamon 64-bit”‘ exited with non-zero exit status 32: mount: block device /dev/sdb1 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog – try
dmesg | tail or so
This is my third pen drive I’ve lost in the same way…
Thanks, I follow your steps but i got this message:
fsck.fat 3.0.28 (2015-05-16)
open: Permesso negato
What can i do?
Hello Alex,
May be you are not login as super user. Run the command
sudo su -and then follow the steps.Regards
Sharad
thank u my friend ! u’r a life saver 🙂
Thanks bro!
I wish fixing USB pen drive could be life saver 🙂 Many issues could be solved.
Thanks again for commenting and giving feedback. Keep sharing the knowledge.
Regards
Sharad
I have a similar problem to this. I have a read-only usb pen drive and also one of my folders gives me this error warning when I try to open it: This location could not be displayed. Sorry, could not display contents of “june”: Error when getting information for file ../LEXAR/june/…:Input/output error
I’ve searched online but other topics on this were inconclusive.
Can you please help me out?
Thank you
Hello Janne,
If your USB pend drive is Read Only and has really some malfunction with hardware then it is lucky to get the solution.
Try Gparted (http://gparted.org/) . Also check if your USB pen drive has any small button which is used for making Read Only. Some USB model has this option.
Regards
Sharad
Thanks! Worked perfect for me. You might also want to add that the .REC file can be renamed with the appropriate extension and at least in my case with a .tar.gz file I could recover it.
Thank you Jeffrey,
Approving your comment which can be considered as suggestion also.
Regards
Sharad
Great stuff! It worked. Thanks.
When I give dosfsck -a command it shows permission denied …what I have to do now
Use
sudo dosfsck -a. Your login user must have sudo privileges .Or login with root usersu -l rootRegards
Sharad
it is taking so much time in my 1000gb external adata hard drive. what should i do in this case stop the process or wait for 1 week .
Did not work for me
Hello Oddrocks,
If USB hardware is still healthy then there is a possibility. I hope you followed the steps after proper reading.
Regards
Sharad
Hi Sharad – not successful – i get the following in mint 17
[email protected] ~ $ sudo su –
arun-GA-78LMT-USB3 ~ # df -Th
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 3.9G 4.0K 3.9G 1% /dev
tmpfs tmpfs 797M 1.5M 796M 1% /run
/dev/sda5 ext4 453G 27G 404G 7% /
none tmpfs 4.0K 0 4.0K 0% /sys/fs/cgroup
none tmpfs 5.0M 0 5.0M 0% /run/lock
none tmpfs 3.9G 672K 3.9G 1% /run/shm
none tmpfs 100M 20K 100M 1% /run/user
/dev/sdc1 vfat 3.3G 1.5G 1.9G 45% /media/arun/USB Stick
arun-GA-78LMT-USB3 ~ # umount /media/arun/USB Stick
umount: /media/arun/USB: not found
umount: Stick: not found
Hello Arun,
Try this,
Regards
Sharad
same error as before-
arun-GA-78LMT-USB3 ~ # umount /media/arun/USB Stick
umount: /media/arun/USB: not found
umount: Stick: not found
Hello Arun,
Check two things
1. USB should be properly mounted.
2. I can see you are typing ‘USB Stick’ not like this ‘USB Stick’ as suggested in my comment.
Can you send me the screenshot instead of pasting the output.
Regards
Sharad
Really very use full thanks
Welcome Sawan,
Happy to add one more positive feedback. The troubleshooting is really helping.
Regards
Sharad
Absolutely great !!!!! thank you 🙂
Welcome Indrajeet,
Regards
Sharad
Thanx , you save my time .
I’m clearly not too bright, 147 IQ points and nothing to show for it. I repeatedly cause myself this problem, panic, and forget what to do.. I actually bookmarked this article a while back because it has saved the day every time! I usually subject my thumb drives to it, but today I tried it with my MP3 player and now I don’t have to buy a new one I can’t afford! 😀 Thanks!
Much appreciated…thanks!
This method worked for me. Five stars!
Worked perfect for me. Thanks so much 🙂
Hi Fen,
Appreciate for giving feedback and sharing experience.
Regards
Sharad
Hello, I tried both, using dosfsck and even testdisk, but it keeps saying read-only… stupid pendrive. 🙂
And is it ok to remove the *.REC files after that, or would this cause the problem again to appear?
Hi Aslanex,
It is OK to remove *.REC file. No problem will appear. I did same 🙂
Regards
Sharad
$ dosfsck -a /dev/sdb1
fsck.fat 3.0.27 (2014-11-12)
open: Read-only file system
Never mind. I get to backup my data with testdisk. And now formatting it, until a same problem happen the next time.
I followed your steps to fix the pen drive error before. But this time, I am not getting any workarounds to solve this.
When I run “dosfsck -a /dev/sd..”, it got stuck with this message.
============
fsck.fat 3.0.26 (2014-03-07)
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
Automatically removing dirty bit.
FATs differ but appear to be intact. Using first FAT.
/
Contains a free cluster (298861). Assuming EOF.
============
Under properties, the file system type is listed as “msdos”.
I only have 200 MB space left from my 4GB flash, but nothing apart from the freaking virus is displayed. (I tried the basic Ctrl+H ..)
Any suggestions?
Thanks.
Never mind. I used Testdisk to recover my files, and then format the disk.
Hi Eskender,
That is nice. You got the solution and shared here, this is more helpful. Other readers will also try this.
Regards
Sharad
is not working for me still getting destination is read only
Bookmark this page in my browser so that I could always come here & follow these steps when I face Read only USB problem – check
Dude, I’ve spent an hour trying to fix this (linux newb here) and this worked! I could kiss you man haha
Thanks…..it worked for me.
Welcome Harsh,
Another very useful feedback.
Best Regards
Sharad
Perfect. Thank you
Most Welcome Muncy,
Thank you for comment.
Regards
Sharad
Thank you very much.
It really helped.
Thanks Neeraj ,
I am glad to see the feedback. It helps to our other friends who come across through search engine.
Regards
Sharad
Works like a Charm. Thank you.
Thanks Rajiv,
Appreciate for feedback on this workaround.
Keep reading our blog.
Warms Regards
Sharad
Thank you for this article. I was able to save my files. It’s important to substitute your personal files instead of using the authors. For example, my USB pen drive was mounted in “/media/user/08E7-563B,” the partition was “/dev/sdb1” and the filesystem was “vfat.”
The commands I had to use were:
sudo su –
df -Th
umount /media/user/08E7-563B
dosfsck -a /dev/sdb1
Then all I had to was wait for it to finish, unplug my USB drive when it was done, and plug it back in. Works perfectly now, and it even has the file that failed to copy over and locked my drive up. This couldn’t have been more simple.
Thanks, it works …
Welcome Akash,
The feedback is very helpful for many readers.
Regards
Sharad
I have a 32G USB memory stick with a FAT32 file system that mounts read only
blkid is /dev/sdc1: UUID=”551C-2AA9″ TYPE=”vfat” PARTUUID=”2b71fb4e-01
It mounts on /run/media/saejin/551C-2AA9
I tried installing it in a windows machine and ejecting it. It did not fix the problem.
# umount /dev/sdc1
#mkdosfs -F 32 -I /dev/sdc1
mkfs.fat 3.0.27 (2014-11-12)
mkdosfs: unable to open /dev/sdc1: Read-only file system
# umount /dev/sdc1
#dosfsck -a /dev/sdc1
mkfs.fat 3.0.27 (2014-11-12)
open Read-only file system
It worked… ubuntu 12.04 and the filesystem is vfat. dosfsck found the problematic file.
Thank you Sharad for your help!
Welcome Ricardo,
Regards
Sharad
Thank you Sharad for the details and steps.
Thankyou Nava,
Glad to know it worked for you
Regards
Sharad
Wow! This is wonderful. Works!!! Thank you very much for this.
Welcome Bikash
I don’t this it’s working for me 🙁
[email protected]:~# umount “/media/abhijith/NEW VOLUME”
[email protected]:~# dosfsck -a /dev/sdb1
fsck.fat 3.0.26 (2014-03-07)
open: Read-only file system
[email protected]:~#
After running “umount /media/ubuntu/Ubuntu 14.10 amd64”
I got this output:
umount: /media/ubuntu/Ubuntu: mountpoint not found
umount: 14.10: mountpoint not found
umount: amd64: mountpoint not found
What this means and what should I do to rectify?
Thank you!
Hello Friend,
df -hcommand will help to find mounted partition on system .Just run the command and check if /media/ubuntu/Ubuntu 14.10 amd64 is mounted.
The message itself shows /media/ubuntu/Ubuntu 14.10 amd64 is not mounted on system.
Regards
Sharad
Same output came on “mounted on”
[email protected]:~# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda6 ext4 221G 51G 159G 25% /
none tmpfs 4.0K 0 4.0K 0% /sys/fs/cgroup
udev devtmpfs 1.9G 4.0K 1.9G 1% /dev
tmpfs tmpfs 385M 1.2M 384M 1% /run
none tmpfs 5.0M 4.0K 5.0M 1% /run/lock
none tmpfs 1.9G 160K 1.9G 1% /run/shm
none tmpfs 100M 64K 100M 1% /run/user
/dev/sdb1 vfat 7.5G 638M 6.9G 9% /media/ubuntu/Ubuntu 14.10 amd64
[email protected]:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 221G 51G 159G 25% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 385M 1.3M 384M 1% /run
none 5.0M 4.0K 5.0M 1% /run/lock
none 1.9G 160K 1.9G 1% /run/shm
none 100M 64K 100M 1% /run/user
/dev/sdb1 7.5G 638M 6.9G 9% /media/ubuntu/Ubuntu 14.10 amd64
What shall I do?
email has been sent to you, I hope you followed it.
Regards
Sharad
I have tried that too but no result and i have explained how it happened through mail.
Could you help me with that
sure, we are already communicating in email.
Will contact you back.
Regards
Sharad
I did all process but now my pendrive isn’t reconized by any Operational System.
Hello Alessandro,
After attaching pen drive, run
fdisk -lyou may get the disk infoRegards
Sharad
I’m also having the same problem. I’m not able to fix read only usb problem despite going through the procedure mentioned above.
Hello Sushil,
The solution works when there are some chances of possibility. If USB is completely malfunctioned on hardware level then it wont work in this way.
Here, in this post logic is to first convert the USB filesystem into vfat. Then run the command dosfsck . Try once again and send the out put of
df -Thif issue still persist.Regards
Sharad
[email protected]:~# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda7 ext4 68G 3.8G 60G 6% /
none tmpfs 4.0K 0 4.0K 0% /sys/fs/cgroup
udev devtmpfs 1.9G 4.0K 1.9G 1% /dev
tmpfs tmpfs 387M 1.1M 386M 1% /run
none tmpfs 5.0M 0 5.0M 0% /run/lock
none tmpfs 1.9G 80K 1.9G 1% /run/shm
none tmpfs 100M 44K 100M 1% /run/user
/dev/sda3 fuseblk 146G 115G 31G 80% /media/sujit/study
[email protected]:~# umount /media/sujit/study
[email protected]:~# dosfsck -a /dev/sda3
dosfsck 3.0.16, 01 Mar 2013, FAT32, LFN
Currently, only 1 or 2 FATs are supported, not 0.
Filesystem type for USB is showing fuseblk . Change it to
vfatfilesystem and try again.Regards
Sharad
how do we change the filesystem?
For making vfat system , you can use the command
(Recommended reading : http://linux.die.net/man/8/mkfs.vfat)
or
Regards
Sharad
i just run both commands
1.mkfs.vfat /dev/sdc1
mkfs.fat 3.0.26 (2014-03-07)
mkfs.vfat: unable to open /dev/sdc1: Read-only file system
2.mkdosfs -F 32 -I /dev/sdc1
mkfs.fat 3.0.26 (2014-03-07)
mkdosfs: unable to open /dev/sdc1: Read-only file system
Have you any other solution for this ?
Thanks
Sachin SIngh
Hello Sachin,
Thank you for trying the method. If USB drive has hardware issue then there is no command to fix it.
You can try formatting the USB pen drive through GUI. Read our this post if this one work for you. http://sharadchhetri.com/2015/05/11/gui-format-usb-drive-on-ubuntu/
Regards
Sharad
Dear Admin,
Thanks to reply ,
I can access my pendrive can play the videos that present in my pendrive and can open and see the docs. is it possible that after all this there may be any hardware issue bcoz i just try all possible solution in all solution my system is telling same thing that I have only read access. is there any solution to save my disk or its just a toy now?
dosfsck command is not working for me, I got:
dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
FATs differ but appear to be intact. Using first FAT.
/.Trash-1001/expunged/3019349019/chap 2- preliminary/Lab_works/Jan-03-2012/bram_b/ipcore_dir
Contains a free cluster (1578960). Assuming EOF.
/…/case3.png
File size is 3927 bytes, cluster chain length is 0 bytes.
Truncating file to 0 bytes.
Unable to create unique name
it worked, thanks
Thankyou Kunal,
Glad to know it works for you.
Regards
Sharad
not solved for me either. Fresh format of usb stick under ubuntu 12.04 with gparted. Did all the steps.
[email protected]# umount /media/greyone
[email protected]# dosfsck -a /dev/sdb1
dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
/dev/sdb1: 1 files, 1/950884 clusters
[email protected]#
plugged back in and same problem.
maybe the problem lies here?
USB-Device is, or become suddenly read only without errors
If you see “Write Protect is off” and no errors in your logfiles, than you should set filesystem type specific mount options (FS_MOUNTOPTIONS) in /etc/usbmount/usbmount.conf. Wrong gid causes mounting read only.
Thank you!
I just get the output
open: Read-only file system
Hello Minu,
Are you still facing the issue ?
Regards
Sharad
Even I’m getting the same proble as Minu.
Same problem…. any solution?
Hi i m tryed it but it still no work 🙁 tryed 3x and nothing if u can help me PM me to mail
” open: Súborový systém dovoľuje len čítanie ” ( Open : File Systems are for READ-ONLY )
Hello Sayky,
Can you try once again and take screenshot of each steps.OR make a video of it. (In rare troubleshooting cases I asked for video)
You can send the file at [email protected]
Regards
Sharad
Hello Sayky,
Môžete tiež napísať Vašu otázku vo vašom jazyku danej krajiny.
You can also write your question in your country language.
Thanks and Regards
Sharad
yes , thumps up … it’s working
thank u.
Welcome Sam,
Glad to know ,issue is solved by this method
Thank you very much!!!
You are Welcome Paulo