Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Unable to write to thumb drive

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
WanderingOak
Posts: 20
Joined: 2012-01-06 22:55
Has thanked: 1 time

Unable to write to thumb drive

#1 Post by WanderingOak »

I have a relatively new install of Buster. Recently, I have had problems working with thumb drives. I can read from a thumb drive fine. However, when I try to copy files to the thumb drive, I am given an error message saying "Read-only file system". The thumb drive is formatted Fat 32 for transferring files from my Debian laptop to a Mac. I am using LXQT 0.14.1.

My /etc/fstab reads as follows:
/dev/mapper/debian--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda2 during installation
UUID=0413573b-19af-4486-b0bb-87ca167eea69 /boot ext2 defaults $
# /boot/efi was on /dev/sda1 during installation
UUID=B99A-50C8 /boot/efi vfat umask=0077 0 1
/dev/mapper/debian--vg-swap_1 none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0

The thumb drive is mounted, and I can read it in pamanfm-qt .

If I navigate to it's location (/media/username/ ) ls-l shows drwxrwxr-x 1 root root
I tried running chmod 777 as root, but was unable to change anything. Using cp -r as root resulted in: "cannot create directory 'directory': Read-only file system".

Any assistance would be appreciated.
Squeeze T43

User avatar
Loci.Cantos
Posts: 67
Joined: 2018-08-03 15:39

Re: Unable to write to thumb drive

#2 Post by Loci.Cantos »

Owner and Group appear to have read write execute on the usb media.
Your users don't have write privileges.
"who" is trying to write to the media? I don't know your instantiation as a file system operator (appears to be root).
Also, how much space is available on the media?

However, this may be useful...
https://www.linux.com/training-tutorial ... rmissions/

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Unable to write to thumb drive

#3 Post by sgosnell »

I've seen that happen with failed USB drives. They do fail. I futzed with one for a very long time before tossing it in the round file. I suspected that it was bad all along, but I kept working at it just for the education. At the price for them now, it's not really worth expending much effort. Have you tried different drives with the computer?
Take my advice, I'm not using it.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Unable to write to thumb drive

#4 Post by stevepusser »

If it's bad, usually dmesg in the terminal will show errors after it's inserted. It's been mounted read-only so you can recover data before trying to repair it.
MX Linux packager and developer

Bulkley
Posts: 6387
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Unable to write to thumb drive

#5 Post by Bulkley »

It's an ownership problem. When you do ls-l you get drwxrwxr-x 1 root root. When I do it I get drwxrwxr-x 1 [my username] [my username].

WanderingOak
Posts: 20
Joined: 2012-01-06 22:55
Has thanked: 1 time

Re: Unable to write to thumb drive

#6 Post by WanderingOak »

sgosnell wrote:I've seen that happen with failed USB drives. They do fail. I futzed with one for a very long time before tossing it in the round file. I suspected that it was bad all along, but I kept working at it just for the education. At the price for them now, it's not really worth expending much effort. Have you tried different drives with the computer?
Whelp, I figured out what the problem was. I ran mount | grep "^/dev", and it turns out that the thumb drive was formatted HFS+. I forgot that I had a thumb drive or two formatted that way for transferring large video files from one Mac to another. I need to label them 'Mac only' so I don't use them on my *nix boxes. Thanks everybody for all of the responses.
Squeeze T43

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Unable to write to thumb drive

#7 Post by stevepusser »

I wonder if dmesg can detect that problem, or if you just get a generic error.
MX Linux packager and developer

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Unable to write to thumb drive

#8 Post by p.H »

Linux can write on an HFS+ filesystem if it is not marked as journalled. Otherwise it will be mounted read-only by default.

AFAIK Debian has no tool to disable the journal on an existing HFS+ filesystem. However you can mount a journalled HFS+ filesystem read-write with the "force" mount option (at your own risks).

mkfs.hfsplus from package hfsprogs has an option to create an HFS+ filesystem with or without a journal.

Post Reply