Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

[SOLVED] ugrd luks swap

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
linux_os2
Apprentice
Apprentice
Posts: 278
Joined: Wed Aug 29, 2018 8:00 am
Location: Zedelgem Belgium

[SOLVED] ugrd luks swap

  • Quote

Post by linux_os2 » Tue Apr 01, 2025 10:58 am

Want to have an encryped swap partition.

Code: Select all

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: Select all

CRITICAL | No device mapper information found for: root
https://bpa.st/MMKA

stripped blkid:

Code: Select all

/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: Select all

# 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: Select all

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.
Top
linux_os2
Apprentice
Apprentice
Posts: 278
Joined: Wed Aug 29, 2018 8:00 am
Location: Zedelgem Belgium

  • Quote

Post by linux_os2 » Tue Apr 01, 2025 2:38 pm

Found the reason.
was opening the root on gentoo:

Code: Select all

cryptsetup open /dev/md126p7 gentoo
so /dev/mapper/gentoo was created.

Did change that to:

Code: Select all

cryptsetup open /dev/md126p7 root
Top
Post Reply

2 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic