unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35472: Boot bind mount device path incorrect
@ 2019-04-28 15:27 rendaw
  2021-08-09 17:54 ` bug#35472: François-René Rideau
  2021-08-09 22:58 ` bug#35472: Boot bind mount device path incorrect Leo Famulari
  0 siblings, 2 replies; 7+ messages in thread
From: rendaw @ 2019-04-28 15:27 UTC (permalink / raw)
  To: 35472

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")

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#35472:
  2019-04-28 15:27 bug#35472: Boot bind mount device path incorrect rendaw
@ 2021-08-09 17:54 ` François-René Rideau
  2021-08-09 18:56   ` bug#35472: Leo Famulari
  2021-08-09 22:58 ` bug#35472: Boot bind mount device path incorrect Leo Famulari
  1 sibling, 1 reply; 7+ messages in thread
From: François-René Rideau @ 2021-08-09 17:54 UTC (permalink / raw)
  To: 35472

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.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#35472:
  2021-08-09 17:54 ` bug#35472: François-René Rideau
@ 2021-08-09 18:56   ` Leo Famulari
  2021-08-09 21:06     ` bug#35472: François-René Rideau
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2021-08-09 18:56 UTC (permalink / raw)
  To: François-René Rideau; +Cc: 35472

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




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#35472:
  2021-08-09 18:56   ` bug#35472: Leo Famulari
@ 2021-08-09 21:06     ` François-René Rideau
  2021-08-09 22:09       ` bug#35472: Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: François-René Rideau @ 2021-08-09 21:06 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 35472

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.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#35472:
  2021-08-09 21:06     ` bug#35472: François-René Rideau
@ 2021-08-09 22:09       ` Leo Famulari
  2021-08-10  1:22         ` bug#35472: François-René Rideau
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2021-08-09 22:09 UTC (permalink / raw)
  To: François-René Rideau; +Cc: 35472

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"?




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#35472: Boot bind mount device path incorrect
  2019-04-28 15:27 bug#35472: Boot bind mount device path incorrect rendaw
  2021-08-09 17:54 ` bug#35472: François-René Rideau
@ 2021-08-09 22:58 ` Leo Famulari
  1 sibling, 0 replies; 7+ messages in thread
From: Leo Famulari @ 2021-08-09 22:58 UTC (permalink / raw)
  To: rendaw; +Cc: 35472

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.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#35472:
  2021-08-09 22:09       ` bug#35472: Leo Famulari
@ 2021-08-10  1:22         ` François-René Rideau
  0 siblings, 0 replies; 7+ messages in thread
From: François-René Rideau @ 2021-08-10  1:22 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 35472

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.




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-10  1:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-28 15:27 bug#35472: Boot bind mount device path incorrect rendaw
2021-08-09 17:54 ` bug#35472: François-René Rideau
2021-08-09 18:56   ` bug#35472: Leo Famulari
2021-08-09 21:06     ` bug#35472: François-René Rideau
2021-08-09 22:09       ` bug#35472: Leo Famulari
2021-08-10  1:22         ` bug#35472: François-René Rideau
2021-08-09 22:58 ` bug#35472: Boot bind mount device path incorrect Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).