Can't copy files to a usb stick

Hello
at first i had this issue:

the usb would not be recognized by the OS;mounting it manually would work though. and since it was created in windows with FAT32,i decided to use gparted to reformat it(msdos and ext4).
now when i plug it in i get the pop -up message in the tool bar asking if i want to mount it,but after mounting it,i can’t copy files to it.
i guess it’s a permissions problem?
why does this happen when i just reformatted it in Linux and how can i fix this?

I had the same problem with a USB stick created using the root account. I could only write to it using the root account. You might try using the root account to see if that makes a difference.

1 Like

When you repurpose any disk device using a linux filesystem - it will be with root permissions only.

This is solvable by mounting the partition and then changing either owner or permissions.Changing permissions is the most flexible since you don’t have to care even if accessed by any user between different linux systems.

Assuming the mountpoint /run/user/$UID/some-long-uuid you can change permissions

sudo chmod ugo+rw /run/user/$UID/some-long-uuid

Or you can reformat the stick using windows filesystem like vfat or exfat.

Further instructions on exfat including a utility script can be found in this guide.

1 Like

could you help me with the command line;
under /run/user I’ve got a folder named 1000 but not $UID.
but i do have one under /run/media,
so should the command line be:

sudo chmod ugo+rw /run/media/user/$UID/some-long-uuid

with replacing “user” with mine,$UID with the long number of the folder and then again for"some-long-uuid",or leave $UID as it is?

$UID is a placeholder for the actual UID as I have no way of knowing that. You can use tab completion to fill out the number.

If you label your device the mountpoint will be your label - it is a convenient method of recognizing the media. Example of labeling the media - replace sdy1 with your device/partition number - e.g. /dev/sdc1 - if your device is number 3 in the list. Use lsblk to identify.

e2label /dev/sdy1 "USB_STICK_NO_2"

It was intended as an example just amend it to fit your system (maybe add recursive flag -R). In this example $USER can be left as is because it is an environment variable containing the active username

sudo chmod ugo+rw /run/media/$USER/USB_STICK_NO_2 -R
1 Like

i ended up running

sudo chmod ugo+rw /run/media/my username/some-long-uuid

and it worked,
is it permanent,or do i have to run it each time?

it is permanent - until next time you format the stick :slight_smile:

1 Like

Thank you very much. :+1:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.