Bug 1404266

Summary: Dubious default mount options for removable storage; unable to change default mount options for removable storage
Product: [Fedora] Fedora Reporter: Artem S. Tashkinov <aros>
Component: udisks2Assignee: Vojtech Trefny <vtrefny>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 30CC: evgenyz, phatina, puiterwijk, stefw, tbzatek, vtrefny, wally
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-26 14:36:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Artem S. Tashkinov 2016-12-13 13:57:52 UTC
Description of problem:

Here's how my fat32 flash drive gets mounted:

/dev/sdb1 on /run/media/birdie/USB type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)


Version-Release number of selected component (if applicable):

storaged-2.6.2-2.fc25.x86_64


Here's what's wrong with these mount options:

"flush" is only good for people with OCD and at the same time it makes random small writes to the disk several magnitudes of order slower because most USB flash disks have very bad small IO thoughput.

codepage=437 works only for countries where English is an official language and locale on their Windows PCs. For instance in Cyrillic speaking countries codepage must be 866.

iocharset must be utf8 for all intents and purposes.

There's no "quite" option which I'd love to see because it silences `cp -a` errors in regard to setting the owner/group.

There's no "usefree" option which increases mount speed by several orders of magnitude because the kernel doesn't have to scan all free sectors.

I would love to see "noatime" because I don't care about access times on my slow USB storage.

Please, make it possible to change all mount options aside from uid=$USERID,gid=$GROUPID

Comment 1 Vojtech Trefny 2016-12-13 16:09:28 UTC
> "flush" is only good for people with OCD and at the same time it makes random small writes to the disk several magnitudes of order slower because most USB flash disks have very bad small IO thoughput.

I'm really not sure why this is in the default mount options. We should probably remove it.

> codepage=437 works only for countries where English is an official language and locale on their Windows PCs. For instance in Cyrillic speaking countries codepage must be 866.
> iocharset must be utf8 for all intents and purposes.

We don't add these options in storaged. These are default values from kernel config:

CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="ascii"

But it is possible to specify your own values for these options when mounting using storaged.

> There's no "quite" option which I'd love to see because it silences `cp -a` errors in regard to setting the owner/group.
> I would love to see "noatime" because I don't care about access times on my slow USB storage.
> There's no "usefree" option which increases mount speed by several orders of magnitude because the kernel doesn't have to scan all free sectors.

You can specify extra options for Mount function -- you can set the "usefree" and "noatime" options if you want (not sure why not "quiet").

Comment 2 Walter Francis 2016-12-13 16:30:57 UTC
(In reply to Vojtech Trefny from comment #1)
> > "flush" is only good for people with OCD and at the same time it makes random small writes to the disk several magnitudes of order slower because most USB flash disks have very bad small IO thoughput.
> 
> I'm really not sure why this is in the default mount options. We should
> probably remove it.

I wonder if it has to do with this insight from Lennart (reddit comment link) where he says (in my words) that systemd's mount system is intended to not mount a USB drive before it is needed an unmount it as soon as possible.

https://www.reddit.com/r/linux/comments/4ypb2g/systemd_rolls_out_its_own_mount_tool/d6qicwi/

> We don't add these options in storaged. These are default values from kernel
> config:
> 
> CONFIG_FAT_DEFAULT_CODEPAGE=437
> CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
> 
> But it is possible to specify your own values for these options when
> mounting using storaged.

Where is that done?  A particular unit in /etc/systemd/system to be over-ridden in /etc/systemd/user ?

Comment 3 Vojtech Trefny 2016-12-13 16:59:05 UTC
(In reply to Vojtech Trefny from comment #1)
> > "flush" is only good for people with OCD and at the same time it makes random small writes to the disk several magnitudes of order slower because most USB flash disks have very bad small IO thoughput.
> 
> I'm really not sure why this is in the default mount options. We should
> probably remove it.
> 

"flush" was added because of this bug -- https://bugs.freedesktop.org/show_bug.cgi?id=51063 -- so at least some people think it should be default.

Comment 4 Artem S. Tashkinov 2016-12-13 17:11:30 UTC
(In reply to Vojtech Trefny from comment #1)

> We don't add these options in storaged. These are default values from kernel config

These two options are default yet perfectly overridable and should be overridden for all countries where the default (Windows) locale is not English (CP437).

> But it is possible to specify your own values for these options when mounting using storaged.

That's exactly what this bug is about. I would love to be able to configure (add/remove/change) pretty much all the options which are used for mounting removable storage.

Also this bug is not about fat32/vfat per se, it's about all other filesystems as well. Like I said 99.9% of users will never need last access time updated on their removable storage, besides this operation involves a lot of small writes and seeks and it's specially "bad" for usual USB sticks.

> You can specify extra options for Mount function -- you can set the "usefree" and "noatime" options if you want (not sure why not "quiet").

Again my question is how. I cannot find anything remotely relevant in Fedora documentation. Even Arch Linux Wiki is very light on details.

In the past, when we had HAL, I did this:

cat /etc/hal/fdi/policy/20-fs_options.fdi

<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
        <device>
                <match key="volume.fstype" string="ntfs">
                        <append key="volume.mount.valid_options" type="strlist">uid=1000,fmask=0133,dmask=0022,nls=utf8,rw</append>
                </match>
                <match key="volume.fstype" string="vfat">
                        <append key="volume.mount.valid_options" type="strlist">noatime,showexec,iocharset=utf8,uid=1000,gid=1000,codepage=866,fmask=0111,dmask=0000,umask=0000,quiet,usefree,shortname=mixed</append>
                </match>
        </device>
</deviceinfo>

Nowadays it's absolutely moot. Should I use GUI tools? Or should I try creating certain files in /etc? What about making system wide changes so that if I have 10 user accounts on my PC I will not have to configure this for every user?

Then again and I'm asking it for the third time, the user must have an option to 1) add 2) change 3) remove ***all*** the options for their removable storage. In fact Fedora should allow me to mount removable media without ***any*** options whatsoever (e.g. /dev/sdb1 on /media/flash type ext4 (rw)). This is what this bug is about. Your defaults and even kernel defaults may not work for some people and for other people these options might be dealbreakers which hamper their workflow.

(In reply to Vojtech Trefny from comment #3)

> "flush" was added because of this bug -- https://bugs.freedesktop.org/show_bug.cgi?id=51063 -- so at least some people think it should be default.

If people knew they could in fact remove their storage properly by using "Eject" and at the same time gained quite tangible performance increases, the overall feeling would be to make this option configurable. I'm not against of having it by default for the reckless, but other people might enjoy a different scenario.

Comment 5 Fedora End Of Life 2017-11-16 19:43:15 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 6 Ben Cotton 2018-11-27 15:16:12 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Ben Cotton 2019-02-19 17:11:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 30 development cycle.
Changing version to '30.

Comment 8 Ben Cotton 2020-04-30 22:17:58 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Tomáš Bžatek 2020-05-04 09:41:49 UTC
FYI, UDisks 2.9.0 will introduce configurable mount options, see https://storageapis.wordpress.com/2020/04/09/the-road-to-udisks-2-9-0/

Comment 10 Ben Cotton 2020-05-26 14:36:37 UTC
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.