Fixing A Pendrive Read Only File Problem and sudden loss of file permissions

ASmith
  12 years ago
  3

Addressing and Fixing the Linux Pendrive Read Only File Problem

Linux Mint and many additional Linux distro users using USB based PenDrives suddenly to their surprise and shock find the files on their PenDrives have shifted over to read only access. This problem exists thru a conflict in mounting librarys resulting in the PenDrive mounted in a error mode condition seen as Read Only and normal ownership shifted to root only.

It is very common to swing at this problem by multiple attempts of chmod and chown strings however the actual problem still remains.

Sadly, Linux users might think or advise users with this problem to back-up their PenDrive, reformat it and then restore the information thinking it'll be alright after jumping thru those hoops, however the actual problem still remains.

Pendrive files returned to correct file ownership,permissions Solution:

A successful Solution is to install and/or depend only on Hal based device mounting and monitoring (such as pmount) and carefully check to see if you have installed or have a device monitoring library which conflicts with that of Hal. When a conflict exists, the device appears to be noticed and mounted however in error it is defaulted to the read only mode.

Simply unmounting and remounting the device WITHOUT uninstalling the conflicting library or conflicting mount abstraction layer isn't the prefered solution and in many cases it won't solve the problem at all.

The Solution is in sticking solely with what you feel is the best choice to locate and successfully mount the devices in your Linux distro (Mint etc.) and not have additional librarys and apps which try to do the same using non-hal applications. Sticking with PMOUNT was successful in Mint 11 standard in resolving my problem after uninstalling USBMOUNT and it's non-hal based device mounting librarys.

In my specific case USBmount http://usbmount.alioth.debian.org/ was conflicting with pmount which contains the wrapper pmount-hal. My solution was to uninstall USBMOUNT and any librarys which were in conflict with the hal based device handlers.

HAL stands for Hardware Abstraction Layer which Gnome appears to fully use to listen for and then react with user configured actions. Halevt, a Generic handler for hal events is a good program and example of a daemon that acts/reacts as a device policy agent for hal http://www.nongnu.org/halevt

The same problem discussed in this help tutorial is found in nearly a full dozen different Linux distro's forums whose advice ranged from 'Pendrives just are short lived and fail anyway' to 'Reformat the Pendrive after backing up all your files and simply restore the files' (which I did but of course the actual problem hadn't been addressed). The remaining advisers took swings at chmod and chown commands which again didn't successfully resolve the actual problem for those whose Pendrives in Linux suddenly switched to Read-Only modes with root only permissions.

With that in mind and in hopes that directly focusing on the likelyhood of conflicting hardware mounting librarys is the root of the real problem, folks can save themselves many hours in sorting this out.