Skip to content

bootc-fstab-edit.service rewrites /etc/fstab on every boot when / already has ro #2592

Closed

Description

@realkaishady

Summary

On an Anaconda-installed system whose / entry in /etc/fstab already has ro, bootc-fstab-edit.service runs on every boot. It rewrites /etc/fstab and logs "Updated /etc/fstab to add ro for /", but changes nothing, and never writes its # Updated by bootc-fstab-edit.service marker. So the generator enables it again on the next boot, indefinitely.

Environment

  • Anatase Linux 20261019.8 (Fedora 45 based bootc image; booted from a derived image built on it), installed with Anaconda, Btrfs on LUKS2, composefs.
  • bootc --version: bootc 1.16.13

How it happens (from main, read 28 Oct 2026)

  1. The installer writes /etc/fstab with the # Created by anaconda header, and the / line already contains ro, mid-list: UUID=… / btrfs subvol=root,compress=zstd:1,ro,… 0 0.
  2. generator.rs → fstab_generator_impl: there's no BOOTC_EDITED_STAMP line, and there is the Anaconda stamp, so it calls generate_fstab_editor and enables bootc-fstab-edit.service.
  3. deploy.rs → fixup_etc_fstab / edit_fstab_line: the / line already has ro, so it's passed through unchanged and no stamp is written (the stamp is only written above a line it modifies). But the file is still replaced via atomic_replace_with, and "Updated /etc/fstab to add ro for /" is printed unconditionally.
  4. Next boot: still no stamp → step 2 again.

Observed

  • journalctl -u bootc-fstab-edit.service shows "Updated /etc/fstab to add ro for /" on a plain reboot and again after an image update, with the file's content identical before and after.
  • /etc/fstab gets a new mtime on every boot, so systemctl and mount print the "/etc/fstab has been modified on disk, systemd still uses the old version; run systemctl daemon-reload" hint after each boot.
  • Mounts are unaffected; it's noise plus a misleading log line.

Workaround (confirmed)

Append the marker comment yourself:

# Updated by bootc-fstab-edit.service

After the next reboot journalctl -b -u bootc-fstab-edit.service has no entries, the fstab mtime stays put and the daemon-reload hint is gone.

Suggested fix

In fixup_etc_fstab, track whether any line was edited. If none was: don't rewrite the file and don't print "Updated…", but do write the stamp (or otherwise record that the check ran) so the generator stops enabling the unit. Alternatively, have fstab_generator_impl skip when the / entry already has ro.

Possibly related but different: #971 (root mount options under composefs).

Activity

  1. cgwalters commented on Oct 27, 2026

    @cgwalters
    Member

    Alternatively, have fstab_generator_impl skip when the / entry already has ro.

    I think this is the right fix

  2. added 2 commits that reference this issue on Nov 1, 2026
    6e3b779
    2ef521b
  3. added a commit that references this issue on Nov 3, 2026
    0fd06cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions