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?
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.
$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