From nobody Mon Jan 29 17:40:39 2024 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TNwZ76Lw6z595q6 for ; Mon, 29 Jan 2024 17:40:47 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TNwZ74btYz4wlN; Mon, 29 Jan 2024 17:40:47 +0000 (UTC) (envelope-from mike@karels.net) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.17.1/8.17.1) with ESMTP id 40THeeTK087188; Mon, 29 Jan 2024 11:40:40 -0600 (CST) (envelope-from mike@karels.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karels.net; s=mail2; t=1706550040; bh=6BaQEBSH1RRyFC577D055pYgrHS/Tlt5CWNMc9Jwq3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jQ5/SWQ3masntgjBkvTUFY5/c0efKUqqyKPvkxinsKcIfuBFMPRNV/D3ynSqUbVQs VbqFgYg5CrsE4CMHzv54x2Rwy5Dq/8taBd0GaQUCPKFEVkAMczCW+fGCl7b4mtp9V5 5qmz8YDgV2MDpDRJGr3DvpB4WZKyDwhvEh5yYBOpIZkSa5AxoQSVVqbXcNGEAGI69W 78rmkYVUdz1NKxcKbYfVQCilxiJ5z/8pvix/7igPRNQw10Fn3ZMp6jhMGA1tqrxLE6 adSRppeWYiLqpyCWwETtODr07gz9aLmVkPNEmr98v0DXcbEerwftyBkBtSf4YVe3A2 5skG1w74fdKOA== Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id Oxv1LBjjt2WSVAEAs/W3XQ (envelope-from ); Mon, 29 Jan 2024 11:40:40 -0600 From: Mike Karels To: Olivier Certner Cc: freebsd-current@freebsd.org Subject: Re: noatime on ufs2 Date: Mon, 29 Jan 2024 11:40:39 -0600 X-Mailer: MailMate (1.14r6015) Message-ID: <6430CD93-B4D1-49D6-A39B-B8BCF424258F@karels.net> In-Reply-To: <11453367.ZaXhgXhNnV@ravel> References: <6714298.qJWK8QVVMX@ravel> <9155214edb61b1bc3bad3bc96f96e22b@bsdforge.com> <11453367.ZaXhgXhNnV@ravel> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 4TNwZ74btYz4wlN X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] 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