unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Always mount external disk
@ 2024-08-16 23:29 Caleb Herbert
  2024-08-19  9:04 ` Ignas Lapėnas
  2024-08-20 10:17 ` Marek Paśnikowski
  0 siblings, 2 replies; 3+ messages in thread
From: Caleb Herbert @ 2024-08-16 23:29 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]

Hi Guix,

I'd like to always mount my main data disk, HUSKY, to my server
Farnsworth.  However, I would like for the system to not complain if
HUSKY is not plugged in.

I presume (from discussing it in #guix) that "non-boot-file-system-
service" should be used for this task.  How do I use it?  I see no
examples or documentation in the Manual or Cookbook.

I was definitely told that this was not correct:

(file-system (mount-point "/mnt/HUSKY")
             (device (file-system-label "HUSKY"))
             (type "xfs")
             (create-mount-point? #t))

Thanks,

-- 
Caleb S. Herbert
https://bluehome.net/csh/


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 683 bytes --]

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

* Re: Always mount external disk
  2024-08-16 23:29 Always mount external disk Caleb Herbert
@ 2024-08-19  9:04 ` Ignas Lapėnas
  2024-08-20 10:17 ` Marek Paśnikowski
  1 sibling, 0 replies; 3+ messages in thread
From: Ignas Lapėnas @ 2024-08-19  9:04 UTC (permalink / raw)
  To: Caleb Herbert; +Cc: help-guix

Hi,

Best example I could find was under guix/tests/system.scm, on how maybe
the service is used. Unsure.

>  ;; Make sure that mapped devices with at least one needed-for-boot user are
>  ;; handled exclusively from the initrd.  See <https://bugs.gnu.org/31889>.
>  (append-map file-system-dependencies
>              (service-value
>               ((@@ (gnu system) non-boot-file-system-service)
>                (operating-system
>                  (inherit %os-with-mapped-device)
>                  (file-systems
>                   (list (file-system
>                           (mount-point "/foo/bar")
>                           (device "qux:baz")
>                           (type "none")
>                           (dependencies (list %luks-device)))
>                         (file-system
>                           (device (file-system-label "my-root"))
>                           (mount-point "/")
>                           (type "ext4")
>                           (dependencies (list %luks-device))))))))))

It seems that 'non-boot-file-system-service' differs from
'boot-file-system-service' with the variable 'file-system-needed-for-boot?'

> (define (non-boot-file-system-service os)
>   "Return the file system service for the file systems of OS that are not
> marked as 'needed-for-boot'."
>   (define file-systems
>     (remove file-system-needed-for-boot?
>             (operating-system-file-systems os)))

Looking at the 'file-system' definition, it seems that you could try
changing 'mount-may-fail?' to #t. It may or may not help.

> (define-record-type* <file-system> file-system
>   make-file-system
>   file-system?
>   (device                file-system-device)               ; string | <uuid> | <file-system-label>
>   (mount-point           file-system-mount-point)          ; string
>   (type                  file-system-type)                 ; string
>   (flags                 file-system-flags                 ; list of symbols
>                          (default '())
>                          (sanitize validate-file-system-flags))
>   (options               file-system-options               ; string or #f
>                          (default #f))
>   (mount?                file-system-mount?                ; Boolean
>                          (default #t))
>   (mount-may-fail?       file-system-mount-may-fail?       ; Boolean
>                          (default #f))
>   (needed-for-boot?      %file-system-needed-for-boot?     ; Boolean
>                          (default #f))
>   (check?                file-system-check?                ; Boolean
>                          (default #t))
>   (skip-check-if-clean?  file-system-skip-check-if-clean?  ; Boolean
>                          (default #t))
>   (repair                file-system-repair                ; symbol or #f
>                          (default 'preen))
>   (create-mount-point?   file-system-create-mount-point?   ; Boolean
>                          (default #f))
>   (dependencies          file-system-dependencies          ; list of <file-system>
>                          (default '()))                    ; or <mapped-device>
>   (shepherd-requirements file-system-shepherd-requirements ; list of symbols
>                          (default '()))
>   (location              file-system-location
>                          (default (current-source-location))
>                          (innate)))

Hope any of these findings might help.
Also a lot of great info could be found on guix-cookbook.
https://guix.gnu.org/en/cookbook/en/guix-cookbook.html
Sometimes I find reading the source code directly is actually much
clearer than the manual.

-- 
Best Regards,
Ignas Lapėnas


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

* Re: Always mount external disk
  2024-08-16 23:29 Always mount external disk Caleb Herbert
  2024-08-19  9:04 ` Ignas Lapėnas
@ 2024-08-20 10:17 ` Marek Paśnikowski
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Paśnikowski @ 2024-08-20 10:17 UTC (permalink / raw)
  To: help-guix

Caleb Herbert <csh@bluehome.net> writes:

> Hi Guix,
>
> I'd like to always mount my main data disk, HUSKY, to my server
> Farnsworth.  However, I would like for the system to not complain if
> HUSKY is not plugged in.
>
> I presume (from discussing it in #guix) that "non-boot-file-system-
> service" should be used for this task.  How do I use it?  I see no
> examples or documentation in the Manual or Cookbook.
>
> I was definitely told that this was not correct:
>
> (file-system (mount-point "/mnt/HUSKY")
>              (device (file-system-label "HUSKY"))
>              (type "xfs")
>              (create-mount-point? #t))
>
> Thanks,

It is in [the Manual][1]:

(file-system ...
             (mount-may-fail? #t))

Keep it simple — test first and see if it satisfies you.  Add more
options only when needed.  Software gets complicated really quickly.

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


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

end of thread, other threads:[~2024-08-20 10:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-16 23:29 Always mount external disk Caleb Herbert
2024-08-19  9:04 ` Ignas Lapėnas
2024-08-20 10:17 ` Marek Paśnikowski

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