1

I have a 64GB stick that was working fine. I started putting movies on it, and then suddenly, one day it becomes read only. chmod cannot change it. So I reformatted and started again. After 2 days it became read only again for no apparent reason. I reformatted again (FAT32 each time) because I have to plug it into a player that can't read ext4. And again it became read only. So it works for a couple of days after reformatting, then becomes read only.

Any ideas as to why this is happening?

Rinzwind
  • 299,756
i9pp0
  • 702

2 Answers2

2

A file system that is mounted read-only may not be clean, i.e. properly closed. It then is in an inconsistent state. Have the file system checked, after which it should mount without problems. You can check and repair a file system using the "Disks" utility included with Ubuntu. You can check a file system only when it is not mounted, so unmount first. The tool to check a file system at the command line is fsck.

To prevent this from happening again, always make sure to carefully eject the drive using software before physically unplugging it. The system will give you a notification when it is safe to remove the drive. Before that, it may give you a notification that it is not yet safe, if data still needs to be committed to disk.

If you carefully remove a drive, the file system will remain healthy for a longer time. It still is a good idea to check the file system of any removable drive from time to time. File systems on your internal drives that are used by the system are checked automatically on every reboot.

vanadium
  • 88,010
  • Thanks for your answer. I have noticed that even though a transfer may show as complete, the process may not have actually finished. Sometimes I get a message that the usb is busy for quite some time after the transfer window had showed "complete". Is there a way to check when the usb is actually finished? – i9pp0 Dec 21 '20 at 04:37
  • Feel free to ask questions on this site. – vanadium Dec 21 '20 at 07:42
  • Use the f3 package utilities to check your USB -- there are many counterfits which are only 8G, and start giving errros quickly. – ubfan1 Dec 22 '20 at 02:09
  • @vanadium Isn't my follow-up question directly related to my original question? In fact, the answer to my follow-up question could be a more complete answer to the original question. My root problem, finally, is incorrect info from Nautilus. Your answer helped me diagnose my problem but fixing with fsck is only cosmetic (if it works) as I will back to square one in a few days because the root problem has not been solved. – i9pp0 Dec 22 '20 at 08:24
  • The writing process is finished when you can successfully eject the usb drive from Nautilus. If you just pull it out without ejecting you risk this kind of problem. – PonJar Dec 22 '20 at 10:02
  • Eject using software. The system will then eventually give you a message if it is still unsafe to remove the drive, and it will give a message when the drive can be physically removed. That is your check. I added this to the answer. – vanadium Dec 22 '20 at 14:39
  • 1
    @i9pp0 "Is there a way to check when the usb is actually finished?" | There are small plugins that can put real-time system monitor graphs into the top panel, these can show processor I/O as well as disk activity real-time. I find these graphs very useful in other everyday scenarios too (e.g. when nothing happens after a click, I can see that I am waiting for a disk operation to complete). On 20.04 (Gnome 3) it's called gnome-shell-extension-system-monitor. https://packages.ubuntu.com/focal/gnome-shell-extension-system-monitor To use it, you need to have the gnome-tweaks package too. – Levente Dec 29 '20 at 19:52
0

It is possible the drive is getting worn out. Flash storage has only so many write cycles before it cannot be written to again. Magnetic storage, as used in hard disk storage as opposed to solid state, does not have this limit. Hard drives have other parts that will wear so they have limited lives too. USB storage is not built to be as durable as the kind of solid state storage used in a SATA drive, that’s how they make them at lower cost. Reformatting the drive only increases this wear. The means to check on the wear status of a drive will vary based on manufacturer and specific technology used. If chmod will not fix the read only issue then that is evidence of a hardware vs software problem.

MacGuffin
  • 377
  • That is a good point but my USB is almost new. I think the problem was removing it while still writing in the background after nautilus said the write was finished. – i9pp0 Dec 26 '20 at 11:35