I have this in my /etc/fstsab:

/dev/mmcblk0p1 /media/sd  auto user,noauto,rw,x-gvfs-name=sd%20card 0 0

But when I try to write anything into the /media/sd:

[mei@localhost Documenti]$ cp mare.odt /media/sd/.
cp: impossibile creare il file regolare '/media/sd/./mare.odt': Permission denied

I tried also to force permissions on the destination:

[root@localhost Documenti]# chmod -R 777 /media/sd/
[root@localhost Documenti]# ll /media/
totale 40
drwxrwxrwx. 2 root root  4096  4 nov  2017 oldhome
drwxr-xr-x  3 root root 32768  1 gen  1970 sd

I tried also mounting directly by hand with

mount /dev/mmcblk0p1 /media/sd -v

No luck. Any hint?

  • What if you do the mounting by hand via mount command and use -v switch? – slm Jul 27 '18 at 22:31
  • Not familiar with the x-gvfs-name option, but is it looking for an exact match, starts with, or substring anywhere? although if that part wasn't working i'd imagine it wouldn't mount at all... – ivanivan Jul 27 '18 at 22:34
  • When you tried to cp the file to /media/sd what showed up in the dmesg? – slm Jul 28 '18 at 0:35
  • Does the SD card have a write-protect switch that might have been turned on accidentally? – ErikF Jul 28 '18 at 5:45
  • No, the SD card is not write-protected by the switch. Same behaviour happens for USB stick. Only root is able to copy... – giuseppe Jul 28 '18 at 10:59

After carefully reading the man page of mount and experimenting on the shell with various options of mount, found a solution.

It seems that the right entry in the fstab is this

/dev/mmcblk0p1 /media/sd  vfat user,noauto,rw,umask=0000 0 0

It sounds like that:

  • auto is not enough, better to specify the FS type
  • umask select available permissions (in this case for all users)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.