Bug 119900 - Improve default mount options
Summary: Improve default mount options
Status: RESOLVED UPSTREAM
Alias: None
Product: openSUSE 11.2
Classification: openSUSE
Component: Hotplug (show other bugs)
Version: Final
Hardware: Other All
: P3 - Medium : Normal (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on: 301801
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-03 16:33 UTC by Stanislav Brabec
Modified: 2010-01-08 15:24 UTC (History)
4 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
hal-vfat-methods.patch (654 bytes, patch)
2006-06-27 16:23 UTC, Stanislav Brabec
Details | Diff
hal-vfat-methods.patch (654 bytes, patch)
2006-06-27 16:23 UTC, Stanislav Brabec
Details | Diff
gnome-volume-manager-vfat-flags.patch (1.67 KB, patch)
2006-06-27 16:34 UTC, Stanislav Brabec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav Brabec 2005-10-03 16:33:15 UTC
Default mount options should contain:

1) "noatime" for slowly seeking and media with limited rewritability, if
filesystem supports it

If filesystem supports atime (e. g. UDF), noatime is a must. It speeds reading
of large amounts of small files from CD/DVD up to 10 times! Not having noatime,
CD-RW is wasted after few reading only sessions.

Affected media types:
DVD-RAM (big slow down of reading, waste if used for long time), flash RAM (if
formatted for filesystems supporting atime and used for long time)

Media wasting:
CD-MRW, CD-RW packet mode, DVD-MRW, DVD-RW packet mode (if such mode exists)

Due to media wasting and extreme slow-down, setting severity to major.


2) It would be nice to not have +x flag for files copied from vfat and dos*
filesystems.

Mount command lacks proper mount option, but for default umask, fmask=0133 can
provide this.

Note: Mount command uses umask of mount command process for default umask, so
the proper value should be umask|0111.
Comment 1 Danny Al-Gaaf 2005-10-06 13:13:07 UTC
Is this change really needed for 10.0? Need we really a YOU updated or is it for 
10.1?  
Comment 2 Stanislav Brabec 2005-10-06 15:11:07 UTC
I would like to see YOU or at least SDB, but it depends on decision of Andreas.

For those few users of packet writing and Mr. Rainier CD-RW it is a major issue,
because their medium is wasted after reading (i. e. atime rewrites) of about 20
files from medium (OK, Mt. Rainier can remap burned-out / inode block several
times).

For many DVD-RAM user, 100000 reads (i. e. atime rewrites) limit does not hurt,
but it also means significant speed-up, too (2x-8x depending on file sizes, file
system, hierrarchy and software):

And finally, VFAT umask is only a cosmetic issue. For example images from camera
don't have +x flag.

DVD-RAM example:

hammer:~ # umount /media/dvdram
hammer:~ # eject /dev/sr0 ; eject -t /dev/sr0
hammer:~ # mount /dev/sr0 /media/dvdram
hammer:~ # time tar -c -f /dev/null /media/dvdram/linux-2.6.13-15
tar: Removing leading `/' from member names

real    4m16.522s
user    0m0.160s
sys     0m0.836s
hammer:~ # umount /media/dvdram # another 30 seconds of writing
hammer:~ # eject /dev/sr0 ; eject -t /dev/sr0

hammer:~ # mount -onoatime /dev/sr0 /media/dvdram
hammer:~ # time tar -c -f /dev/null /media/dvdram/linux-2.6.13-15
tar: Removing leading `/' from member names

real    2m35.250s
user    0m0.480s
sys     0m0.976s
Comment 3 Danny Al-Gaaf 2005-10-06 18:32:37 UTC
I take next week a look at this.
Comment 4 Stanislav Brabec 2005-10-06 19:42:15 UTC
Maybe bug 119888 is related (but change in fstab to rw causes ro warning for non
DVD-RAM media).
Comment 5 Andreas Jaeger 2005-10-07 04:57:51 UTC
Not for 10.0 - and please discuss the default on the research mailing list first.
Comment 6 Stanislav Brabec 2005-10-07 11:25:52 UTC
Mail to research mailing list sent:

Subject: experiences and suggestions for removable media mounting and usage
Date: 	Fri, 07 Oct 2005 13:13:28 +0200
Comment 7 Stanislav Brabec 2005-11-08 16:23:30 UTC
Adding a new issue:

3) "sync" burns-out FAT or similar area of media with limited rewritability after some time and slows down write. This issue affects especially flash cards.

Adding Kay Sievers to discuss this bug with.
Comment 8 Kay Sievers 2005-11-08 16:38:22 UTC
The "burns out" thing is not really an issue on todays media, but
sure, we should not write more often than needed. Here is a short
analysis from a flash vendor:
  http://www.sandisk.com/pdf/oem/WPaperWearLevelv1.0.pdf
Comment 9 Stanislav Brabec 2005-11-08 16:56:11 UTC
Yes, but noatime issue in 1) affects CD-RW, too. It has typically 50-1000 write cycles and for example packet mode CD-RW has no bad block mapping.

And both 1) and 3) have significant impact on writing performance.
Comment 10 Danny Al-Gaaf 2005-11-24 11:52:35 UTC
I reassign this to coolo, he plan to write a storage manager for 10.1. This issue should be fixed in this storage manager, the hal-subfs-mount helper should be then obsolete
Comment 11 Stanislav Brabec 2005-12-08 22:47:41 UTC
vfat can have additionally "quiet" as default mount option. It improved behavior of some file managers (e. g. mc).

And vfat "codepage=" can contain legacy encoding corresponding to locale. As a source you can use map from /etc/profile.d/glib2.sh. In past there was a standard conversion between ISO-Latin pages and IBM-Latin pages (e.g. ISO-8859-2 corresponds to CP852). I probably can prepare the map for you.
Comment 12 Stanislav Brabec 2005-12-18 00:22:22 UTC
http://fy.chalmers.se/~appro/linux/DVD+RW/#udf decribes one another type of media wasting - dirty flag writing on each R/W mount. I don't know, whether it is still an issue with current kernel, but if it is, with the "help" of subfs, it can waste root node of a medium soon.
Comment 13 Stephan Kulow 2006-01-30 17:03:02 UTC
subfs is dropped and KDE does most of what you describe already - and is user configurable.
Comment 14 Stanislav Brabec 2006-03-27 13:25:47 UTC
Reopening bug. At least "noatime" on DVD-RAM (and probably CD-MRW and packet CD-RW) is not yet fixed in SuSE Linux 10.1 beta8 with default mount options. I have not yet tested other.

Please reassign to maintainers of programs, which should provide mount options in 10.1.
Comment 15 Stanislav Brabec 2006-03-27 15:36:16 UTC
Reassigning to gnome-volume-manager maintainer - I have experienced it in GNOME. Not sure whether KDE shares defaults.
Comment 16 Jeff Stedfast 2006-03-27 19:46:44 UTC
what filesystems do we want to add noatime as a mount option for?
Comment 17 Stanislav Brabec 2006-03-28 10:09:15 UTC
There is a list of useful flags:

1) "noatime" for slowly seeking, slowly writing and media with limited rewritability, if filesystem supports it. For DVD-RAM and CD-MRW it means UDF in most cases. I am  not sure, whether noatime issue affects also FAT32 flash ROM (some people report so). In general, it should not be a mistake to use "noatime" for any RW mount of CD, DVD, flash ROM.

2) FAT noexec "fmask=0133" (or better use current umask to create it) - see 2) in the report above.

3) "quiet" and "codepage=" for vfat/fat/msdos: comment #11. "quiet" has no problems, "codepage=" needs some locale dependent settings.

Remaining issues:

sync/async: I guess it was addressed by other bug reports.

delayed dirty flag: Needs further research (comment #12).
Comment 18 JP Rosevear 2006-03-28 13:57:47 UTC
I'm not so sure this is major.  Everything works pretty good by default.
Comment 19 Jeff Stedfast 2006-03-28 21:02:10 UTC
fixed in our packages
Comment 20 Stanislav Brabec 2006-06-27 16:21:16 UTC
Reopening. The result still looks ugly. Photos from my camera are all-uppercase and marked as executable.
Comment 21 Stanislav Brabec 2006-06-27 16:23:31 UTC
Created attachment 91800 [details]
hal-vfat-methods.patch

This patch seems to provide much better vfat mount options:

- removes shortname=winnt
- adds support for fmask and sets it to reasonable value

Note that it would be much better to be able to set default mount options in gconf key or even on per-device basis.
Comment 22 Stanislav Brabec 2006-06-27 16:23:50 UTC
Created attachment 91801 [details]
hal-vfat-methods.patch

Required fix of hal.
Comment 23 Stanislav Brabec 2006-06-27 16:26:07 UTC
Please note, that there can be more differences between allowed mount options in storage-methods and in mount(8) man page.
Comment 24 Stanislav Brabec 2006-06-27 16:34:59 UTC
Created attachment 91806 [details]
gnome-volume-manager-vfat-flags.patch

The right patch for the gnome-volume-manager.
Comment 25 Andreas Jaeger 2006-08-07 13:35:59 UTC
Jeff, this is assigned to you.  Are you taking care of this for 10.2?
Comment 26 Jeff Stedfast 2006-08-07 17:28:14 UTC
yes, I've already got a patch along with some related fixes... just waiting to hear that they are working for a customer
Comment 27 Stanislav Brabec 2007-02-25 21:04:27 UTC
In SuSE Linux 10.2, DVD-RAM is again mounted with atime. It slows down reading of small files by a factor of 5-10 by tons of obsolete seeks.
Comment 28 Hans Petter Jansson 2007-02-25 21:21:32 UTC
I don't see the patch Jeff is talking about in comment #26 in 10.2 nor in STABLE. I think we'll just go with Stanistav's patch, since that looks correct.

Should I submit this as an update to 10.2 or just to STABLE?
Comment 29 Hans Petter Jansson 2007-02-25 21:50:33 UTC
It looks like the equivalent of Stanislac's patch is already in gnome-volume-manager 2.17.0, which is in 10.2 and STABLE.

The noatime option should be added to gnome-mount's default gconf schemas for iso9660 and udf, I suppose. I'll look at doing that.
Comment 30 Martin Sohnius 2007-03-21 15:02:42 UTC
I entered Bugzilla exactly to *complain* about the missing shortname=winnt option when mounting vfat file systems.  

Without that option, names that fall into the DOS 8+3 pattern are automatically converted to lower case only.  This can have effects ranging from the undesirable to the disastrous, as in the following case:

Install a new SLED into a dual-boot scenario with a Windows D-drive that contains the (Windows) iFolder for the user.  Novell IS&T don't recommend using the same iFolder for both operating systems, but we do recommend locally copying it, so that the iFolder client on the Linux side only needs to update its index files to initialise itself, rather than download the entire iFolder contents.  However, if there is *any* name mangling in the mount option, this can have disastrous effects on the user's iFolder.  In the best case, there is a phantastic waste of bandwidth as files get up and downloaded which are seen as different by Linux but not by Windows, in the worst case the user may lose them entirely.  Please, give us that namespace=winnt back!

> Created an attachment (id=91800) [edit]
> hal-vfat-methods.patch
> 
> This patch seems to provide much better vfat mount options:
> 
> - removes shortname=winnt
> - adds support for fmask and sets it to reasonable value
> 
> Note that it would be much better to be able to set default mount options in
> gconf key or even on per-device basis.
> 

Comment 31 Stanislav Brabec 2007-04-03 16:07:15 UTC
In openSUSE 10.2 I see slightly different problems:


noatime and nodiratime:

Flags were moved to the d-bus default options enabled for all filesystems. Looking at g-v-m sources, it seems that it tries to set them, only if they are configured for defined filesystem. But it seems that g-v-m ignores globally enabled flags.

Using noatime and nodiratime is a must for all devices with slow seek, slow speed and limited rewrite count. For example, DVD-RAM reading is nearly about 10 times faster when reading unpacked kernel sources with them!

The main problem is the fact, that it tries to commit atime and diratime in half of reading of file. It causes obsolete seeks and it make things slower. Making things slower cause, that commit interval for this file will again expire during reading of one of next files and so on.


About winnt flag:

I don't understand technical background, but I definitely want to see pictures from my camera (using only 8+3 names) downloaded in lowercase. Well, ideally I would see my camera flash mounted as msdos, not vfat. My camera writes names uppercase.

I am not sure, whether it is possible to fulfil both requirements, or specifically, wheter it is possible to discriminate between vfat-enabled and 8+3 volumes.

And finally, the fmask/dmask stuff from upper mentioned patch should be configurable. Just now, it is OK to sed fmask -x for all files. But if we will use binfmt_misc for running Windows executables, we may want .exe, .com and .bat with +x. Setting +x for all files can have ugly consequences. But it would not be possible without kernel changes.
Comment 32 Stanislav Brabec 2007-04-03 17:05:11 UTC
I have just discussed the winnt problem.

Summary:
- Devices using only 8+3 uppercase. We want them all-lowercase, no vfat records. I name these as msdos, but we can mount most of them as vfat, but with "lower" option without risk of file system breakage.
- Devices using long filenames. We want "winnt" option and vfat records.

It is not easy to discriminate between these cases.

There are few ideas:

- Guess: Check file system root. If there is no vfat item, guess as msdos, otherwise vfat. Will fail if file system root was created on vfat, but all files and directories were 8+3 all-uppercase. Will fail for just formatted card.

- Guess + ask user: Guess. If there is no vfat entry, ask user "File system seems to use only 8+3 uppercase file names. Do you want to support long file names and/or use simple case conversion?"

- Guess + ask user + remember: Remember USB ID or flash serial number and not as again.

- USB ID list: If you are mounting USB device known to not support vfat (most cameras, some MP3 players,...), use msdos.

- Camera DCIM list: Mount ro as vfat, look at DCIM/dcim, look at 100*, compare it with camera default names. If it is owned by 8+3 device, unmount and mount as msdos, otherwise remount rw.

- Format stamp list: Check format stamp. If card was formatted on known 8+3 device, use msdos, otherwise vfat.

- Optionally allow to store correct options on a (hidden) file in the file system root.


There is one unwanted consequence of winnt flag:

If you are copying a lowercase file from computer back to former MSDOS-only medium, it creates two entries in the file system structure - one uppercase MSDOS entry and one lowercase vfat entry. Some embedded systems may not accept it.
Comment 33 Martin Sohnius 2007-05-08 17:10:47 UTC
Folks, I see that you are trying very hard to come up with a technical solution that incorporates Stanislav's expressed wish "I definitely want to see pictures
from my camera (using only 8+3 names) downloaded in lowercase".  

I am trying to argue from the position of an IT manager in a big corporation, the kind of customer we at Novell are trying to sell product to so that we all can continue to have a salary and feed our children.  While this argument may not apply to OpenSuSE, it does apply to SLED.  

So:  I don't care about the OpenSuSE release, but I don't want to see any file-name mangling in SLED.  MS-DOS had uppercase-only 8+3 file names.  People who didn't like it, didn't use MS-DOS (such as I, being an old UNIX hand).  But that's the world we live in, and if today's digital cameras still use MS-DOS filenames, then the directories containing our photographs will have upper case file names.  Tough!  Changing the file names should and could be done with a tool (i.e. a 5-line shell script), but it should not be done transparently through the mount option of the file system.

My 2 cents.
Comment 34 Stanislav Brabec 2007-08-20 12:59:08 UTC
Splitting to more particular bugs.
Comment 35 Stanislav Brabec 2008-03-25 11:22:21 UTC
In recent versions it's easy to preconfigure the default in GNOME (10.3 - gnome-volume-manager, 11.0 - nautilus) using gconf-editor.

It provides an easy solution for change of of the default mount options for particular file systems. It decreases urgency of shortname= guessing nearly to zero - people can adjust their settings as they need.

The rest remains valid. The default must be usable.

In addition, being able to set mount options (and even filesystem) for particular medium would be very nice and easy to implement.
Comment 36 Ming Xi Wu 2009-04-17 09:18:24 UTC
ping.
Dose customer still wait for the request? 
As the whole architecture has been changed in both SLED11 and upstream.
Comment 37 Stanislav Brabec 2009-12-01 17:40:47 UTC
There was no customer request. It was found during testing of removable media.

At least major part of the complain - hardcoded mount options are fixed in SLE11. See comment 35. But the DVD-RAM & CD-MRW atime rewrite default was never changed: See bug 119900.

Starting with openSUSE 11.2 it is broken again: Mount options are again not configurable. Now they are coded in DeviceKit-disks: DeviceKit-disks-007/src/devkit-disks-device.c: vfat_defaults.

It is possible to pass custom mount options without root privileges e. g. by using devkit-disks utility, but I found no way to configure it in the GNOME auto mounting system.

Well, I don't yet fully understand the new mechanism, but it seems to be mounted by nautilus->gvfs->gvfs-backends->gvfs-gdu-volume-monitor->libgdu0->DeviceKit-disks->udev.

Starting with openSUSE 11.2 there is another mount problem - bad mtime - see bug 556979.

But anything yet done is far from the ideal state: Make possible to user-configure mount defaults and make possible to remember mount options (or even file system) for particular medium.
Comment 38 Kay Sievers 2009-12-02 08:49:54 UTC
(In reply to comment #37)
> Starting with openSUSE 11.2 it is broken again: Mount options are again not
> configurable.
> 
> It is possible to pass custom mount options without root privileges e. g. by
> using devkit-disks utility, but I found no way to configure it in the GNOME
> auto mounting system.

Right, there is no way to pass any custom mount options anymore.

> Well, I don't yet fully understand the new mechanism, but it seems to be
> mounted by
> nautilus->gvfs->gvfs-backends->gvfs-gdu-volume-monitor->libgdu0->DeviceKit-disks->udev.

Looks right, besides that udev is not involved in mounting, it's the dk-disks daemon.

> But anything yet done is far from the ideal state: Make possible to
> user-configure mount defaults and make possible to remember mount options (or
> even file system) for particular medium.

The upstream project does intentionally not support anything like that anymore. Any discussion about this should better be addressed to the freedesktop upstream project, and not in the Novell bugzilla.
Comment 39 Shuang Qiu 2009-12-09 08:13:46 UTC
Could this bug be closed.
Comment 40 Xiao Yu Yang 2010-01-08 02:51:15 UTC
hi all,could this bug be closed? Looking forword to your reply.
Comment 41 Stanislav Brabec 2010-01-08 15:24:27 UTC
Well, it should be probably done in upstream.