Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
exfat "unknown option"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jyoung
Apprentice
Apprentice


Joined: 20 Mar 2007
Posts: 213

PostPosted: Tue Sep 10, 2019 8:59 pm    Post subject: exfat "unknown option" Reply with quote

Hi,

I'm trying to mount an exfat usb drive as a non-root user, and I'm running into this error:
Code:
fusermount: unknown option 'user=jyoung'


I have 'user_allow_other' enabled in /etc/fuse.conf, and in udev:
Code:
cat /etc/udev/rules.d/40-fuse.rules
KERNEL=="fuse", MODE="0777"


This thread seems to have a problem with identical symptoms:
forums.gentoo.org/viewtopic-p-8336472.html

But in that case it turned out to be an issue in /etc/fstab. Here's the relevant line from my fstab:
Code:
/dev/sdf1      /mnt/usb0   auto      noatime,noauto,users,exec   0 0


I can't actually read the thread because of the language barrier, but unless I'm way off it's pretty clear that that individual had 'user' instead of 'users' in fstab. Does anyone have any ideas as to what could have caused this?
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1704
Location: United Kingdom

PostPosted: Wed Sep 11, 2019 11:10 am    Post subject: Reply with quote

Have you tried what this chap did?:

https://www.gabrielemerli.com/?p=1374

In Italian, Gabriele Merli wrote:
exfat - usb drive - Fedora
Posted on 2013-10-04 09:19:53

Having the unhealthy idea of ​​using a USB stick formatted in exfat and wanting, for reasons that I'm still asking myself, to allow an unprivileged user to mount the same one from the command line, you can proceed in this way:

1) Make sure you have installed the packages

fuse-exfat
exfat-utils

2) As root, run the command

Code:
]# udevadm monitor --property

insert the flash drive in a USB port and observe the output: in particular we are interested in ID_MODEL and ID_VENDOR which are the 2 parameters that are needed by udev/udisk to recognize the usb key, in my case:
ID_MODEL=Voyager_LS
ID_VENDOR=Corsair

3) Create in /etc/udev/rules.d/81-my.rules (if the file is missing I create it) a rule of the type
Code:
KERNEL=="sdc*",  ATTRS{vendor}=="Corsair" ,  MODE="0666"

Here I used the vendor because the model attribute, or doing KERNEL=="sdc *", ATTRS{model}=="Voyager_LS", MODE="0666", was not recognized.
In essence we are telling udev that when the kernel wants to create any sdc whose vendor is Corsair it must give the device 666 privileges (everyone does everything).

Then give the command
Code:
udevadm control --reload-rules

to update the udev rules.

4) Prepare the fstab this way
Code:
/dev/sdc1      /home/merli/MOUNTING           exfat-fuse     defaults,noauto,user,users   0 0

I'm saying that the mount point /home/merli/MOUNTING has the exfat file system, and allow all users to mount it

5) Fuse has an additional security layer, so change the configuration file /etc/fuse.conf
Code:
]# cat /etc/fuse.conf
# mount_max = 1000
 user_allow_other

6) The /usb/sbin/mount.exfat.-fuse program must be able to be launched by the non-privileged user as if it were root so, as in the case of ntfs
Code:
chown root $(which mount.exfat-fuse)
chmod 4755 $(which mount.exfat-fuse)

7) VICTORY
Code:
cd /home/merli
mount MOUNTING
df -Th
/dev/sdc1 fuseblk 29G 14G 15G 49% /home/merli/MOUNTING
umount MOUNTING

It's not really a very fast procedure even considering that the device-notifier of my desktop enviroment (KDE) allows me to do the same thing without changes and with a click...

8) VICTORY - 2

In the case in which the usb disk is seen as sdd (or sdX with X different from c) we are missing the udev rule that assigns the right permissions to the created device.

By default, fedora assigns these permissions
Code:
merli@server:/home/merli]# ll /dev/sdd*
brw-rw---- 1 root disk 8, 48 Apr 15 10:25 /dev/sdd
brw-rw---- 1 root disk 8, 49 Apr 15 10:27 /dev/sdd1

In this case it will be enough that the user with whom you want to edit is in the "disk" group
Code:
merli@server:/home/merli]# groups merli
merli : merli disk

and then, having carried out all the steps mentioned above (in particular changing the permissions to mount.exfat) to carry out the editing it will be enough to do
Code:
merli@server:/home/merli]# mount.exfat /dev/sdd1 ./MOUNTING/
FUSE exfat 1.0.1

_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
nick_gentoo
n00b
n00b


Joined: 07 Jan 2019
Posts: 67

PostPosted: Wed Sep 11, 2019 5:53 pm    Post subject: Re: exfat "unknown option" Reply with quote

jyoung wrote:

Code:
fusermount: unknown option 'user=jyoung'


Where did you set this option, in which file?
Back to top
View user's profile Send private message
jyoung
Apprentice
Apprentice


Joined: 20 Mar 2007
Posts: 213

PostPosted: Wed Sep 11, 2019 8:44 pm    Post subject: Reply with quote

Thanks folks. The solution ended up being point #6:
Code:

chown root $(which mount.exfat-fuse)
chmod 4755 $(which mount.exfat-fuse)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14062

PostPosted: Thu Sep 12, 2019 1:18 am    Post subject: Reply with quote

Note that changing permissions like that will be rightly undone by Portage on the next install of the package. Also, making programs suid can be a security problem, as most programs not installed as suid were not designed to be run in a suid context.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum