LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 07-01-2014, 04:23 PM   #1
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Rep: Reputation: 3
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
 
Old 07-01-2014, 04:56 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,839

Rep: Reputation: 5972Reputation: 5972Reputation: 5972Reputation: 5972Reputation: 5972Reputation: 5972Reputation: 5972Reputation: 5972Reputation: 5972Reputation: 5972Reputation: 5972
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.
 
Old 07-02-2014, 12:18 AM   #3
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
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
 
Old 07-02-2014, 03:01 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,029

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
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?
 
Old 07-02-2014, 05:14 PM   #5
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Rep: Reputation: 265Reputation: 265Reputation: 265
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!
 
Old 07-02-2014, 06:40 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,347

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
Quote:
Originally Posted by julianvb View Post
I am not familar enough with /etc/fstab to put it to work.
Could you post the contents of your fstab?

------------------------
Steve Stites
 
Old 07-02-2014, 08:13 PM   #7
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
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.
 
Old 07-02-2014, 09:09 PM   #8
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine if USB flash drive is write protected richw42 Programming 2 07-02-2012 04:32 PM
Slow USB thumb drive transfer Ubuntu 10.04 jkzfixme Linux - Hardware 1 06-24-2010 03:49 PM
disk suddenly full and write protected osc~ Slackware 17 07-08-2007 09:18 AM
USB thumb drive write speeds too fast xaos5 Linux - Hardware 1 01-19-2007 03:04 AM
write permission to thumb drive Geminias Linux - Newbie 4 01-11-2006 05:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration