You are not logged in.

#1 2015-10-22 12:10:02

edriv
Member
Registered: 2013-03-13
Posts: 13

[SOLVED] Unable to write on usb stick

Following instructions on the wiki I can't write as a user on my usb stick. (but can as root)

More precisely:

[fog@localhost mnt]$ pwd
/mnt
[fog@localhost mnt]$ ls -l 
total 4
drwxrwxr-x 2 root users 4096 Oct 22 14:04 usb
[fog@localhost mnt]$ cat /etc/group | grep users
users:x:100:fog
[fog@localhost mnt]$ sudo mount /dev/sdb1 /mnt/usb -o gid=users,fmask=113,dmask=002
[fog@localhost mnt]$ cd usb
[fog@localhost usb]$ touch a
touch: cannot touch 'a': Permission denied
[fog@localhost usb]$ sudo touch a
[fog@localhost usb]$ 

File system is vfat.

What am I missing??

Last edited by edriv (2015-10-22 21:14:54)

Offline

#2 2015-10-22 12:25:26

headkase
Member
Registered: 2011-12-06
Posts: 1,977

Re: [SOLVED] Unable to write on usb stick

"rw" as one of the mount options?  "rw" means "read/write."

Offline

#3 2015-10-22 12:27:41

edriv
Member
Registered: 2013-03-13
Posts: 13

Re: [SOLVED] Unable to write on usb stick

I thought it was not necessary but also with that:

[fog@localhost mnt]$ sudo mount /dev/sdb1 /mnt/usb -o gid=users,fmask=113,dmask=002,rw
[fog@localhost mnt]$ cd usb
[fog@localhost usb]$ touch a
touch: cannot touch 'a': Permission denied
[fog@localhost usb]$ 

it does not work.

Offline

#4 2015-10-22 12:34:01

headkase
Member
Registered: 2011-12-06
Posts: 1,977

Re: [SOLVED] Unable to write on usb stick

See here: https://wiki.archlinux.org/index.php/Mo … FAT.2C_DOS

Have you tried all that?

Edit: and the script that mentions doesn't have a space after "-o"

Last edited by headkase (2015-10-22 12:35:07)

Offline

#5 2015-10-22 12:39:46

ayekat
Member
Registered: 2011-01-17
Posts: 1,590

Re: [SOLVED] Unable to write on usb stick

Have you installed the dosfstools package?

EDIT on a second thought, I think that package is only for creating filesystems, not for accessing them. Scratch that.

Last edited by ayekat (2015-10-22 12:41:01)


pkgshackscfgblag

Offline

#6 2015-10-22 12:43:51

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,885
Website

Re: [SOLVED] Unable to write on usb stick

What are the permissions on the directory after mounting?

ls -ld /mnt/usb

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2015-10-22 15:30:31

edriv
Member
Registered: 2013-03-13
Posts: 13

Re: [SOLVED] Unable to write on usb stick

Finally it worked out. I think it is a group-related problem, because the following commands work:

[fog@localhost mnt]$ sudo mount /dev/sdb1 /mnt/usb -ogid=users,fmask=113,dmask=002
[fog@localhost mnt]$ cd usb
[fog@localhost usb]$ ls -ld .
drwxrwxr-x 5 root users 4096 Jan  1  1970 .
[fog@localhost usb]$ touch a
touch: cannot touch 'a': Permission denied
[fog@localhost usb]$ cd ..
[fog@localhost mnt]$ sudo umount /dev/sdb1
[fog@localhost mnt]$ sudo mount /dev/sdb1 /mnt/usb -ouid=fog,fmask=113,dmask=002 
[fog@localhost mnt]$ cd usb
[fog@localhost usb]$ ls -ld .
drwxrwxr-x 5 fog root 4096 Jan  1  1970 .
[fog@localhost usb]$ touch a
[fog@localhost usb]$ 

Offline

#8 2015-10-22 15:32:25

headkase
Member
Registered: 2011-12-06
Posts: 1,977

Re: [SOLVED] Unable to write on usb stick

Right on.  Don't forget to edit your first post and put "[Solved]" at the beginning of the title.  smile

Offline

Board footer

Powered by FluxBB