Gentoo Archives: gentoo-user

From: Bill Kenworthy <billk@×××××××××.au>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] udisks and exfat
Date: Wed, 01 May 2019 09:24:20
Message-Id: 3802968a-9e5a-07b1-a067-66ba34d1a7bd@iinet.net.au
In Reply to: Re: [gentoo-user] udisks and exfat by Mick
1 On 1/5/19 4:35 pm, Mick wrote:
2 > On Wednesday, 1 May 2019 03:32:21 BST Bill Kenworthy wrote:
3 >> Got sidetracked - turns out fuse and exfat on usb do not play well with
4 >> mounts as a user due to changes late last year. It can now only be
5 >> mounted/unmounted by root.
6 >>
7 >> The second part (also due to fuse) is that to stop fuse (silently as ls
8 >> still showed the execute bit set) from interfering with execution of
9 >> files on the mounted device) it must be mounted as the user under a user
10 >> owned directory such as /home/user (mount cannot deal with this - it did
11 >> in the past, but something has changed). So the solution is to mount
12 >> via root as the user you want (via sudo) under a mount point in the
13 >> users home. This may all be unique to fuse-exfat, and which versions of
14 >> everything involved as I saw one email on the mechanics of the changes
15 >> saying fat is handled a little differently due to a different use
16 >> scenario. And ext2/3/4 etc don't have the problem at all. Auto-mount
17 >> on device plugin still doesn't happen so thats next on my list.
18 >>
19 >> /etc/fstab:
20 >>
21 >> /dev/sda1 /home/myuser/mnt auto
22 >> rw,auto,exec,uid=1000,gid=1000,users,user=myuser 0 0
23 >>
24 >>
25 >> BillK
26 > exFAT and VFAT are mounted with different permissions by udisks, without
27 > overriding options in fstab or command line.
28 >
29 > A random file in exFAT:
30 >
31 > $ stat /run/media/michael/VERBATIM32G/blah
32 > File: /run/media/michael/VERBATIM32G/blah
33 > Size: 32768 Blocks: 64 IO Block: 4096 regular file
34 > Device: 811h/2065d Inode: 19 Links: 1
35 > Access: (0777/-rwxrwxrwx) Uid: ( 1000/ michael) Gid: ( 1002/ michael)
36 > Access: 2018-06-08 11:20:50.000000000 +0100
37 > Modify: 2015-08-24 12:50:56.000000000 +0100
38 > Change: 2015-08-24 12:50:56.000000000 +0100
39 > Birth: -
40 >
41 > A random file in FAT:
42 >
43 > $ stat /run/media/michael/CRUCIAL-8G/blah
44 > File: /run/media/michael/CRUCIAL-8G/blah
45 > Size: 1731366 Blocks: 3384 IO Block: 4096 regular file
46 > Device: 810h/2064d Inode: 124 Links: 1
47 > Access: (0644/-rw-r--r--) Uid: ( 1000/ michael) Gid: ( 1002/ michael)
48 > Access: 2019-04-08 01:00:00.000000000 +0100
49 > Modify: 2007-08-25 22:46:42.000000000 +0100
50 > Change: 2019-04-08 14:04:54.000000000 +0100
51 > Birth: -
52 >
53 > Ditto for directories.
54 >
55 > exFAT:
56 >
57 > $ stat /run/media/michael/VERBATIM32G/Foo
58 > File: /run/media/michael/VERBATIM32G/Foo
59 > Size: 32768 Blocks: 64 IO Block: 4096 directory
60 > Device: 811h/2065d Inode: 24 Links: 1
61 > Access: (0777/drwxrwxrwx) Uid: ( 1000/ michael) Gid: ( 1002/ michael)
62 > Access: 2018-02-11 17:22:52.000000000 +0000
63 > Modify: 2018-02-11 17:22:54.000000000 +0000
64 > Change: 2018-02-11 17:22:54.000000000 +0000
65 > Birth: -
66 >
67 >
68 > FAT:
69 >
70 > $ stat /run/media/michael/CRUCIAL-8G/Foo
71 > File: /run/media/michael/CRUCIAL-8G/Foo
72 > Size: 4096 Blocks: 8 IO Block: 4096 directory
73 > Device: 810h/2064d Inode: 79 Links: 2
74 > Access: (0755/drwxr-xr-x) Uid: ( 1000/ michael) Gid: ( 1002/ michael)
75 > Access: 2019-04-08 01:00:00.000000000 +0100
76 > Modify: 2019-04-08 14:43:26.000000000 +0100
77 > Change: 2019-04-08 14:43:26.000000000 +0100
78 > Birth: -
79 >
80 > The mount options are different as shown below.
81 >
82 > exFAT:
83 >
84 > $ findmnt -oOPTIONS /dev/sdb1
85 > OPTIONS
86 > rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,
87 > blksize=4096
88 >
89 > FAT:
90 >
91 > $ findmnt -oOPTIONS /dev/sdb
92 > OPTIONS
93 > rw,nosuid,nodev,relatime,uid=1000,gid=1002,fmask=0022,dmask=0022,codepage=437,
94 > iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro
95 >
96 >
97 > In the above examples I used udisksctl to mount the devices. I understand
98 > Gnome expose via Gvfs an API to handle I/O to block devices, which desktop
99 > applications can plug into without performing raw kernel calls to hardware
100 > devices (like e.g. /bin/mount does). I don't run Gnome and am not familiar
101 > with its internals to know how similar it is with udisksctl.
102 >
103 > Regarding mounting with udisksctl I don't know why exFAT and VFAT are
104 > different, but the udisksctl man page provides this revealing information on
105 > the mount permissions allowed:
106 >
107 > The device will be mounted with a safe set of default options. You
108 > can influence the options passed to the mount(8) command with
109 > --options. Note that only safe options are allowed - requests with
110 > inherently unsafe options such as suid or dev that would allow the
111 > caller to gain additional privileges, are rejected.
112 >
113 > HTH.
114
115 Sounds like you are using gnome/systemd ... thats a whole other box of
116 worms to open.  This is a gnomeless openrc system with a recently
117 getting elogind to replace consolekit.
118
119
120 BillK

Replies

Subject Author
Re: [gentoo-user] udisks and exfat Mick <michaelkintzios@×××××.com>