LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   USB drive is read only (http://www.linuxquestions.org/questions/slackware-14/usb-drive-is-read-only-4175445620/)

bvbellomo 01-14-2013 07:31 PM

USB drive is read only
 
I have a USB card reader with my camera card. It mounts read only, and I have no idea how to write to it. It worked fine on my old system (arch) before reformatting, and I am new to Slackware. Running as root doesn't make any difference.

NyteOwl 01-14-2013 08:55 PM

If the card reader wrote to the cards under Arch it should work in Slackware. How are you mounting it and with what permissions?

bvbellomo 01-14-2013 10:43 PM

I haven't done anything to configure how it mounts. If I plug it in, it mounts automatically and shows up read only. I suppose I could try to use the 'mount' command to mount it differently to a different path, but that seems like the wrong solution. I assume 'root' being unable to write to the drive rules out permission issues.

Mike_M 01-14-2013 11:06 PM

It may be mounted read only due to the type of filesystem being used. What filesystem is the card in question using?

griswald 01-15-2013 03:14 AM

If it's NTFS and the drive is over 4GB you will need to install ntfs-3g

KenJackson 01-15-2013 05:39 AM

You could try (of course replacing /media/dir with the actual):
Code:

mount -o remount,rw /media/dir
Also note that some filesystems (ext2 and jfs I think) support the mount option "errors=remount-ro". This causes, as you might guess, the filesystem to be remounted read-only when there's any error. I believe the device itself can be marked to default with this option, which the manufacturer may have done (assuming you didn't reformat it).

If that's the case, I think you can change the default to "errors=continue" with the tune2fs program. Or you can add a line to /etc/fstab to explicitly mount it the way you want.

cmcanulty 01-15-2013 07:13 AM

2 more things to try 1)this one almost stumped me until I realized one USB drive gad a sliding lock on it or 2) this often works when the mount issue is screwed up takes a few minutes
sudo killall udisks

sudo apt-get install udisks libgdu0 gnome-disk-utility policykit-desktop-privileges --reinstall

Mike_M 01-15-2013 07:18 AM

Quote:

Originally Posted by cmcanulty (Post 4870513)

sudo apt-get install udisks libgdu0 gnome-disk-utility policykit-desktop-privileges --reinstall

That's not going to work very well on Slackware.

bvbellomo 01-15-2013 08:37 AM

The card in question is FAT32

rokytnji 01-15-2013 08:48 AM

Might want to post the output of

Code:

cat /etc/fstab
with the card reader and flashcard plugged in after a reboot with device plugged in. /etc/fstab handles read write permissions.

Code:

# cat /etc/fstab
# Pluggable devices are handled by uDev, they are not in fstab
UUID= / auto defaults,noatime 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0622 0 0
# Dynamic entries below
UUID=343942EB578098A9 /media/sda1 ntfs-3g noauto,users,noexec,uid=1000,gid=users,dmask=002,fmask=113,relatime 0 0
UUID=676d70d7-1c41-449b-be0f-2e04df874d86 /media/sda3 ext4 noauto,users,exec,relatime 0 0
UUID=a70b8580-b61d-4732-8109-b6f883ab58de swap swap sw,pri=1 0 0
UUID=454f0f9b-3885-4a59-a3d8-eefe9bef04e6 /media/sda6 ext4 noauto,users,exec,relatime 0 0
UUID=6439e2f7-c8a3-4ced-b422-0a29827738d4 /media/sda7 ext4 noauto,users,exec,relatime 0 0
UUID=69f5ae2f-b286-455a-ab50-6440b01a21f4 /media/sda8 ext4 noauto,users,exec,relatime 0 0
/dev/cdrom /media/cdrom udf,iso9660 noauto,users,exec,ro 0 0
/dev/sr0 /media/cdrom udf,iso9660 noauto,users,exec,ro 0 0
# Added by antiX
/dev/sda8        /media/sda8      ext4      noauto,exec,relatime,users      0 0
# Added by antiX
/dev/sda5        swap            swap      defaults                        0 0
# Added by antiX
/dev/sda1        /media/sda1      ntfs-3g    noauto,noexec,uid=1000,gid=users,dmask=002,fmask=113,users  0 0
# Added by antiX
/dev/sda7        /media/sda7      ext4      noauto,exec,relatime,users      0 0
# Added by antiX
/dev/sda6        /media/sda6      ext4      noauto,exec,relatime,users      0 0
# Added by antiX
/dev/sda3        /media/sda3      ext4      noauto,exec,relatime,users

Edited:

Quote:

Both the mount command and the /etc/fstab mount a device as read/write unless specified as read only. Therefore, if you are having trouble reading and writing to a mounted device, you will want to check you fstab file to ensure that you have the correct permissions specified.

sonichedgehog 01-19-2013 11:19 AM

I note that running as root doesn't`t help., which I assume means that even as root you can't write to the automounted filesystem... but have you actually tried a command-line mount as root? I think it's
Code:

mount -t vfat /dev/(your card) /media/(mountpoint)
. I have seen a usb device mounted read-only , in this case because the filesystem was damaged. Post again if this is unclear.

KenJackson 01-19-2013 12:24 PM

And you can add the -w (or --rw or -o rw) switch to specifically mount it read/write:
Code:

mount -t vfat -w /dev/(your card) /media/(mountpoint)

Graham Harris 01-22-2013 01:45 AM

I have had this a few times now, and the pattern seems to be that the USB drive is 'tainted', probably being dismounted uncleanly.

If that's the case for you, then fixing the USB drive is the easiest solution.

On linux, fsck can do this but you can also do this in Windows; right-click on the USB drive and select properties, then there's an option to test and fix the drive. That seems to do it for me.

I'm not sure there's an actual problem with the drive; just something that gets set when the drive is mounted, and not unset when hastily removed.

sonichedgehog 01-26-2013 12:04 PM

... and if that doesn't fix it, then you may need to reconstruct the drive's filesystem using parted.

Before you delete anything, be sure to 1) backup all your files and 2) within parted, make a note of the start and end blocks of the existing partition and recreate them exactly.

Research the use of parted before you start, its moderately tricky but well worth mastering.


All times are GMT -5. The time now is 03:34 PM.