You are not logged in.

#1 2013-07-29 12:02:12

infoslaw
Member
From: Poland, Warsaw
Registered: 2013-05-06
Posts: 158

[solved] how to set up in Syslinux LUKS encrypted root to run system?

Hi,
I'm just wondering if somebody can share experience about LUKS encrypted root in syslinux to password request before run system.

I have two partitions:

sda1 - boot
sda2 - root LUKS password encrypted

I added in /etc/mkinitcpio.conf

in line:
HOOKS="(base udev) ... encrypt ... filesystems ..."

then generated initramfs:
mkinitcpio -p linux

installed and configured bootloader:
pacman -S syslinux

edited syslinux config:
nano /boot/syslinux/syslinux.cfg

where:
LABEL Arch
   MENU LABEL Arch Linux
   LINUX ../vmlinuz-linux
   APPEND root=/dev/mapper/cryptroot cryptdevice=/dev/sda2:cryptroot ro
   INITRD ../initramfs-linux.im

Syslinux running OK but can't find encrypted device and give me password request

Have afraid that missing something. Could you help me please? Thank you.

Last edited by infoslaw (2013-07-31 12:33:20)

Offline

#2 2013-07-29 14:08:27

infoslaw
Member
From: Poland, Warsaw
Registered: 2013-05-06
Posts: 158

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

whenever running Syslinux hook [encrypt]....

Waiting 10 seconds for device /dev/mapper/cryptroot
ERROR: device '/dev/mapper/cryptroot' not found. Skipping fsck.
ERROR: Unable to find root device 'dev/mapper/cryptroot'.
Tou are being dropped to a recovery shell
Type 'exit' to try and continue booting
sh: can't access tty; job control turned off
[rootfs /]#


Any idea?

Last edited by infoslaw (2013-07-29 14:08:45)

Offline

#3 2013-07-29 17:22:45

Gregosky
Member
From: UK
Registered: 2013-07-26
Posts: 179

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

So during boot do you get password prompt or not?

Offline

#4 2013-07-29 17:39:20

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

infoslaw wrote:

...
HOOKS="(base udev) ... encrypt ... filesystems ..."
....
   INITRD ../initramfs-linux.im

You are missing a "g" at the end of ".img". Additionally please post your HOOK line exactly like your config. The one up there is a 1:1 copy from the abbreviated wiki example.

Offline

#5 2013-07-29 18:03:35

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

Not an Installation issue. moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2013-07-29 21:12:38

infoslaw
Member
From: Poland, Warsaw
Registered: 2013-05-06
Posts: 158

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

Gregosky wrote:

So during boot do you get password prompt or not?

Unfortunately no password at prompt.

Offline

#7 2013-07-29 21:16:50

infoslaw
Member
From: Poland, Warsaw
Registered: 2013-05-06
Posts: 158

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

Strike0 wrote:
infoslaw wrote:

...
HOOKS="(base udev) ... encrypt ... filesystems ..."
....
   INITRD ../initramfs-linux.im

You are missing a "g" at the end of ".img". Additionally please post your HOOK line exactly like your config. The one up there is a 1:1 copy from the abbreviated wiki example.


Strike0 sorry my mistake just type from finger. of course it is initramfs-linux.img

Offline

#8 2013-07-29 21:20:36

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

Please paste your entire syslinux.cfg and mkinitcpio.conf files.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2013-07-29 21:55:31

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

Typos happen. To do what jasonwryan asks, you can boot from a system with network (e.g. the Arch live-iso), unlock and mount /dev/sda2 (see wiki), and paste the conf files like this

 curl -F 'sprunge=@-' http://sprunge.us </mnt/etc/mkinitcpio.conf

or, without network, copy them around to where they are accessible to post.

Offline

#10 2013-07-30 12:16:30

infoslaw
Member
From: Poland, Warsaw
Registered: 2013-05-06
Posts: 158

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

sorry guys I wiped hard disk last night on test machine
I trying to find best solution to encrypt personal data (/home) before deploying on "live" machine. I highly appreciate if you can recommend something for me.

Offline

#11 2013-07-30 16:20:57

weirddan455
Member
Registered: 2012-04-15
Posts: 209

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

You can use LUKS to my encrypt /home if it's a seperate partition (and you won't have to mess with your mkinitcpio.conf if root is unencrypted.) There are other solutions that may be able to encrypt /home even if it shares a partition with root. eCryptfs comes to mind but I've never used it so I'll leave you to search the wiki if that's what you need.

Offline

#12 2013-07-31 01:31:00

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,144

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

Depending on your concerns, encrypting /home may or may not be enough. If you don't use swap, you don't need to worry about encrypting that but there will still be some data in log files etc.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#13 2013-07-31 12:34:42

infoslaw
Member
From: Poland, Warsaw
Registered: 2013-05-06
Posts: 158

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

I choose LUKS on /home sda4. Thank you very much for your help.

Offline

#14 2013-09-25 09:35:42

Amanda S
Member
Registered: 2013-09-21
Posts: 276
Website

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

I think I'm close to discovering how to encrypt everything except /boot. I'll get back in a few hours. Also https://gist.github.com/sch1zo/5653983/ … ch_base.sh

EDIT: Oh, you solved your issue already. Sorry.

Last edited by Amanda S (2013-09-25 09:36:35)


If it ain't broke, you haven't tweaked it enough...

Offline

#15 2014-12-02 17:29:28

crs
Member
From: Boulder, CO
Registered: 2014-03-10
Posts: 9

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

this worked for me:

* add "encrypt" to HOOKS in /etc/mkinitcpio.conf
  run "mkinitcpio -p linux"

* Change the APPEND line in /boot/syslinux/syslinux.cfg to
  APPEND cryptdevice=/dev/sda1:rootfs root=/dev/mapper/rootfs rw

Offline

#16 2014-12-02 17:32:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [solved] how to set up in Syslinux LUKS encrypted root to run system?

Please don't necrobump, especially solved threads. The information you posted is in the wiki.
https://wiki.archlinux.org/index.php/Fo … Bumping.27



Closing


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB