LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-20-2016, 08:35 AM   #1
SteffnJ
LQ Newbie
 
Registered: Jun 2016
Distribution: Slackware64
Posts: 5

Rep: Reputation: Disabled
Cryptsetup on LVM - with grub, on UEFI


Hi guys. The forum has been invaluable to me over the years. Anyway, just got a new laptop and would like to start encrypting the whole filesystem. I have no issues doing these things on "bios" with lilo in a Virtualbox, but when it comes to EFI and also installing grub - on first install, I just cannot seem to get it right (for now I am just playing in VirtualBox). I have spent countless hours the last couple of weeks trying to merge tutorials together with common sense and docs, without any luck and I start to get a bit desperate. Does any of you have experience from a clean Slackware install to fully encrypted fs (preferably over LVM) with grub2 on uefi hardware? Would love some information - planning on writing a blogpost on the topic once I get it running.

By these resources: README_CRYPT.TXT and README_LVM.TXT I seem to get the layout as I want ('/', '/home' and swap) over one virtual group (on /dev/sda2), And '/boot' on /dev/sda1 formatted as fat32. Running the setup works great - seemingly.

After the slackware setup, I drop back out to a shell and
Code:
chroot /mnt
before I try to install grub:
Code:
mount /dev/sda1 /boot/efi
modprobe dm-mod
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug
Sometimes I'm getting an error that /boot/grub is not readable by grub and the installation aborts, other times this seems to work. I then move onto generating an initrd
Code:
mkinitrd -c -k 4.4.13 -m ext4 -f ext4 -r /dev/cryptvg/root -C /dev/sda2 -L
After adding some changes to the config, such as 'GRUB_ENABLE_CRYPTODISK=y' and 'GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:slackluks', I have run the command
Code:
grub-mkconfig -o /boot/grub/grub.cfg
After trying reboots and several permutations of these combinations, I seem to end up with a boot error (dropping into this weird VirtualBox boot-shell?). EFI support has been activated in VirtualBox and it seems to work. Thanks for any feedback on the topic, or corrections. And forgive my ignorance if I have overlooked something obvious or something well-documented. Cheers!
Edit: Running Slackware64-current

Solved: By adding 'GRUB_ENABLE_CRYPTODISK=y' in /etc/default/grub before installing grub seems to have solved it(?). More details will come when I get more of a clue of what is going on.

Last edited by SteffnJ; 06-21-2016 at 03:05 AM.
 
Old 06-20-2016, 02:02 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Does any of you have experience from a clean Slackware install to fully encrypted fs (preferably over LVM) with grub2 on uefi hardware?
I'm missing the "...on uefi hardware" portion. Slackware fully encrypted fs on top of LVM with grub2 on a bios system, yes.
 
Old 06-20-2016, 04:05 PM   #3
bamunds
Member
 
Registered: Sep 2013
Location: Mounds View MN
Distribution: Slackware64-14.2-Multilib XDM/FVWM3
Posts: 780

Rep: Reputation: 260Reputation: 260Reputation: 260
See if you can skip the grub install and be successful with the insturctions for LVM and LUKS to a standard install with lilo. You've remembered /boot not encrypted and available with a proper intrd for lilo. What might help is to understand the differences between lilo and grub2. So first see if your installation works with simple lilo on your uefi. If not you should work out the lilo+uefi issues first. Then move on to grub2. It seems to be that alienbob has used grup with his recently released "LIVE" Slackware ISO and documented some of what GRUB is doing on https://docs.slackware.com/slackware:liveslak.

Additionally the slackbook wiki has this about GRUB2. http://may have great articles about grub.

Hopefully this helps. Cheers BrianA_MN
 
1 members found this post helpful.
Old 06-20-2016, 04:45 PM   #4
brobr
Member
 
Registered: Oct 2003
Location: uk
Distribution: Slackware
Posts: 974

Rep: Reputation: 239Reputation: 239Reputation: 239
Quote:
Originally Posted by bamunds View Post
...So first see if your installation works with simple lilo on your uefi. If not you should work out the lilo+uefi issues first.[/URL].
Hi, I hope you mean 'elilo' + uefi?? Lilo and uefi won't play together... only apart from each other; lilo uses a MBR while elilo runs the EFI-partition...
 
Old 06-20-2016, 05:06 PM   #5
bamunds
Member
 
Registered: Sep 2013
Location: Mounds View MN
Distribution: Slackware64-14.2-Multilib XDM/FVWM3
Posts: 780

Rep: Reputation: 260Reputation: 260Reputation: 260
The OP is looking for help, so I thought the best thing to do was break-down the testing to single changes from the documented processes available. Since then I've found and additional reference. http://docs.slackware.com/howtos:slackware_admin:set_up_grub_as_boot_loader_on_uefi_based_hardware?s[]=efi

Hopefully that will help the OP. Cheers, BrianA_MN
 
Old 06-20-2016, 05:29 PM   #6
brobr
Member
 
Registered: Oct 2003
Location: uk
Distribution: Slackware
Posts: 974

Rep: Reputation: 239Reputation: 239Reputation: 239
Yes, breaking down the problem is best. But as the Uefi also requires another partitioning system, it might be best to start from the uefi angle and when that works, set-up the encryption.
 
Old 06-20-2016, 08:57 PM   #7
SteffnJ
LQ Newbie
 
Registered: Jun 2016
Distribution: Slackware64
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks guys. But yeah, I think there is something along the lines of getting the bootloader to start things correctly and being installed correctly. I just downloaded the live iso and will give it a go, perhaps something reveals itself.
 
Old 06-20-2016, 10:06 PM   #8
bl0tt0
Member
 
Registered: Aug 2005
Location: The Glorious People's Republic of Austin
Posts: 178

Rep: Reputation: 62
I've been running a fully encrypted system with LVM on a LUKS partition for a few years now. Reading through your process, I think you may have missed an important step. In order to make GRUB2 aware of LUKS encrypted volumes, you actually have to set GRUB_CRYPTODISK_ENABLE=y in /etc/default/grub BEFORE running grub-install, not just prior to running grub-mkconfig. It took a bit of digging in the grub-install script and bashing my head against the wall to figure that out.

Also, a really cool feature of using LUKS with GRUB2 is that you don't even need /boot on an unencrypted partition, just the EFI partition.

Hopefully this helps you get a little further along in your path to slack
 
2 members found this post helpful.
Old 06-21-2016, 03:04 AM   #9
SteffnJ
LQ Newbie
 
Registered: Jun 2016
Distribution: Slackware64
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks bl0tt0! That seems to have done the trick! Still a few weird module loading errors and such, but some of it is because of VirtualBox, I think. I think some more throughout planning of configs will solve it. As soon as
Code:
dd if=/dev/urandom of=/dev/sda
has finished on the 1TB SSD I will go ahead and install it, somehow more confident than I was before. Will post a solution when I sort of know what's going on. In the meanwhile I will mark this as solved.
 
Old 06-21-2016, 06:26 AM   #10
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by SteffnJ View Post
As soon as
Code:
dd if=/dev/urandom of=/dev/sda
has finished on the 1TB SSD....
Be prepared for that to take quite a while. I get around 10-11 MB/s reading urandom, so for a 1TB that's going to be a good day of wait.

Unless your stuff is "super duper - they're all out to get me!- secret" then you might want to consider skipping that step. It'll still be 'secure' to all practical intents and purposes, and any difference it might make will probably be mitigated by the xkcd 538 factor.
 
1 members found this post helpful.
Old 06-21-2016, 06:33 AM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
@GazL, you must be precognitive ...
 
Old 06-21-2016, 06:58 AM   #12
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019


Just don't float me in a bath-tub and make me talk to Tom Cruise!
 
Old 06-21-2016, 12:46 PM   #13
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by GazL View Post


Just don't float me in a bath-tub and make me talk to Tom Cruise!
Well, the pre-cog didn't talk to Tom Cruise until after she was out of the tub... so there's that
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cryptsetup: lvm is not avaible BadNewbie Linux - Newbie 2 11-01-2015 04:15 PM
adding --allow-discards to cryptsetup in initrd to allow TRIM in LVM/encrypted SSD mostlyharmless Slackware 1 12-05-2013 07:51 PM
[SOLVED] lvm and cryptsetup otaviolb Linux - Newbie 5 06-17-2013 08:06 PM
[SOLVED] CURRENT: LVM/CRYPTSETUP duplicate devices in /dev/mapper again. GazL Slackware 11 01-31-2011 06:36 PM
luks cryptsetup and lvm question ruzzed Linux - Software 3 09-16-2007 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration