LMDE install with encrypted partitions or resizable volumes

Archived topics about LMDE 1 and LMDE 2
TomRoche

LMDE install with encrypted partitions or resizable volumes

Post by TomRoche »

Unfortunately the LMDE installers do not currently (as of early 2015) directly support either encrypted (with, e.g., LUKS) or resizeable (with, e.g., LVM) filesystems. This seems especially unfortunate since the Debian installer does directly support LUKS and LVM2 currently (and has for some time).

We hope the LMDE team (hallowed be thy names !-) will soon rectify this discontinuity. Meanwhile, LMDE users have a few workarounds (please let me know if more can be added) for installing LMDE with LVM2 or LUKS (and that's a Boolean "or"). In historical order (IIUC):
  1. See hashstat's manual process from this LMDE1 tutorial. Perhaps someone could check to see how it works for LMDE2, and revise as necessary? (Note initial LMDE2 releases for Cinnamon and MATE.) Again, please lemme know how that works, and I'll update this tutorial accordingly.
  2. Not long after hashstat published the above, Pepas began to automate the procedure. Because Pepa's code was not in a repository (making distribution of and collaboration on code difficult), Tom Roche put his then-current code into this project and began updating there. (Your `git` pull requests are welcome!)
  3. Pepas now has a git repo.
Again, we hope that the LMDE installer will soon support encrypted or resizing, making our workarounds redundant. That being said, ISTM that, the more we as a community can do to solve this problem, the more likely it becomes that the LMDE team will takeover maintenance.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 4 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pepas
Level 2
Level 2
Posts: 56
Joined: Mon Jan 24, 2011 10:18 am
Contact:

Re: LMDE install with encrypted partitions or resizable volu

Post by Pepas »

In my testing I've found that the script that worked well for LMDE 201403 needed some tweaks for LMDE-2 (201504). My new code is at:
http://j.mp/lmdescrypt
Old & invalid: j.mp/lmde2crypt
Last edited by Pepas on Tue Sep 15, 2015 10:54 pm, edited 5 times in total.
TomRoche

Re: LMDE install with encrypted partitions or resizable volu

Post by TomRoche »

Pepas wrote:My new code is at: j.mp/lmde-2
Thanks! I put a backup here.
User avatar
Pepas
Level 2
Level 2
Posts: 56
Joined: Mon Jan 24, 2011 10:18 am
Contact:

Re: LMDE install with encrypted partitions or resizable volu

Post by Pepas »

(Tom, some minor clarifications in Old & invalid: j.mp/lmde2crypt)
Last edited by Pepas on Tue Sep 15, 2015 10:55 pm, edited 2 times in total.
TomRoche

Re: LMDE install with encrypted partitions or resizable volu

Post by TomRoche »

Pepas wrote:(Tom, some minor clarifications in j.mp/lmde2bash )
2 responses:
  1. Note I already have an issue about `cryptsetup benchmark`.
  2. IMHO, you really should think about using a better {code host, online version control system}!
Trapper
Level 4
Level 4
Posts: 357
Joined: Sat Dec 03, 2011 12:21 pm
Location: North Port, Florida USA

Re: LMDE install with encrypted partitions or resizable volu

Post by Trapper »

Pepas wrote:In my testing I've found that the script that worked well for LMDE 201403 needed some tweaks for LMDE-2 (201504). My new code is at:
j.mp/lmde2bash
I previously tried your 201403 script with 201504 and it definitely failed for me. I'll give your new script at http://j.mp/lmde2bash a try tomorrow Pepas and let you know how it did for me. Thanks.
Trapper
Level 4
Level 4
Posts: 357
Joined: Sat Dec 03, 2011 12:21 pm
Location: North Port, Florida USA

Re: LMDE install with encrypted partitions or resizable volu

Post by Trapper »

Trapper wrote: I'll give your new script at http://j.mp/lmde2bash a try tomorrow Pepas and let you know how it did for me. Thanks.
I just took back some comments about errors i got in the script today. I just realized there are 2 makelmdescript scripts. One is 12.2 kB and the other is 12.3 kB. I did the 12.2. I will try 12.3 and see what I get there.
Trapper
Level 4
Level 4
Posts: 357
Joined: Sat Dec 03, 2011 12:21 pm
Location: North Port, Florida USA

Re: LMDE install with encrypted partitions or resizable volu

Post by Trapper »

  • I have removed this post in the interest of keeping this tutorial as clutter free as possible. It dealt with stop errors in makelmdescript (lmde2crypt) that have now been eliminated and none of this post any longer applies.
Last edited by Trapper on Thu Apr 23, 2015 8:24 am, edited 1 time in total.
User avatar
Pepas
Level 2
Level 2
Posts: 56
Joined: Mon Jan 24, 2011 10:18 am
Contact:

Re: LMDE install with encrypted partitions or resizable volu

Post by Pepas »

The script ran into trouble when removing a volumegroup that is non-existent on your system. The script uses a halt-on-any-error flag, so it stops, also when there isn't really a problem.

I've updated the script (sorry Tom...), but the old links won't work correctly anymore, so I finally setup a sourceforge page. You can use this link to download the script, and also future versions:
http://j.mp/lmdescrypt
(Old & obsolete: j.mp/lmde2crypt
Last edited by Pepas on Mon Feb 29, 2016 1:16 pm, edited 1 time in total.
Trapper
Level 4
Level 4
Posts: 357
Joined: Sat Dec 03, 2011 12:21 pm
Location: North Port, Florida USA

Re: LMDE install with encrypted partitions or resizable volu

Post by Trapper »

Pepas wrote:The script ran into trouble when removing a volumegroup that is non-existent on your system. The script uses a halt-on-any-error flag, so it stops, also when there isn't really a problem.

I've updated the script (sorry Tom...), but the old links won't work correctly anymore, so I finally setup a sourceforge page. You can use this link to download the script, and also future versions:
http://j.mp/lmde2crypt
Pepas, I downloaded the script from this address, set it up for my liking and it installed cleanly. I am going to remove the bulk of my previous post. I just put it there so you could see what was happening previously. No sense in cluttering up the tutorial with info that no longer applies. Thanks for your help and work.
User avatar
Pepas
Level 2
Level 2
Posts: 56
Joined: Mon Jan 24, 2011 10:18 am
Contact:

Re: LMDE install with encrypted partitions or resizable volu

Post by Pepas »

Thanks for checking that it works for you.

A few caveats about this current version:
- I haven't checked this with older versions of LMDE, I no longer have the iso's (but is there much point to them??)
- This will not work with UEFI installations (but I don't know if the normal installer works in that case).
Trapper
Level 4
Level 4
Posts: 357
Joined: Sat Dec 03, 2011 12:21 pm
Location: North Port, Florida USA

Re: LMDE install with encrypted partitions or resizable volu

Post by Trapper »

Pepas wrote: - I haven't checked this with older versions of LMDE, I no longer have the iso's (but is there much point to them??)
I just tested your new script with LMDE 201403 MATE 64bit DVD installer and it worked correctly for me.
TomRoche

Re: LMDE install with encrypted partitions or resizable volu

Post by TomRoche »

Pepas wrote:(Tom, some minor clarifications in j.mp/lmde2bash )
TomRoche wrote:IMHO, you really should think about using a better {code host, online version control system}!
Pepas wrote:I finally setup a sourceforge page.
Finally indeed !-) I updated the tutorial to point to it.
User avatar
Pepas
Level 2
Level 2
Posts: 56
Joined: Mon Jan 24, 2011 10:18 am
Contact:

Re: LMDE install with encrypted partitions or resizable volu

Post by Pepas »

Good to know, Trapper, that it's still working for 201403-amd64. I'll keep the compatibility note in for now.
LMDE User

Re: LMDE install with encrypted partitions or resizable volu

Post by LMDE User »

I have tried this script numerous times with various options and it seems to stop at the same point:

Code: Select all

 ...
Physical volume "/dev/mapper/crypt" successfully created
  Volume group "crypt" successfully created
((root_gb>1)) && lvcreate "$lvmroot" -n "$root_label" "$crypt_label"
+ (( root_gb>1 ))
if ((swap_gb))
then
	lvcreate "$lvmswap" -n "$swap_label" "$crypt_label"
	((format_swap)) && mkswap -f -L "$swap_label" "$swap_device"
	swap_uuid=$(blkid -s UUID -o value "$swap_device")
fi
+ (( swap_gb ))
+ lvcreate '-L 3202568K -Cy -Zn' -n swap crypt
  Invalid argument for --size:  3202568K -Cy -Zn
  Error during parsing of command line.
User avatar
Pepas
Level 2
Level 2
Posts: 56
Joined: Mon Jan 24, 2011 10:18 am
Contact:

Re: LMDE install with encrypted partitions or resizable volu

Post by Pepas »

I am very sorry for this bug. I put the script through http://www.shellcheck.net/ and it always recommends putting quotes around variable names. But in some cases, that is NOT what you want... I didn't test after the "improvements" (not...)

I've just uploaded the corrected version.
LMDE User

Re: LMDE install with encrypted partitions or resizable volu

Post by LMDE User »

Gracias!
User avatar
Pepas
Level 2
Level 2
Posts: 56
Joined: Mon Jan 24, 2011 10:18 am
Contact:

Re: LMDE install with encrypted partitions or resizable volu

Post by Pepas »

I set up a repository on Github for the LUKS/LVM install script: https://github.com/pepa65/lmdescrypt

The script can be downloaded through: http://j.mp/lmdescrypt
davschm

Re: LMDE install with encrypted partitions or resizable volu

Post by davschm »

New to linux and trying to make this work. I am getting a error when running the script about not being in the live environment. I am running it from within the live CD. Could there be a compatibility issue?

My version = linuxmint-17.2-cinnamon-64bit.iso
User avatar
karlchen
Level 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: LMDE install with encrypted partitions or resizable volu

Post by karlchen »

Hello, davschm.
davschm wrote:Could there be a compatibility issue? My version = linuxmint-17.2-cinnamon-64bit.iso
The reason might be that your Live System is Linux Mint 17.2, but this sub.-forum and this thread is about LMDE 2, Linux Mint Debian Edition 2 "Betsy", not about Linux Mint 17.2 which is based on Ubuntu 14.04.
So the referenced script might be specific to LMDE 2.

Cheers,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
Locked

Return to “LMDE Archive”