[Nix#9417] Nix should not mount -o remount,rw
#98
Labels
No labels
Area/build-packaging
Area/evaluator
Area/flakes
Area/profiles
Area/remote-builds
Area/repl
Area/store
bug
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#98
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Upstream-Issue: NixOS/nix#9417
Can anybody explain why this is here?
516e7ddc41/src/libstore/local-store.cc (L576-L578)
I traced it back to
b9124a5c33
. It looks like the original codepath would check if/nix/store
was a--bind
mount and act only in that specific situation.The comment says:
516e7ddc41/src/libstore/local-store.cc (L565-L566)
Note that this codepath gets hit not only for the
/nix/store
store, but also when you usenix copy --from /mnt/somewhere/nix/store
. For example when recovering from a mangled system and trying to copy off whatever can be salvaged. Why would the--from
store need to be remounted read-write for that to happen?Some filesystems, in particular btrfs, will react to serious problems by switching the filesystem to readonly mode, and interpret any subsequent
mount -o remount,rw
as a "I know what I'm doing" signal by the root user. I don't think it's a good idea fornix-daemon
to signal this unilaterally. Remounting read-write without doing an fsck first is usually a bad decision, and bad decisions should be left up to the humans :)I think this behavior (remount read-write without an fsck) is one of the two reasons why Nixfolk have such strange (and strong!) opinions about btrfs. The other reason is explained in https://github.com/NixOS/nix/pull/7126#issuecomment-1820045768. I'd hate to see the same thing happen with bcachefs.