Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-01-2014, 04:23 PM
|
#1
|
Member
Registered: Apr 2009
Posts: 390
Rep:
|
Vfat USB Thumb Drive Became Write-Protected Suddenly in Ubuntu 12.04
One of my Kingston USB thumb drives suddenly became write-protected recently. If I try to update one of its .txt files, Linux tells me that the file is write-protected. 'Properties' shows me as its owner with read and write privileges. Actually all the drive's files and directories are write-protected. I've tried chown and chmod to no avail. I am not familar enough with /etc/fstab to put it to work.
By the way, I've seen too many similar reports on-line and yet not one link seems to help my case. Any advice will be much appreciated.
julianvb
|
|
|
07-01-2014, 04:56 PM
|
#2
|
Moderator
Registered: Aug 2002
Posts: 26,750
|
If it suddenly became ready only then:
Does it have a write protect switch that got accidentally moved to the wrong position?
Is the file system full?
The drive could be failing, backup the files before continuing to play.
You didn't indicate whether you have tried using the drive with windows or another computer. chmod and chown do not work on FAT32 file systems.
|
|
|
07-02-2014, 12:18 AM
|
#3
|
Member
Registered: Apr 2009
Posts: 390
Original Poster
Rep:
|
Thanks very much for your excellent points.
(1)My USB drive has no visible external switch and it's not full. The problem may have developed when I used it with Windows XP a couple of times recently. Tonight I checked it out on a Windows XP machine and got a hint that it might be corrupted. A particular .txt file contains some invalid chars embedded near the end which I can see shown in red but they returned after I deleted them with gedit. I've even tried using the following command to turn off the vfat usb drive's write protection and received a positive screen confirmation from Linux.
#sudo hparm -r0 /dev/sdb1
/dev/sdb1:
setting readonly to 0 (off)
readonly=0 (off).
As you pointed out, this command might not really work on FAT32 file systems just as chown and chmod don't.
(2) I've just copied the entire 'bad' usb drive's contents to a 1TB Western Digital USB hard drive for safekeeping.
As to be expected, all the newly copied files and directories are write-protected also.
julianvb
|
|
|
07-02-2014, 03:01 PM
|
#4
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
You copied the contents to a new drive and again the files are read only? Could the partition or drive be mounted read only somehow? Or user permissions?
|
|
|
07-02-2014, 05:14 PM
|
#5
|
Member
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814
|
Are you mounting this manually (in a terminal) or is something auto-mounting it? If so, did you check to see if it was somehow mounted read-only?
A would agree that your flash drive could potentially be on the brink of failure, you should probably copy everything to somewhere else.
Hope this helps!
|
|
|
07-02-2014, 06:40 PM
|
#6
|
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,385
|
Quote:
Originally Posted by julianvb
I am not familar enough with /etc/fstab to put it to work.
|
Could you post the contents of your fstab?
------------------------
Steve Stites
|
|
|
07-02-2014, 08:13 PM
|
#7
|
Member
Registered: Apr 2009
Posts: 390
Original Poster
Rep:
|
2014-07-02
Hi, Everyone,
Thank you all for your help.
I finally confirmed with the help of Windows XP that the USB drive in question is indeed corrupted. That left me no choice but to re-format it (in Linux naturally).
I recommend Disk Utility highly to everyone. It enables the Linux user to do so many things with a storage device without typing so many terminal commands! I've now reformatted the USB drive with Disk Utility and copied my old files back to it. The drive appears to be working happily without write-protection imposed. Thanks again Disk Utility.
Julianvb
Last edited by julianvb; 07-02-2014 at 08:16 PM.
|
|
|
07-02-2014, 09:09 PM
|
#8
|
Member
Registered: Apr 2009
Posts: 390
Original Poster
Rep:
|
By the way, one can invoke Disk Utility in Ubuntu by typing the following command:
palimpsest
julianvb
Last edited by julianvb; 07-02-2014 at 09:10 PM.
|
|
|
All times are GMT -5. The time now is 12:42 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|