LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-13-2013, 01:57 PM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,378

Rep: Reputation: Disabled
can't read/write to USB sticks--"read-only filesystem"


I have a recurring (but not continuous) problem with reading or writing to my USB sticks (other than the one containing this OS) and don't understand why. My system will refuse to write to them in any way, saying they're read-only filesystems. It's not a problem of permissions, because I couldn't write to the sticks even as root. I don't think there's anything wrong with the sticks, because I wrote to both of them a few days ago and one of them is no more than a couple months old.

This is my fstab file; the sticks in question are sda1 and sdc1--
# /etc/fstab: static file system information
#
# Created by make-fstab on Thu Aug 8 20:01:15 MST 2013

# <file system> <mount point> <type> <options> <dump/pass>
Code:
# Added by antiX
/dev/sda1        /media/sda1      vfat       noauto,uid=1000,gid=users,dmask=002,fmask=113,relatime,users  0 0
# Added by antiX
/dev/sdb1        /live/boot-dev   ext3       noauto,exec,relatime            0 0
# Added by antiX
/dev/sdc1        /media/sdc1      vfat       noauto,uid=1000,gid=users,dmask=002,fmask=113,relatime,users  0 0
# Added by antiX
/dev/sdb2        swap             swap       defaults                        0 0
# Added by antiX
/dev/cdrom       /media/cdrom     iso9660    noauto,exec,users,ro            0 0
# Added by antiX
/dev/sr0         /media/sr0       auto       noauto,exec,users,ro            0 0
# Added by antiX
/dev/cdrw        /media/cdrw      iso9660    noauto,exec,users,rw            0 0
If the fstab entries are wrong, I don't understand what happened, because I don't remember editing fstab recently.

I do unplug my sticks and/or move them between ports fairly often; does that probably have to do with this? The comments say the system generated the fstab five days ago, and I probably had the sticks plugged into different ports.

Last edited by newbiesforever; 08-13-2013 at 01:58 PM.
 
Old 08-13-2013, 04:37 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
yes removing and inserting USB devices into the system can cause their device name to change.

ex:

if you plug in USB today and the system reads it as /dev/sdb1 then you add a 2nd USB that is read as /dev/sdc1. when you remove /dev/sdb1 if it was not properly umounted or an some cases the system just forgets to drop that device name when you plug it back in you COULD end up with /dev/sdd1 instead of /dev/sdb1 so now your ftab is going to fail.

removable media and fstab do not play nice for that very reason.

depending on your OS and how it handles automagically mounting of devices your system could even be trying to mount the device two times. one in the fstab entry and an other in the default location of /media or /run or what ever your distro uses.

if you will be using only a handful of USB devices it might be advantageous to manually mount them, or consider looking into udev rules. an other option is to label the drives then create a script to detect what label the drive is and mount it a specific way.

sadly dealing with USB devices is just like that. heck even MS windows screws it up more then it gets it right. ive lost count how many times ive seen multiple copies of the same USB device in winXP, Vista, and 7, have never worked with 8, but i can almost bet 100% the problem is still there.

It boils down to the system not "forgetting" properly the temporary assigned address of the device.
 
1 members found this post helpful.
Old 08-13-2013, 04:47 PM   #3
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
The next time it happens issue a mount command and see if the USB stick is mounted ro (read only).

To expand on lieb's answer you could try continuing to let the system automatically mount USB sticks when you plug them in and issue a umount command for the device before you pull the USB stick out. If the system is still confused about which USB stick is mounted where then you could disable the automatic mounts and manually mount and umount the devices.

---------------------
Steve Stites
 
1 members found this post helpful.
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to edit file and make read/write / on "repair filesystem" mode? tovohery Linux - General 5 02-18-2008 01:39 AM
USB hard drive mounts as "Read Only Filesystem" augu2000 Linux - Hardware 11 07-12-2007 10:37 AM
RH9 "remounting root filesystem in read-write mode" ChrisHax Linux - Newbie 3 07-23-2004 09:54 PM
USB drive keeps mounting as "read only" I need to write to it. Lossenelin Linux - Hardware 1 02-12-2004 06:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:21 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