FS#71305 - [archinstall] Make btrfs mount with `noatime` instead of `relatime` in fstab
Attached to Project:
Arch Linux
Opened by TheEvilSkeleton (TheEvilSkeleton) - Sunday, 20 June 2021, 00:11 GMT
Last edited by David Runge (dvzrv) - Saturday, 02 September 2023, 17:20 GMT
Opened by TheEvilSkeleton (TheEvilSkeleton) - Sunday, 20 June 2021, 00:11 GMT
Last edited by David Runge (dvzrv) - Saturday, 02 September 2023, 17:20 GMT
|
Details
Description:
*Copy pasted from archlinux/archinstall#582[1]* It's worse to use relatime with btrfs due to the nature of CoW, and is only practical in edge cases. Using atime with btrfs can bring to performance regression, excessive use of storage and more. I highly recommend reading through the LVM article "Atime and btrfs: a bad combination?"[2] and GitHub comment[3] as they explain why using atime with btrfs is impractical for an average user. Instead, we should be using noatime in the fstab. P.S. Sorry if it's bad issue. P.P.S. I was suggested to submit a ticket here: https://github.com/archlinux/archinstall/issues/582#issuecomment-863839645 . Additional info: [1] https://github.com/archlinux/archinstall/issues/582#issue-922040315 [2] https://lwn.net/Articles/499293/ [3] https://github.com/kdave/btrfs-progs/issues/377#issuecomment-862920890 |
This task depends upon
Closed by David Runge (dvzrv)
Saturday, 02 September 2023, 17:20 GMT
Reason for closing: Upstream
Additional comments about closing: Please create tickets for upstream issues at https://github.com/archlinux/archinstall
Saturday, 02 September 2023, 17:20 GMT
Reason for closing: Upstream
Additional comments about closing: Please create tickets for upstream issues at https://github.com/archlinux/archinstall
If some default option is wrong please make clear if this is taken over from the installer or systemd or whatever pkg causes this issue.
I think the culprit is the `genfstab` command provided by the package extra/arch-install-scripts and `mount` command. When running `mount PART DIR` where PART is a btrfs partition, the `mount` command mounts the btrfs partition with `relatime` option.
`genfstab -U /mnt >> /etc/fstab` uses the exact same mount options and pastes to fstab, including `relatime` (from what I understood, correct me if I'm wrong). However, in my opinion, using `noatime` is a better option due to the nature of CoW. relatime is best used in ext4 or other non CoW FSes, but can cause trouble on CoW FSes like btrfs and XFS as stated in [2] and [3] in the main post.
My request is to make genfstab use `noatime` on btrfs (but XFS would be nice too), as it is a CoW FS.
So genfstab would only override options that have not been specified by the user.
Edit:
I can not find any mention of the issues with atime on [1]. If users as expected read the wiki page for the file-systems they intend to use and that covered mounting with the noatime option, then that would be picked up by genfstab and no change would be needed. This does not cover the case of archinstall which does not set the option and deferred the issue to this FS.
[1] https://wiki.archlinux.org/title/Btrfs
> Because of the copy-on-write nature of Btrfs simply accessing files can trigger the metadata copy and writing. Reducing the frequency of access time updates may eliminate this unexpected disk usage and increase performance. See fstab#atime options for the available options.
That being said, the LWM article and GitHub comment I mentioned above should give you sufficient information.
As for the rest, yeah, you're right.