Date: Mon, 29 Jan 2024 11:40:39 -0600 From: Mike Karels <mike@karels.net> To: Olivier Certner <olce@freebsd.org> Cc: freebsd-current@freebsd.org Subject: Re: noatime on ufs2 Message-ID: <6430CD93-B4D1-49D6-A39B-B8BCF424258F@karels.net> In-Reply-To: <11453367.ZaXhgXhNnV@ravel> References: <ZZqmmM-6f606bLJx@int21h> <6714298.qJWK8QVVMX@ravel> <9155214edb61b1bc3bad3bc96f96e22b@bsdforge.com> <11453367.ZaXhgXhNnV@ravel>
next in thread | previous in thread | raw e-mail | index | archive | help
Not responding to a specific message, but following up on the thread: I am not sure a sysctl is a good mechanism for setting the mount default, especially if it is to be set via the kernel environment from /boot/loader.conf. That's an obscure place to find file system defaults. It also seems undesirable to add a sysctl to control a value that the kernel doesn't use. Instead, I'd like to propose that the default be specified in a new entry in /etc/fstab, where it would be much more obvious. For example, a line could be placed at the beginning like: # Device Mountpoint FStype Options default none default noatime,... It could be retrieved with getfsspec("default") in the fs_mnntops field. I wouldn't include this entry when iterating through the whole file with getfsent() to avoid confusing existing programs. Then mount, and other utilities such as zfs create, could check it explicitly. It should be placed in /etc/fstab when it is created: by bsdinstall when it is used, preferably by having the user select this explicitly, but probably with noatime being the default. It would be in the pre-configured fstab used for VM images and SD card images. Anyone building a root file system by hand would have to deal with this to set a default. Note that the root file system is mounted specially in the kernel, but the noatime option doesn't need to be set at first while the root is read-only. It could be updated by mount when remounting read-write from the startup scripts. I would then have the mount program look up and apply the default for things like mounting a file system manually. Perhaps it could have a -D option to ignore defaults, e.g. for scripts that don't want to be subject to local settings. It would be plausible to set the default(s) in rc.conf instead, although that is more convenient for shell scripts than C programs. It would be possible to read output from something like "sysrc filesystem_defaults". It would also not be as obvious when setting or checking file system configuration. btw, I think there is consensus that noatime is the most useful setting for most systems and users. However, I don't think there is consensus that the default should be changed for things like mount with no options. I think that putting a default somewhere fairly obvious could make it more palatable (less POLA violation). Opinions may vary, though. Mike
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6430CD93-B4D1-49D6-A39B-B8BCF424258F>