unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: zimoun <zimon.toutoune@gmail.com>
Cc: contact.ng0@cryptolab.net, 25937-done@debbugs.gnu.org
Subject: bug#25937: luks mapped-devices does not support multiple mapped-devices
Date: Tue, 17 Aug 2021 23:02:11 -0400	[thread overview]
Message-ID: <871r6rxxos.fsf_-_@gmail.com> (raw)
In-Reply-To: <CAJ3okZ3Wn1q5qqHjyWWgXqA4etJJU20okW8kc07L9epcg7v8Wg@mail.gmail.com> (zimoun's message of "Sun, 3 May 2020 18:39:39 +0200")

Hello,

zimoun <zimon.toutoune@gmail.com> writes:

> Dear,
>
> Digging in the bug tracker, I found this bug report [1]. What is its status?
> Is it solved for you?
>
> Best regards,
> simon
>
> [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25937

Recopying the content here for ease of reference:

> upon trying to create a system with multiple mapped-devices the
> current documentation about mapped-devices doesn't help me anymore.

> So far I'm just trying with two luks devices, I'll get RAID in there as
> a third device later.
> So this part in a config.scm:

>   (mapped-devices
>    (list (mapped-device
>           (source (uuid "fooooo1233333333333333333"))
>           (target "my-root")
>           (type luks-device-mapping))
>          (mapped-device
>            (source (uuid "fooooo124444444444444444"))
>            (target "dg2")
>            (type luks-device-mapping))))

>   (file-systems (cons* (file-system
>                         (device "my-root")
>                         (title 'label)
>                         (mount-point "/")
>                         (type "ext4")
>                         (dependencies mapped-devices))
>                       (file-system
>                         (device "/dev/sdb1")
>                         (title 'device)
>                         (mount-point "/mnt/dg1")
>                         (type "ext4"))
>                       (file-system
>                         (device "dg2")
>                         (title 'label)
>                         (mount-point "/mnt/dg2")
>                         (type "ext4")
>                         (dependencies mapped-devices))
>                       %base-file-systems))
>
> ...fails with this error:

> address@hidden ~$ guix system build /etc/config.scm

> guix system: error: service 'file-system-/mnt/dg2' requires
> 'device-mapping-my-root', which is not provided by any service

> How do I fix this?

From info "(guix)File Systems":

     When the source of a file system is a mapped device (*note
     Mapped Devices::), its ‘device’ field _must_ refer to the
     mapped device name—e.g., ‘"/dev/mapper/root-partition"’.  This
     is required so that the system knows that mounting the file
     system depends on having the corresponding device mapping
     established.

So it seems that you must provide "/dev/mapper/my-root" instead of
referring to it by label.  Although, I was able to reconfigure with the
following mapped devices/file systems:

--8<---------------cut here---------------start------------->8---
    (mapped-devices
     (list (mapped-device
            (source (uuid "0792432c-78d8-4dcc-87c5-30200c3d02db");"/dev/sda2"
                    )
            (target "cryptroot")
            (type luks-device-mapping))
           (mapped-device
            (source (uuid "a9aead40-9d01-4f7a-bb83-be70dd192b7b");"/dev/sdb2"
                    )
            (target "cryptroot-mirror")
            (type luks-device-mapping))
           (mapped-device
            (source (uuid "f0afd5c9-da70-46a7-9c6f-5d22913638bf");"/dev/sdc2"
                    )
            (target "cryptroot-mirror2")
            (type luks-device-mapping))))

    ;; Note: Using any of the LUKS encrypted drives exposed under
    ;; /dev/mapper is enough to reference the Btrfs RAID-1 array,
    ;; since the 'btrfs device scan' command is executed in the init
    ;; RAM disk and takes care of assembling the array.
    (file-systems (cons* (file-system
                           (mount-point "/")
                           (device (file-system-label "my-root"))
                           (type "btrfs")
			   (options (alist->file-system-options
                                     (cons '("subvol" . "@root")
                                           %common-btrfs-options)))
			   (dependencies mapped-devices))
                         (file-system
                           (device "/dev/mapper/cryptroot-mirror")
                           (mount-point "/home")
                           (type "btrfs")
                           (options (alist->file-system-options
                                     (cons '("subvol" . "@home")
                                           %common-btrfs-options)))
                           (dependencies mapped-devices))
                         (file-system
                           (device "/dev/mapper/cryptroot-mirror2")
                           (mount-point "/data")
                           (type "btrfs")
                           (options (alist->file-system-options
                                     (cons '("subvol" . "@data")
                                           %common-btrfs-options)))
                           (dependencies mapped-devices))
                         %base-file-systems))
--8<---------------cut here---------------end--------------->8---
                         
So perhaps that particular limitation has been lifted, or perhaps Btrfs
is different in this regard.

I'll close the bug, but feel free to reopen it if you still have
problems.

Thank you,

Maxim




      parent reply	other threads:[~2021-08-18  3:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 16:21 bug#25937: luks mapped-devices does not support multiple mapped-devices ng0
2020-05-03 16:39 ` bug#25937: Status? luks mapped-devices zimoun
2020-05-03 17:00   ` Nikita Gillmann
2021-08-18  3:02   ` Maxim Cournoyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871r6rxxos.fsf_-_@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=25937-done@debbugs.gnu.org \
    --cc=contact.ng0@cryptolab.net \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).