Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ugrd reporting RuntimeError: Unknown device mapper device ty
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
vrghost
n00b
n00b


Joined: 03 Oct 2003
Posts: 52
Location: London

PostPosted: Sat Nov 16, 2024 8:31 pm    Post subject: ugrd reporting RuntimeError: Unknown device mapper device ty Reply with quote

Currently trying to move to a encrypted root fs, following this article:
https://wiki.gentoo.org/wiki/Full_Disk_Encryption_From_Scratch

So far, I have managed to create the volume, encrypt it, reboot the server using live CD, mount the encrypted volume using the key stored on the efi volume, then mounted everything, chrooted into the environment and at the stage of trying to run ugrd, but I am getting the following error message:
Code:

DEBUG    | ugrd.InitramfsGenerator                    | [root] Device mapper info: {'major': '253', 'minor': '0', 'holders': [], 'slaves': ['nvme0n1p7'], 'uuid': 'CRYP
T-LUKS2-2713385e5e674394964d3814c52a425f-root', 'name': 'root'}
Device config: {'partuuid': '327a9d8a-1990-4ae7-b6b9-0145dd51fb03'}
INFO     | ugrd                                       | Dumping config dict:

ERROR    | ugrd                                       | Unknown device mapper device type: None
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/ugrd/main.py", line 66, in main
    generator.build()
  File "/usr/lib/python3.12/site-packages/ugrd/initramfs_generator.py", line 76, in build
    self.run_build()
  File "/usr/lib/python3.12/site-packages/ugrd/initramfs_generator.py", line 207, in run_build
    self.run_hook(task, force_exclude=True)
  File "/usr/lib/python3.12/site-packages/ugrd/initramfs_generator.py", line 126, in run_hook
    if function_output := self.run_func(function, *args, **kwargs):
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/ugrd/initramfs_generator.py", line 92, in run_func
    if function_output := function(self):
                          ^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/zenlib/util/dict_check.py", line 31, in _contains
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/zenlib/util/dict_check.py", line 31, in _contains
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/ugrd/fs/mounts.py", line 415, in autodetect_root_dm
    _autodetect_dm(self, '/')
  File "/usr/lib/python3.12/site-packages/zenlib/util/dict_check.py", line 31, in _contains
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/ugrd/fs/mounts.py", line 382, in _autodetect_dm
    raise RuntimeError("Unknown device mapper device type: %s" % blkid_info.get('type'))
RuntimeError: Unknown device mapper device type: None


Full debug log can be found at
https://bpa.st/HXNQ

And the config.toml
/etc/ugrd/config.toml


Looking at blkid
Code:

/dev/sda3: BLOCK_SIZE="2048" LABEL="Gentoo-amd64-20241103" TYPE="hfsplus" PARTLABEL="HFSPLUS" PARTUUID="f2196140-2caf-4dc9-95d2-d046c3259d84"
/dev/nvme0n1p5: UUID="5b60094d-fadd-4116-954b-8544ee0e7280" BLOCK_SIZE="512" TYPE="xfs" PARTUUID="5bb7f630-99aa-4de1-b0ce-82caf81ca76e"
/dev/nvme0n1p3: BLOCK_SIZE="512" UUID="4E42EFAC42EF974D" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="b2c07de3-3012-425f-9691-1e249ef480c8"
/dev/nvme0n1p1: UUID="6EA6-1714" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="28907a67-617d-44e7-92b3-ec2627aab188"
/dev/nvme0n1p6: UUID="254ea3a9-0131-465d-bf89-7def5aa063e2" TYPE="swap" PARTUUID="cbb85061-5429-49f3-98f6-2a724a4f8767"
/dev/nvme0n1p4: BLOCK_SIZE="512" UUID="78D493E8D493A742" TYPE="ntfs" PARTUUID="4d23f5b8-743c-40a2-beb1-4a4f8a9a271b"
/dev/loop0: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/mapper/root: LABEL="rootfs" UUID="f84e336d-06d5-4eba-9278-330861fb604b" UUID_SUB="3ab52124-63e3-41ea-b0ce-63e184fb90b7" BLOCK_SIZE="4096" TYPE="btrfs"
/dev/sda2: SEC_TYPE="msdos" UUID="4B0E-13DB" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI boot partition" PARTUUID="f2196140-2caf-4dc9-95d3-d046c3259d84"
/dev/nvme0n1p7: PARTUUID="327a9d8a-1990-4ae7-b6b9-0145dd51fb03"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="406656e7-33e7-4955-bc66-5c47eb17a002"
/dev/sda4: PARTLABEL="Gap1" PARTUUID="f2196140-2caf-4dc9-95d5-d046c3259d84"
/dev/sda1: PARTLABEL="Gap0" PARTUUID="f2196140-2caf-4dc9-95d0-d046c3259d8


/dev/nvme0n1p7 does not have a type; this is where the encrypted data for /dev/mapper/root is; not certain if that is the issue, but should it have a type, or is used looking at the wrong device?
Back to top
View user's profile Send private message
zen_desu
n00b
n00b


Joined: 25 Oct 2024
Posts: 17

PostPosted: Sat Nov 16, 2024 10:22 pm    Post subject: Reply with quote

Can you share your config?

blkid won't be able to detect the device type if the LUKS headers are detached.

If you have detached headers, you must define that in the config, and the name for the cryptsetup entry should match the name it's opened/mapped to.

Here's an example for detached headers:

https://github.com/desultory/ugrd/blob/main/examples/detached_headers.toml

You can define the mountpoint used for the external storage which contains the header file under auto_mounts.
_________________
µgRD dev
Wiki writer
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum