Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] udisks and exfat
Date: Wed, 01 May 2019 08:35:23
Message-Id: 2524088.dHFnc94B1U@dell_xps
In Reply to: Re: [gentoo-user] udisks and exfat by Bill Kenworthy
1 On Wednesday, 1 May 2019 03:32:21 BST Bill Kenworthy wrote:
2 > Got sidetracked - turns out fuse and exfat on usb do not play well with
3 > mounts as a user due to changes late last year. It can now only be
4 > mounted/unmounted by root.
5 >
6 > The second part (also due to fuse) is that to stop fuse (silently as ls
7 > still showed the execute bit set) from interfering with execution of
8 > files on the mounted device) it must be mounted as the user under a user
9 > owned directory such as /home/user (mount cannot deal with this - it did
10 > in the past, but something has changed). So the solution is to mount
11 > via root as the user you want (via sudo) under a mount point in the
12 > users home. This may all be unique to fuse-exfat, and which versions of
13 > everything involved as I saw one email on the mechanics of the changes
14 > saying fat is handled a little differently due to a different use
15 > scenario. And ext2/3/4 etc don't have the problem at all. Auto-mount
16 > on device plugin still doesn't happen so thats next on my list.
17 >
18 > /etc/fstab:
19 >
20 > /dev/sda1 /home/myuser/mnt auto
21 > rw,auto,exec,uid=1000,gid=1000,users,user=myuser 0 0
22 >
23 >
24 > BillK
25
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 Regards,
116 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] udisks and exfat Bill Kenworthy <billk@×××××××××.au>