GNU bug report logs - #35472
Boot bind mount device path incorrect

Previous Next

Package: guix;

Reported by: rendaw <7e9wc56emjakcm <at> s.rendaw.me>

Date: Sun, 28 Apr 2019 15:29:01 UTC

Severity: normal

Found in version 0.16.0

To reply to this bug, email your comments to 35472 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#35472; Package guix. (Sun, 28 Apr 2019 15:29:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to rendaw <7e9wc56emjakcm <at> s.rendaw.me>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 28 Apr 2019 15:29:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: rendaw <7e9wc56emjakcm <at> s.rendaw.me>
To: submit <at> debbugs.gnu.org
Subject: Boot bind mount device path incorrect
Date: Mon, 29 Apr 2019 00:27:58 +0900
Package: guix
Version: 0.16.0

I specified a needed-at-boot bind mount from "/x/y" to "/y" but this
failed with the error:

ERROR: In procedure stat:
In procedure stat: No such file or directory: "/x/y"

At boot "/x" is actually mounted at "/root/x" so the bind mount path
should be "/root/x/y" -- making such a change causes the boot to work.

User defined filesystems with non-dev paths added to the boot mounts
should either automatically get "/root" prepended to the device path or
else the fact that they need to be prepended should be included in the
documentation, since there's no other way to discover this (other than
reading the source and trial/error).

For people hitting the same error, you can double check the mount points
at the repl you're dropped into with:

(use-modules (ice-9 ftw))
(scandir "/root")




Information forwarded to bug-guix <at> gnu.org:
bug#35472; Package guix. (Mon, 09 Aug 2021 18:09:03 GMT) Full text and rfc822 format available.

Message #8 received at 35472 <at> debbugs.gnu.org (full text, mbox):

From: François-René Rideau <fare <at> mukn.io>
To: 35472 <at> debbugs.gnu.org
Date: Mon, 9 Aug 2021 13:54:15 -0400
I believe my issue is the same and that I could narrow it down more.

The `mount --bind /nixos/nix /nix` command works, but if I put a line
`"/nixos/nix /nix bind defaults"` in `/etc/fstab`, then mount will instead
fail with: `mount: /nix: unknown filesystem type 'bind'.`

If instead in fstab I use type `none` and put `bind` in the options,
then `mount /nix` works at the command-line but interestlingly
`guix system reconfigure guix-config.scm` still fails with:
```
guix system: warning: exception caught while executing 'start' on
service 'file-system-/nix':
In procedure mount: mount "/nixos/nix" on "///nix": No such device
guix system: warning: some services could not be upgraded
```

Below is the `file-systems` definition of my `guix-config.scm`, in an attempt
to share the `/nix` directory of my NixOS installation with GuixSD, just like
I share the /guix directory of my GuixSD installation with NixOS:

```
  (file-systems
    (append
     (let* ((boot (file-system
                   ;;(uuid "C1D9-0574")
                   (device "/dev/nvme0n1p1")
                   (mount-point "/boot")
                   (type "vfat")))
            (root (file-system
                   ;;(device "/dev/mapper/yew-guix")
                   (device (uuid "43f7ca3e-c107-4f15-9756-5d3cbacad0a0"))
                   (mount-point "/")
                   (type "btrfs")
                   #;(flags '(no-atime))
                   (options "compress=zstd")
                   (dependencies mapped-devices)))
            (home (file-system
                   ;;(device "/dev/yew/home")
                   (device (uuid "a3602532-3527-4afc-9b40-5d01c58b5aa8"))
                   (mount-point "/home")
                   (type "ext4")
                   (dependencies mapped-devices)))
            (nixos (file-system
                    (device (uuid "ab3d691b-227a-4a05-a084-6928abbf0959"))
                    (mount-point "/nixos")
                    (type "ext4")
                    (dependencies mapped-devices)))
            (nix (file-system
                  (device "/nixos/nix")
                  (mount-point "/nix")
                  ;;(type "bind") ;; fails both at CLI and during reconfigure
                  (type "none") (option "bind") ;; CLI OK, reconfigure FAIL
                  (dependencies (list nixos)))))
       (append (list boot root home nixos nix) %base-file-systems))))
```

Note that neither bind nor none appear in `/proc/filesystem` nor in
`/run/booted-system/kernel/lib/modules/5.13.8/kernel/fs` — but then
neither do they on NixOS and yet it all works there.




Information forwarded to bug-guix <at> gnu.org:
bug#35472; Package guix. (Mon, 09 Aug 2021 18:57:02 GMT) Full text and rfc822 format available.

Message #11 received at 35472 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: François-René Rideau <fare <at> mukn.io>
Cc: 35472 <at> debbugs.gnu.org
Subject: Re: bug#35472:
Date: Mon, 9 Aug 2021 14:56:17 -0400
On Mon, Aug 09, 2021 at 01:54:15PM -0400, François-René Rideau wrote:
>             (nix (file-system
>                   (device "/nixos/nix")
>                   (mount-point "/nix")
>                   ;;(type "bind") ;; fails both at CLI and during reconfigure
>                   (type "none") (option "bind") ;; CLI OK, reconfigure FAIL
>                   (dependencies (list nixos)))))

Try replacing the option field with (flags '(bind-mount))

https://guix.gnu.org/manual/en/html_node/File-Systems.html




Information forwarded to bug-guix <at> gnu.org:
bug#35472; Package guix. (Mon, 09 Aug 2021 21:34:02 GMT) Full text and rfc822 format available.

Message #14 received at 35472 <at> debbugs.gnu.org (full text, mbox):

From: François-René Rideau <fare <at> mukn.io>
To: Leo Famulari <leo <at> famulari.name>
Cc: 35472 <at> debbugs.gnu.org
Subject: Re: bug#35472:
Date: Mon, 9 Aug 2021 17:06:26 -0400
Wow, this works:
(type "bind") (flags '(bind-mount))

and it works by *not* putting any entry in /etc/fstab, yet doing the
thing somehow. So the bug in mount is still there, but is worked
around.

> https://guix.gnu.org/manual/en/html_node/File-Systems.html
Indeed bind-mount is mentioned there, but vastly under-documented,
especially since the guix paragraph refers to some glibc documentation
for mount(2) for details, and those details saying nothing whatsoever
about bind.




Information forwarded to bug-guix <at> gnu.org:
bug#35472; Package guix. (Mon, 09 Aug 2021 22:10:02 GMT) Full text and rfc822 format available.

Message #17 received at 35472 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: François-René Rideau <fare <at> mukn.io>
Cc: 35472 <at> debbugs.gnu.org
Subject: Re: bug#35472:
Date: Mon, 9 Aug 2021 18:09:39 -0400
On Mon, Aug 09, 2021 at 05:06:26PM -0400, François-René Rideau wrote:
> and it works by *not* putting any entry in /etc/fstab, yet doing the
> thing somehow. So the bug in mount is still there, but is worked
> around.

Can you clarify what is the "bug in mount"?




Information forwarded to bug-guix <at> gnu.org:
bug#35472; Package guix. (Mon, 09 Aug 2021 22:59:02 GMT) Full text and rfc822 format available.

Message #20 received at 35472 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: rendaw <7e9wc56emjakcm <at> s.rendaw.me>
Cc: 35472 <at> debbugs.gnu.org
Subject: Re: bug#35472: Boot bind mount device path incorrect
Date: Mon, 9 Aug 2021 18:58:22 -0400
On Mon, Apr 29, 2019 at 12:27:58AM +0900, rendaw wrote:
> Package: guix
> Version: 0.16.0

Reproduced with 1.3.0ish.

> I specified a needed-at-boot bind mount from "/x/y" to "/y" but this
> failed with the error:
> 
> ERROR: In procedure stat:
> In procedure stat: No such file or directory: "/x/y"
> 
> At boot "/x" is actually mounted at "/root/x" so the bind mount path
> should be "/root/x/y" -- making such a change causes the boot to work.

To reproduce this bug:

# mkdir -p /foo/bar
# mkdir -p /bar

Add this to the file-systems field of your config.scm:

(file-system
  (device "/foo/bar")
  (mount-point "/bar")
  (type "none")
  (check? #f)
  (needed-for-boot? #t)
  (flags '(bind-mount)))

Your system should fail to boot.




Information forwarded to bug-guix <at> gnu.org:
bug#35472; Package guix. (Tue, 10 Aug 2021 01:50:02 GMT) Full text and rfc822 format available.

Message #23 received at 35472 <at> debbugs.gnu.org (full text, mbox):

From: François-René Rideau <fare <at> mukn.io>
To: Leo Famulari <leo <at> famulari.name>
Cc: 35472 <at> debbugs.gnu.org
Subject: Re: bug#35472:
Date: Mon, 9 Aug 2021 21:22:25 -0400
My apologies: I was just confused about the syntax of bind entries in
/etc/fstab.

"bind" goes in the options field (no ",defaults" needed), whereas
"none" goes in the type field. I tried it this way and mount works
just fine on Guix as well as on NixOS and Debian and other Linux
variants; and with my incorrect syntax (with "bind" in the type field)
it fails on all of them.

Now, whereas the guix manual does need clarification about
"bind-mount", I see that there is a recipe in the cookbook that
specifically explains how to declare bind entries in Guix.




This bug report was last modified 2 years and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.