unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Trouble with nfs mount
@ 2022-10-16 21:46 Fredrik Salomonsson
  2022-10-16 23:17 ` Felix Lechner via
  2022-10-17  1:46 ` Maxim Cournoyer
  0 siblings, 2 replies; 9+ messages in thread
From: Fredrik Salomonsson @ 2022-10-16 21:46 UTC (permalink / raw)
  To: help-guix

Hi Guix,

I'm having some issues with my nfs storage on Guix System.

Here is the part of my configuration that deals with mounting the nfs
device.

  (define nfs-valhalla
    (file-system
     (device "fafner:/srv/nfs4/Valhalla")
     (mount-point "/media/Valhalla")
     (options "auto,_netdev,timeo=10")
     (type "nfs4")
     (mount? #f)
     (check? #f)))

  (operating-system
   ;; …
   (file-systems
    (cons*
     ;; …
     nfs-valhalla
     %base-file-systems)))

cat /etc/fstab:
---✂----------------------------------------------------------------------------
  …
  fafner:/srv/nfs4/Valhalla	/media/Valhalla	nfs4	auto,_netdev,timeo=10	
--------------------------------------------------------------------------------

As you can see Guix creates it just fine in /etc/fstab. I can manually
mount it. But if it's mounted when I'm shutting down the system it will
block. Sheperd will wait for some process to finish (which I assume is
the nfs mount). It works fine if I manually unmount it before shutting
down.

If I set it to mount on boot, it wont reach the tty prompt. Instead it
will get stuck somewhere along the boot process (grub menu to the
rescue). I do see shepherd failing to mount it after I've run guix
system reconfigure.

---✂----------------------------------------------------------------------------
…
shepherd: Evaluating user expression (and (defined? (quote transient?)) (map (# ?) ?)).
guix system: warning: exception caught while executing 'start' on service 'file-system-/media/Valhalla':
In procedure mount: mount "fafner:/srv/nfs4/Valhalla" on "///media/Valhalla": Invalid argument
guix system: warning: some services could not be upgraded
…
--------------------------------------------------------------------------------

So that's probably what's happening during boot.

I have no idea how it transforms the mount-point from "/media/Valhalla"
to "///media/Valhalla" and if that's a red herring.

Any ideas what I'm doing wrong?

Thanks!

-- 
s/Fred[re]+i[ck]+/Fredrik/g


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

* Re: Trouble with nfs mount
  2022-10-16 21:46 Trouble with nfs mount Fredrik Salomonsson
@ 2022-10-16 23:17 ` Felix Lechner via
  2022-10-17  1:08   ` Fredrik Salomonsson
  2022-10-17  1:46 ` Maxim Cournoyer
  1 sibling, 1 reply; 9+ messages in thread
From: Felix Lechner via @ 2022-10-16 23:17 UTC (permalink / raw)
  To: Fredrik Salomonsson; +Cc: help-guix

Hi Fredrik,

On Sun, Oct 16, 2022 at 2:47 PM Fredrik Salomonsson <plattfot@posteo.net> wrote:
>
> I can manually mount it.

Can you mount it manually using your entry in /etc/fstab, i.e. with
'noauto' and then just

    mount /media/Valhalla      ?

I am not sure whether (mount? #f) sets 'noauto'.

That would confirm that your fstab entry is working.

Kind regards
Felix Lechner


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

* Re: Trouble with nfs mount
  2022-10-16 23:17 ` Felix Lechner via
@ 2022-10-17  1:08   ` Fredrik Salomonsson
  2022-10-17  1:18     ` Felix Lechner via
  0 siblings, 1 reply; 9+ messages in thread
From: Fredrik Salomonsson @ 2022-10-17  1:08 UTC (permalink / raw)
  To: Felix Lechner; +Cc: help-guix


Hi Felix,

Felix Lechner <felix.lechner@lease-up.com> writes:

> Hi Fredrik,
>
> On Sun, Oct 16, 2022 at 2:47 PM Fredrik Salomonsson <plattfot@posteo.net> wrote:
>>
>> I can manually mount it.
>
> Can you mount it manually using your entry in /etc/fstab, i.e. with
> 'noauto' and then just
>
>     mount /media/Valhalla      ?
>
> I am not sure whether (mount? #f) sets 'noauto'.
>
> That would confirm that your fstab entry is working.

Sorry I didn't express myself that clearly. What I meant with manually
mount it was indeed using the entry in the /etc/fstab, i.e:

  mount /media/Valhalla

So the fstab entry is working. I didn't set 'noauto' though, but it
doesn't auto mount. Which I guess means that noauto is implicitly set.

-- 
s/Fred[re]+i[ck]+/Fredrik/g


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

* Re: Trouble with nfs mount
  2022-10-17  1:08   ` Fredrik Salomonsson
@ 2022-10-17  1:18     ` Felix Lechner via
  2022-10-17 16:37       ` Fredrik Salomonsson
  2022-10-17 16:50       ` Remco
  0 siblings, 2 replies; 9+ messages in thread
From: Felix Lechner via @ 2022-10-17  1:18 UTC (permalink / raw)
  To: Fredrik Salomonsson; +Cc: help-guix

Hi Fredrik,

On Sun, Oct 16, 2022 at 6:08 PM Fredrik Salomonsson <plattfot@posteo.net> wrote:
>
> it was indeed using the entry in the /etc/fstab, i.e:

That's good! My guess is that the Shepherd service is not working
correctly, for example by not requiring networking. I might ask over
there.

Sorry I cannot be of more help. I currently also mount all my NFS
volumes manually, and would like to do it automatically, too.

Kind regards
Felix Lechner


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

* Re: Trouble with nfs mount
  2022-10-16 21:46 Trouble with nfs mount Fredrik Salomonsson
  2022-10-16 23:17 ` Felix Lechner via
@ 2022-10-17  1:46 ` Maxim Cournoyer
  2022-10-17 16:49   ` Fredrik Salomonsson
  1 sibling, 1 reply; 9+ messages in thread
From: Maxim Cournoyer @ 2022-10-17  1:46 UTC (permalink / raw)
  To: Fredrik Salomonsson; +Cc: help-guix

Hi,

Fredrik Salomonsson <plattfot@posteo.net> writes:

[...]

> ---✂----------------------------------------------------------------------------
> …
> shepherd: Evaluating user expression (and (defined? (quote transient?)) (map (# ?) ?)).
> guix system: warning: exception caught while executing 'start' on service 'file-system-/media/Valhalla':
> In procedure mount: mount "fafner:/srv/nfs4/Valhalla" on "///media/Valhalla": Invalid argument
> guix system: warning: some services could not be upgraded
> …
> --------------------------------------------------------------------------------
>
> So that's probably what's happening during boot.
>
> I have no idea how it transforms the mount-point from "/media/Valhalla"
> to "///media/Valhalla" and if that's a red herring.
>
> Any ideas what I'm doing wrong?

Nothing; mounting an NFS file system at boot is not supported currently
with Guix System; see the related issue #47706.

My current ugly workaround is to define the mount points with "(mount?
#f)" and mount them via a script post boot, e.g.:

--8<---------------cut here---------------start------------->8---
(file-system
  (device "jami-buildmachine-04:/srv/nfs/jami")
  (mount-point "/var/cache/jami")
  (create-mount-point? #t)
  (type "nfs")
  (mount? #f)
  (options "soft,user"))
--8<---------------cut here---------------end--------------->8---

-- 
Thanks,
Maxim


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

* Re: Trouble with nfs mount
  2022-10-17  1:18     ` Felix Lechner via
@ 2022-10-17 16:37       ` Fredrik Salomonsson
  2022-10-17 16:50       ` Remco
  1 sibling, 0 replies; 9+ messages in thread
From: Fredrik Salomonsson @ 2022-10-17 16:37 UTC (permalink / raw)
  To: Felix Lechner; +Cc: help-guix

Hi,

Felix Lechner <felix.lechner@lease-up.com> writes:

> Hi Fredrik,
>
> On Sun, Oct 16, 2022 at 6:08 PM Fredrik Salomonsson <plattfot@posteo.net> wrote:
>>
>> it was indeed using the entry in the /etc/fstab, i.e:
>
> That's good! My guess is that the Shepherd service is not working
> correctly, for example by not requiring networking. I might ask over
> there.
>
> Sorry I cannot be of more help. I currently also mount all my NFS
> volumes manually, and would like to do it automatically, too.

No worries, looks like it's not supported at the moment.

-- 
s/Fred[re]+i[ck]+/Fredrik/g


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

* Re: Trouble with nfs mount
  2022-10-17  1:46 ` Maxim Cournoyer
@ 2022-10-17 16:49   ` Fredrik Salomonsson
  0 siblings, 0 replies; 9+ messages in thread
From: Fredrik Salomonsson @ 2022-10-17 16:49 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: help-guix

Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> Hi,
>
> Fredrik Salomonsson <plattfot@posteo.net> writes:
>
> [...]
>
>> ---✂----------------------------------------------------------------------------
>> …
>> shepherd: Evaluating user expression (and (defined? (quote transient?)) (map (# ?) ?)).
>> guix system: warning: exception caught while executing 'start' on service 'file-system-/media/Valhalla':
>> In procedure mount: mount "fafner:/srv/nfs4/Valhalla" on "///media/Valhalla": Invalid argument
>> guix system: warning: some services could not be upgraded
>> …
>> --------------------------------------------------------------------------------
>>
>> So that's probably what's happening during boot.
>>
>> I have no idea how it transforms the mount-point from "/media/Valhalla"
>> to "///media/Valhalla" and if that's a red herring.
>>
>> Any ideas what I'm doing wrong?
>
> Nothing; mounting an NFS file system at boot is not supported currently
> with Guix System; see the related issue #47706.

Ah, ok. Thanks for the info.

> My current ugly workaround is to define the mount points with "(mount?
> #f)" and mount them via a script post boot, e.g.:
>
> --8<---------------cut here---------------start------------->8---
> (file-system
>   (device "jami-buildmachine-04:/srv/nfs/jami")
>   (mount-point "/var/cache/jami")
>   (create-mount-point? #t)
>   (type "nfs")
>   (mount? #f)
>   (options "soft,user"))
> --8<---------------cut here---------------end--------------->8---

Yeah, I think I'll just add a shepherd service to my home configuration
that mounts and unmounts my NFS device until this is resolved.

-- 
s/Fred[re]+i[ck]+/Fredrik/g


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

* Re: Trouble with nfs mount
  2022-10-17  1:18     ` Felix Lechner via
  2022-10-17 16:37       ` Fredrik Salomonsson
@ 2022-10-17 16:50       ` Remco
  2022-10-23 20:39         ` Fredrik Salomonsson
  1 sibling, 1 reply; 9+ messages in thread
From: Remco @ 2022-10-17 16:50 UTC (permalink / raw)
  To: Felix Lechner, Fredrik Salomonsson; +Cc: help-guix

Autofs works pretty well for me. Using the stock package and a service like described here:

  https://www.rohleder.de/2020/07/04/autofs/

Cheers,
Remco


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

* Re: Trouble with nfs mount
  2022-10-17 16:50       ` Remco
@ 2022-10-23 20:39         ` Fredrik Salomonsson
  0 siblings, 0 replies; 9+ messages in thread
From: Fredrik Salomonsson @ 2022-10-23 20:39 UTC (permalink / raw)
  To: Remco, Felix Lechner; +Cc: help-guix

Hi Remco,

Remco <remco@remworks.net> writes:

> Autofs works pretty well for me. Using the stock package and a service like described here:
>
>   https://www.rohleder.de/2020/07/04/autofs/

Thanks for pointing out Autofs. I did not know about it before and
indeed it works quite well for this. I based mine of what described in
the link, here's what I ended up with:

---✂----------------------------------------------------------------------------
(define (automount-shepherd-service config)
  (list (shepherd-service
         (provision '(automount))
         (documentation "Run the automount server.")
         (requirement '(networking))
         (start #~(make-forkexec-constructor
                   (list #$(file-append autofs "/sbin/automount") "-f")
                   #:log-file "/var/log/automount.log"))
         (stop #~(make-kill-destructor)))))

(define automount-service-type
  (service-type
   (name 'automount)
   (description "Run the automount server.")
   (extensions
    (list (service-extension shepherd-root-service-type
                             automount-shepherd-service)
          (service-extension rottlog-service-type
                             (const
                              (list (log-rotation
                                     (files (list "/var/log/automount.log"))))))
          (service-extension etc-service-type
                        (lambda (config)
                          `(("autofs.conf" ,(plain-file "autofs.conf" ""))
                            ("auto.master" ,(plain-file "auto.master" "\
/media  /etc/autofs/auto.valhalla  --timeout 60
"))
                            ("autofs/auto.valhalla" ,(plain-file "auto.valhalla" "\
Valhalla  -rw,soft  fafner:/srv/nfs4/Valhalla
")))))))
   (default-value '())))
--------------------------------------------------------------------------------

-- 
s/Fred[re]+i[ck]+/Fredrik/g


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

end of thread, other threads:[~2022-10-24  6:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-16 21:46 Trouble with nfs mount Fredrik Salomonsson
2022-10-16 23:17 ` Felix Lechner via
2022-10-17  1:08   ` Fredrik Salomonsson
2022-10-17  1:18     ` Felix Lechner via
2022-10-17 16:37       ` Fredrik Salomonsson
2022-10-17 16:50       ` Remco
2022-10-23 20:39         ` Fredrik Salomonsson
2022-10-17  1:46 ` Maxim Cournoyer
2022-10-17 16:49   ` Fredrik Salomonsson

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