Unable to use UUIDs to construct RAID array in mapped-devices

  • Open
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Csepp
  • Lars Rustand
Owner
unassigned
Submitted by
Lars Rustand
Severity
normal
L
L
Lars Rustand wrote on 15 Sep 2023 20:27
(address . bug-guix@gnu.org)
xxlwcsoh7rear4uvg4ual2rylwothzbmgnyr5vwuyxdw6wu67b@wpoyabx34qfl
Setting up a RAID array using UUIDs does not work.

The following mapped-devices block works:

(mapped-devices
(list
(mapped-device
(source (list "/dev/nvme0n1p2" "/dev/nvme1n1p3"))
(target "/dev/md0")
(type raid-device-mapping))))

But this one fails:

(mapped-devices
(list
(mapped-device
(source (list (uuid "a07c54da-eb61-4135-86b8-8791e863e46a") (uuid "c40026af-ace9-47fc-9d3f-4b8d6a2219cb")))
(target "/dev/md0")
(type raid-device-mapping))))

The error message I get is guix system: error: #<<uuid> type: dce bv: #vu8(160 124 84 218 235 97 65 53 134 184 135 145 232 99 228 106)>: invalid G-expression input
-----BEGIN PGP SIGNATURE-----

iQGzBAABCAAdFiEEiiCJ+2D6IxEwRlF4Aitf/nru9hkFAmUEohQACgkQAitf/nru
9hndYAv+K++5gyBVDwyxMdPySk2WBQUGpdgCe/GC0CPtDcWXSNFUwrl5pgziFQC2
I6fMlItg09yneNuVgXAHSMiit8fXVFBJtWjQQbmaTwNTcg0UVdMnollAKb/BxGWv
qH4LwXh2qnTuLXr1xh0wEuAXE3mKjnvF0UESs33iws6k5qBTufd4K5j/hXnnylOc
UYq+aDfEA1GjnHk00qJVSFg2JdVXcGPafXU5vjq828LdTqz5ltayQRpocMO9wcBI
4J2g36zYvnILLGGI8ZbSu5aXX4fTP+wf746uEcc2ionbKO2g1zfFNigwsilYt1CC
cFB+EBMS78iP72MP/VKFELhpFBucClJH2OhgWN+n9J/NNq91fVLvFgY5s3V1jR/Y
mQwMcoNXL6s043TosXvZFH+dI5tz9UvpN8L4v4ztuzpUex8tSr1EhJzkSFFz1pPB
wvBzyE3yM+U4mXXtmR39++tIJe3Z8k2RgH8wD6OaxkDz+V73J8V1GTzQdDpEcT7J
GSy1VMZh
=IFZj
-----END PGP SIGNATURE-----


C
(name . Lars Rustand)(address . rustand.lars@gmail.com)
cuc1qevpt05.fsf@riseup.net
Lars Rustand <rustand.lars@gmail.com> writes:

Toggle quote (25 lines)
> [[PGP Signed Part:Undecided]]
> Setting up a RAID array using UUIDs does not work.
>
> The following mapped-devices block works:
>
> (mapped-devices
> (list
> (mapped-device
> (source (list "/dev/nvme0n1p2" "/dev/nvme1n1p3"))
> (target "/dev/md0")
> (type raid-device-mapping))))
>
> But this one fails:
>
> (mapped-devices
> (list
> (mapped-device
> (source (list (uuid "a07c54da-eb61-4135-86b8-8791e863e46a") (uuid "c40026af-ace9-47fc-9d3f-4b8d6a2219cb")))
> (target "/dev/md0")
> (type raid-device-mapping))))
>
> The error message I get is guix system: error: #<<uuid> type: dce bv: #vu8(160 124 84 218 235 97 65 53 134 184 135 145 232 99 228 106)>: invalid G-expression input
>
> [[End of PGP Signed Part]]

Would it be possible to use /dev/disk/by-uuid paths instead of uuid
objects for these? I think this big "typeof" based dynamic dispatch
that we're using in Scheme is erm, not very robust, to put it mildly.
L
L
Ludovic Courtès wrote on 18 Sep 2023 23:47
(name . Csepp)(address . raingloom@riseup.net)
87ttrrf929.fsf@gnu.org
Hi,

Csepp <raingloom@riseup.net> skribis:

Toggle quote (2 lines)
> Lars Rustand <rustand.lars@gmail.com> writes:

[...]

Toggle quote (16 lines)
>> But this one fails:
>>
>> (mapped-devices
>> (list
>> (mapped-device
>> (source (list (uuid "a07c54da-eb61-4135-86b8-8791e863e46a") (uuid "c40026af-ace9-47fc-9d3f-4b8d6a2219cb")))
>> (target "/dev/md0")
>> (type raid-device-mapping))))
>>
>> The error message I get is guix system: error: #<<uuid> type: dce bv: #vu8(160 124 84 218 235 97 65 53 134 184 135 145 232 99 228 106)>: invalid G-expression input
>>
>> [[End of PGP Signed Part]]
>
> Would it be possible to use /dev/disk/by-uuid paths instead of uuid
> objects for these?

Depends: /dev/disk/by-uuid is populated by eudev, which is not running
at the time initrd code runs; IOW it’s OK to use /dev/disk/by-uuid if
and only if the mapped device is not “needed for boot”.

Toggle quote (3 lines)
> I think this big "typeof" based dynamic dispatch that we're using in
> Scheme is erm, not very robust, to put it mildly.

Yeah, it’s not great. What would you suggest?

Ludo’.
C
(name . Ludovic Courtès)(address . ludo@gnu.org)
cucediujuv4.fsf@riseup.net
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (35 lines)
> Hi,
>
> Csepp <raingloom@riseup.net> skribis:
>
>> Lars Rustand <rustand.lars@gmail.com> writes:
>
> [...]
>
>>> But this one fails:
>>>
>>> (mapped-devices
>>> (list
>>> (mapped-device
>>> (source (list (uuid "a07c54da-eb61-4135-86b8-8791e863e46a") (uuid "c40026af-ace9-47fc-9d3f-4b8d6a2219cb")))
>>> (target "/dev/md0")
>>> (type raid-device-mapping))))
>>>
>>> The error message I get is guix system: error: #<<uuid> type: dce bv: #vu8(160 124 84 218 235 97 65 53 134 184 135 145 232 99 228 106)>: invalid G-expression input
>>>
>>> [[End of PGP Signed Part]]
>>
>> Would it be possible to use /dev/disk/by-uuid paths instead of uuid
>> objects for these?
>
> Depends: /dev/disk/by-uuid is populated by eudev, which is not running
> at the time initrd code runs; IOW it’s OK to use /dev/disk/by-uuid if
> and only if the mapped device is not “needed for boot”.
>
>> I think this big "typeof" based dynamic dispatch that we're using in
>> Scheme is erm, not very robust, to put it mildly.
>
> Yeah, it’s not great. What would you suggest?
>
> Ludo’.

I guess MyPy-for-Guile is a bit out of scope for now, so the next best
way to catch these would be property based testing.
As for implementing them, can't we use Guile's generics, or model
something on Clojure's generics? Something that lets client code add
implementations to an interface. Although that might have some security
implications.
?