USB flash drive changes to read-only on the fly

Daniel Louw daniel at dline.co.za
Fri Sep 24 12:44:57 UTC 2010


On Thu, 2010-09-23 at 07:51 +1000, andrew clarke wrote:

> On Wed 2010-09-22 22:21:27 UTC+0200, Daniel Louw (daniel at dline.co.za) wrote:
> 
> > This might be a silly question, but it is very frustrating.
> > 
> > I have this memory stick, a 2 GB one formatted with FAT32.
> > 
> > I was working on a .C file stored on the memory stick, saving as I
> > made progress with the code. Then all of a sudden I cannot save
> > anymore. I get an error saying the disk is read only. I cannot create
> > new folders or files or anything. chmod doesn't work, it simply says
> > read only partition. What the hell?
> > 
> > Could it be because I compile directly on the disk? I use the disk a
> > lot at university and it is much easier to just work directly on the
> > disk.
> 
> Not a silly question.
> 
> Compiling directly on the memory stick is no different to writing any
> other type of file to the disk.  As far as Linux is concerned it's
> just another drive.
> 
> I suspect there is some sort of FAT32 filesystem corruption on the
> memory stick, and once the Linux kernel encounters it it switches its
> FAT32 driver to read-only as to not cause any further corruption. You
> can do a file system check/repair on the memory stick from the Ubuntu
> GUI - System -> Administration -> Disk Utility.  Then select the
> memory stick's FAT32 partition and click Check Filesystem.  You may
> need to click on Unmount Volume first.
> 
> On the other hand you may have encountered a bug in the FAT32
> driver, although given the number of years people have been using
> FAT32 in Linux this is pretty unlikely.  :-)
> 
> /var/log/messages may give you some clues.  You can view it from the
> Ubuntu GUI - under System -> Administration -> Log file viewer.
> 
> FAT32 is pretty fragile.  Instead of doing the FAT32 filesystem check
> above you may just want to make a backup of your data on the memory
> stick, reformat it as NTFS and copy the data back.  NTFS is a bit more
> robust, with errors in the filesystem generally handled a lot more
> gracefully.
> 
> There are few reasons not to use NTFS on memory sticks these days. For
> example the NTFS driver in Apple Mac OS X is read-only but you can
> download/install software to allow read/write NTFS drives on OS X.
> Similarly FreeBSD and other lesser-known operating systems.
> 
> Regards
> Andrew


Hello Andrew

Thank you for a very informative reply. I also suspect it is something
to do with a corrupt filesystem or something. I will sometime do a
proper check and fix and so on. I think it comes from not unmounting the
disk after use. It's a bad habit of mine.

Regarding using NTFS, I can't. Like I said the PC's in the labs at
varsity uses a *very* old and ridiculously stable (I have not managed to
break them :-)) Debian OS. And there is no write support on the NTFS
driver for these PC's. I have asked about fixing it, but with the
varsity being more a bureaucracy than anything else, I am not going to
try again. And booting into Windows every time just to save all my new
work on the disk is not going to fly with me. So I'm stuck with the
FAT32 for now!

Thanks!

Regards
Daniel Louw

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100924/549d01cb/attachment.html>


More information about the ubuntu-users mailing list