Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] ugrd luks swap
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
linux_os2
Apprentice
Apprentice


Joined: 29 Aug 2018
Posts: 276
Location: Zedelgem Belgium

PostPosted: Tue Apr 01, 2025 10:58 am    Post subject: [SOLVED] ugrd luks swap Reply with quote

Want to have an encryped swap partition.

Code:
config.toml:
# This config will decrypt the LUKS volume with uuid "fdf442da-0574-4531-98c7-55227a041f1d", mapping it to "/dev/mapper/root"
# It will attempt to mount the btrfs volume with label "rootfs" to /target_rootfs
# It will pull all current kernel modules from lspci -k results
# It will try to process the cmdline and mount the rootfs based on the root= parameter

modules = [
"ugrd.crypto.cryptsetup", # This is included by the gpg module
"ugrd.base.debug",
"ugrd.fs.resume" ,
"ugrd.fs.mdraid" ,
]

binaries = ['cat', 'dd', 'lsmod', 'udevadm', 'mdadm', 'cp', 'killall', 'ls', 'mkdir', 'mknod', 'mount', 'umount', 'sed', 'sleep', 'ln', 'rm', 'uname', 'readlink', 'basename', 'modprobe', 'readlink', 'basename', 'mdmon', 'udevd', 'cryptsetup']

kmod_autodetect_lspci = true

kmod_init = ["usbhid", "hid_logitech_hidpp", "hid_logitech_dj", "hid_generic", "raid0", "raid1", "raid10", "raid456"]

# If the root is a LUKS volume, specify the LUKS volume information
[cryptsetup.root]
# The UUID of the encrypted volume, mounted at /dev/mapper/root
uuid = "2152888b-67cb-4339-a2f4-680bf955c46b"
key_file = "/etc/cryptsetup-keys.d/gentoo.key"
dependencies = [ "/etc/cryptsetup-keys.d/gentoo.key" ]

# If the root is a LUKS volume, specify the LUKS volume information
[cryptsetup.swap]
# The UUID of the encrypted volume, mounted at /dev/mapper/root
uuid = "86f67200-c891-47d3-bdd4-f8e58322325d"
key_file = "/etc/cryptsetup-keys.d/gentoo.key"
dependencies = [ "/etc/cryptsetup-keys.d/gentoo.key" ]

ugrd fails with:
Code:
CRITICAL | No device mapper information found for: root

https://bpa.st/MMKA

stripped blkid:
Code:
/dev/md125p7: UUID="2152888b-67cb-4339-a2f4-680bf955c46b" TYPE="crypto_LUKS" PARTUUID="3f8de685-9ea2-9d40-abea-97d2c736c8c6"
/dev/sdg1: UUID="86f67200-c891-47d3-bdd4-f8e58322325d" TYPE="crypto_LUKS" PARTUUID="77092f13-01"


*********************************
With confif;toml:
Code:
# This config will decrypt the LUKS volume with uuid "fdf442da-0574-4531-98c7-55227a041f1d", mapping it to "/dev/mapper/root"
# It will attempt to mount the btrfs volume with label "rootfs" to /target_rootfs
# It will pull all current kernel modules from lspci -k results
# It will try to process the cmdline and mount the rootfs based on the root= parameter

modules = [
"ugrd.crypto.cryptsetup", # This is included by the gpg module
"ugrd.base.debug",
"ugrd.fs.resume" ,
"ugrd.fs.mdraid" ,
]

binaries = ['cat', 'dd', 'lsmod', 'udevadm', 'mdadm', 'cp', 'killall', 'ls', 'mkdir', 'mknod', 'mount', 'umount', 'sed', 'sleep', 'ln', 'rm', 'uname', 'readlink', 'basename', 'modprobe', 'readlink', 'basename', 'mdmon', 'udevd', 'cryptsetup']

kmod_autodetect_lspci = true

kmod_init = ["usbhid", "hid_logitech_hidpp", "hid_logitech_dj", "hid_generic", "raid0", "raid1", "raid10", "raid456"]


ugrd gives no error:

During boot grub asks for parphrase which is normal.
also for root:
want to use a key-file.
later when gentoo boots kernel swap is not found and waits 1.5 min.

System boot futher and is ok.

********
during starting with initramfs in debug-mode.
Code:
cryptsetup open /dev/sdg1 swap is done

system starts normal
and top shows the swap is present

Is more information needed?
Thanks


Last edited by linux_os2 on Tue Apr 01, 2025 2:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
linux_os2
Apprentice
Apprentice


Joined: 29 Aug 2018
Posts: 276
Location: Zedelgem Belgium

PostPosted: Tue Apr 01, 2025 2:38 pm    Post subject: Reply with quote

Found the reason.
was opening the root on gentoo:
Code:
cryptsetup open /dev/md126p7 gentoo

so /dev/mapper/gentoo was created.

Did change that to:
Code:
cryptsetup open /dev/md126p7 root
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