unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31889: Filesystems must not depend on device mappings?
@ 2018-06-18 21:11 Taylan Ulrich Bayırlı/Kammer
  2018-06-20 21:17 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2018-06-18 21:11 UTC (permalink / raw)
  To: 31889

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

If in my OS config I define some luks mappings, and define the
corresponding filesystems with dependencies on the mapped devices,
I get an error on 'guix system reconfigure'.

Example:

  (operating-system
    ...
    (mapped-devices
      (list (mapped-device ... (target "root"))))
    (file-systems
      (list (file-system (mount-point "/")
                         ...
                         (dependencies mapped-devices))))
    ...)

This will yield an error like:

  file-system-/ depends on device-mapping-root, which is not
  provided by any service

Funnily enough, one only needs to remove the 'dependencies' field to
make it work.  But this contradicts the example at:

https://www.gnu.org/software/guix/manual/html_node/Using-the-Configuration-System.html


Taylan

[-- Attachment #2: Type: text/html, Size: 1098 bytes --]

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

* bug#31889: Filesystems must not depend on device mappings?
  2018-06-18 21:11 bug#31889: Filesystems must not depend on device mappings? Taylan Ulrich Bayırlı/Kammer
@ 2018-06-20 21:17 ` Ludovic Courtès
  2018-06-21 18:44   ` Taylan Kammer
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2018-06-20 21:17 UTC (permalink / raw)
  To: Taylan Ulrich Bayırlı/Kammer; +Cc: 31889

Hi!

Taylan Ulrich "Bayırlı/Kammer" <taylanbayirli@gmail.com> skribis:

> If in my OS config I define some luks mappings, and define the
> corresponding filesystems with dependencies on the mapped devices,
> I get an error on 'guix system reconfigure'.
>
> Example:
>
>   (operating-system
>     ...
>     (mapped-devices
>       (list (mapped-device ... (target "root"))))
>     (file-systems
>       (list (file-system (mount-point "/")
>                          ...
>                          (dependencies mapped-devices))))
>     ...)
>
> This will yield an error like:
>
>   file-system-/ depends on device-mapping-root, which is not
>   provided by any service

Could you show the complete ‘mapped-devices’ and ‘file-systems’ fields,
without ellipses?

The message above suggests that “/” was not considered as
needed-for-boot.

Thanks,
Ludo’.

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

* bug#31889: Filesystems must not depend on device mappings?
  2018-06-20 21:17 ` Ludovic Courtès
@ 2018-06-21 18:44   ` Taylan Kammer
  2018-06-21 21:55     ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Taylan Kammer @ 2018-06-21 18:44 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 31889

ludo@gnu.org (Ludovic Courtès) writes:

> Hi!
>
> Taylan Ulrich "Bayırlı/Kammer" <taylanbayirli@gmail.com> skribis:
>
>> If in my OS config I define some luks mappings, and define the
>> corresponding filesystems with dependencies on the mapped devices,
>> I get an error on 'guix system reconfigure'.
>>
>> Example:
>>
>>   (operating-system
>>     ...
>>     (mapped-devices
>>       (list (mapped-device ... (target "root"))))
>>     (file-systems
>>       (list (file-system (mount-point "/")
>>                          ...
>>                          (dependencies mapped-devices))))
>>     ...)
>>
>> This will yield an error like:
>>
>>   file-system-/ depends on device-mapping-root, which is not
>>   provided by any service
>
> Could you show the complete ‘mapped-devices’ and ‘file-systems’ fields,
> without ellipses?
>
> The message above suggests that “/” was not considered as
> needed-for-boot.
>
> Thanks,
> Ludo’.

Sorry, looks like my example was wrong.  Here is a problematic OS
declaration:

    (operating-system
     (host-name "guixsd")
     (timezone "Europe/Berlin")
     (locale "en_US.utf8")
     
     (bootloader
      (bootloader-configuration
       (bootloader grub-bootloader)
       (target "/dev/sda")))
     
     (mapped-devices
      (list (mapped-device
             (source (uuid "b3d059f8-1c4f-4569-88dd-5485825b4373"))
             (target "guixsd")
             (type luks-device-mapping))
            (mapped-device
             (source (uuid "550d9258-bbbb-488c-af27-6b1fefa190ee"))
             (target "home")
             (type luks-device-mapping))))
     
     (file-systems
      (append
       (list (file-system
              (device "/dev/mapper/guixsd")
              (mount-point "/")
              (type "ext4")
              (dependencies mapped-devices))
             (file-system
              (device "/dev/mapper/home")
              (mount-point "/home")
              (type "ext4")
              (dependencies mapped-devices)))
       %base-file-systems))
     
     (users
      (append
       (list (user-account
              (name "taylan")
              (comment "Taylan Kammer")
              (group "users")
              (supplementary-groups '("wheel" "netdev" "audio" "video"))
              (home-directory "/home/taylan")))
       %base-user-accounts))
     
     (packages %base-packages)
     (services %desktop-services)
     
     ;; Allow resolution of '.local' host names with mDNS.
     (name-service-switch %mdns-host-lookup-nss))

It results in the error message:

    guix system: error: service 'file-system-/home' requires
    'device-mapping-home', which is not provided by any service

(I also got that for '/' rather than '/home' at some point, but can't
remember under what conditions.)

It works when both '(dependencies mapped-devices)' clauses are simply
removed.

All in all I can't really figure out the logic behind the whole thing
and what exactly is expected.  I think the error reporting and relevant
section of the documentation may need some improvement.

Taylan

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

* bug#31889: Filesystems must not depend on device mappings?
  2018-06-21 18:44   ` Taylan Kammer
@ 2018-06-21 21:55     ` Ludovic Courtès
  2018-06-22 18:21       ` Taylan Kammer
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2018-06-21 21:55 UTC (permalink / raw)
  To: Taylan Kammer; +Cc: 31889-done

Hi,

Taylan Kammer <taylanbayirli@gmail.com> skribis:

>      (mapped-devices
>       (list (mapped-device
>              (source (uuid "b3d059f8-1c4f-4569-88dd-5485825b4373"))
>              (target "guixsd")
>              (type luks-device-mapping))
>             (mapped-device
>              (source (uuid "550d9258-bbbb-488c-af27-6b1fefa190ee"))
>              (target "home")
>              (type luks-device-mapping))))
>      
>      (file-systems
>       (append
>        (list (file-system
>               (device "/dev/mapper/guixsd")
>               (mount-point "/")
>               (type "ext4")
>               (dependencies mapped-devices))
>              (file-system
>               (device "/dev/mapper/home")
>               (mount-point "/home")
>               (type "ext4")
>               (dependencies mapped-devices)))
>        %base-file-systems))

[...]

> It results in the error message:
>
>     guix system: error: service 'file-system-/home' requires
>     'device-mapping-home', which is not provided by any service

[...]

> It works when both '(dependencies mapped-devices)' clauses are simply
> removed.

Yes, it’s “expected”: using “/dev/mapper/xyz” as the device is enough to
express the dependency.

When passing (dependencies mapped-devices), the effect was to each file
system depend on *both* mapped devices.  This leads to an inconsistency
because /dev/mapper/guixsd is “needed-for-boot” (i.e., set up from the
initrd), whereas /dev/mapper/home is not (i.e., set up as a Shepherd
service.)

The solution is to either use the /dev/mapper/xyz names in the ‘device’
field, or to specify only the relevant mapped device in ‘dependencies’.

Anyway, commit 68a58775e071d4b0e000b93ad121b6e64d161b79 fixes it by
doing exactly what this config asks for: setting up all the mapped
devices in the initrd.

Thanks,
Ludo’.

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

* bug#31889: Filesystems must not depend on device mappings?
  2018-06-21 21:55     ` Ludovic Courtès
@ 2018-06-22 18:21       ` Taylan Kammer
  0 siblings, 0 replies; 5+ messages in thread
From: Taylan Kammer @ 2018-06-22 18:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 31889-done

ludo@gnu.org (Ludovic Courtès) writes:

> Hi,
>
> Taylan Kammer <taylanbayirli@gmail.com> skribis:
>
>>      (mapped-devices
>>       (list (mapped-device
>>              (source (uuid "b3d059f8-1c4f-4569-88dd-5485825b4373"))
>>              (target "guixsd")
>>              (type luks-device-mapping))
>>             (mapped-device
>>              (source (uuid "550d9258-bbbb-488c-af27-6b1fefa190ee"))
>>              (target "home")
>>              (type luks-device-mapping))))
>>      
>>      (file-systems
>>       (append
>>        (list (file-system
>>               (device "/dev/mapper/guixsd")
>>               (mount-point "/")
>>               (type "ext4")
>>               (dependencies mapped-devices))
>>              (file-system
>>               (device "/dev/mapper/home")
>>               (mount-point "/home")
>>               (type "ext4")
>>               (dependencies mapped-devices)))
>>        %base-file-systems))
>
> [...]
>
>> It results in the error message:
>>
>>     guix system: error: service 'file-system-/home' requires
>>     'device-mapping-home', which is not provided by any service
>
> [...]
>
>> It works when both '(dependencies mapped-devices)' clauses are simply
>> removed.
>
> Yes, it’s “expected”: using “/dev/mapper/xyz” as the device is enough to
> express the dependency.
>
> When passing (dependencies mapped-devices), the effect was to each file
> system depend on *both* mapped devices.  This leads to an inconsistency
> because /dev/mapper/guixsd is “needed-for-boot” (i.e., set up from the
> initrd), whereas /dev/mapper/home is not (i.e., set up as a Shepherd
> service.)
>
> The solution is to either use the /dev/mapper/xyz names in the ‘device’
> field, or to specify only the relevant mapped device in ‘dependencies’.
>
> Anyway, commit 68a58775e071d4b0e000b93ad121b6e64d161b79 fixes it by
> doing exactly what this config asks for: setting up all the mapped
> devices in the initrd.
>
> Thanks,
> Ludo’.

Thank you for the explanation and the fix! :-)

Taylan

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

end of thread, other threads:[~2018-06-22 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-18 21:11 bug#31889: Filesystems must not depend on device mappings? Taylan Ulrich Bayırlı/Kammer
2018-06-20 21:17 ` Ludovic Courtès
2018-06-21 18:44   ` Taylan Kammer
2018-06-21 21:55     ` Ludovic Courtès
2018-06-22 18:21       ` Taylan Kammer

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