LMDE install with encrypted partitions or resizable volumes

Write tutorials here
More tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please, Before you post please read this
TomRoche
Level 4
Level 4
Posts: 248
Joined: Thu Jan 13, 2011 2:52 pm

LMDE install with encrypted partitions or resizable volumes

Postby TomRoche » Sun Apr 12, 2015 11:28 pm

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 TomRoche on Sun Sep 20, 2015 2:33 pm, edited 3 times in total.

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

Re: LMDE install with encrypted partitions or resizable volu

Postby Pepas » Tue Apr 21, 2015 1:34 pm

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
Level 4
Level 4
Posts: 248
Joined: Thu Jan 13, 2011 2:52 pm

Re: LMDE install with encrypted partitions or resizable volu

Postby TomRoche » Tue Apr 21, 2015 1:55 pm

Pepas wrote:My new code is at: [url]j.mp/lmde-2[/url]


Thanks! I put a backup here.

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

Re: LMDE install with encrypted partitions or resizable volu

Postby Pepas » Tue Apr 21, 2015 2:13 pm

(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
Level 4
Level 4
Posts: 248
Joined: Thu Jan 13, 2011 2:52 pm

Re: LMDE install with encrypted partitions or resizable volu

Postby TomRoche » Tue Apr 21, 2015 2:40 pm

Pepas wrote:(Tom, some minor clarifications in [url]j.mp/lmde2bash[/url] )


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: 348
Joined: Sat Dec 03, 2011 12:21 pm
Location: Sebring, Florida USA

Re: LMDE install with encrypted partitions or resizable volu

Postby Trapper » Tue Apr 21, 2015 10:10 pm

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:
[url]j.mp/lmde2bash[/url]


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.
MSI 880GME35-455 MB, AMD Phenom II X4 B55 (-MCP-) CPU, 4GB DDR3 RAM, 500 GB SATA3 HD
Single FDE container holding LMDE 2, LM 17.2, LM 18.1 MATE & CINN, LM 18.2 MATE, Debian Jessie, swap, and shared data LV's.

Trapper
Level 4
Level 4
Posts: 348
Joined: Sat Dec 03, 2011 12:21 pm
Location: Sebring, Florida USA

Re: LMDE install with encrypted partitions or resizable volu

Postby Trapper » Wed Apr 22, 2015 10:10 am

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.
MSI 880GME35-455 MB, AMD Phenom II X4 B55 (-MCP-) CPU, 4GB DDR3 RAM, 500 GB SATA3 HD
Single FDE container holding LMDE 2, LM 17.2, LM 18.1 MATE & CINN, LM 18.2 MATE, Debian Jessie, swap, and shared data LV's.

Trapper
Level 4
Level 4
Posts: 348
Joined: Sat Dec 03, 2011 12:21 pm
Location: Sebring, Florida USA

Re: LMDE install with encrypted partitions or resizable volu

Postby Trapper » Wed Apr 22, 2015 10:54 am

    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.
MSI 880GME35-455 MB, AMD Phenom II X4 B55 (-MCP-) CPU, 4GB DDR3 RAM, 500 GB SATA3 HD
Single FDE container holding LMDE 2, LM 17.2, LM 18.1 MATE & CINN, LM 18.2 MATE, Debian Jessie, swap, and shared data LV's.

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

Re: LMDE install with encrypted partitions or resizable volu

Postby Pepas » Wed Apr 22, 2015 9:45 pm

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: 348
Joined: Sat Dec 03, 2011 12:21 pm
Location: Sebring, Florida USA

Re: LMDE install with encrypted partitions or resizable volu

Postby Trapper » Thu Apr 23, 2015 8:02 am

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.
MSI 880GME35-455 MB, AMD Phenom II X4 B55 (-MCP-) CPU, 4GB DDR3 RAM, 500 GB SATA3 HD
Single FDE container holding LMDE 2, LM 17.2, LM 18.1 MATE & CINN, LM 18.2 MATE, Debian Jessie, swap, and shared data LV's.

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

Re: LMDE install with encrypted partitions or resizable volu

Postby Pepas » Thu Apr 23, 2015 9:10 am

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: 348
Joined: Sat Dec 03, 2011 12:21 pm
Location: Sebring, Florida USA

Re: LMDE install with encrypted partitions or resizable volu

Postby Trapper » Thu Apr 23, 2015 11:57 am

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.
MSI 880GME35-455 MB, AMD Phenom II X4 B55 (-MCP-) CPU, 4GB DDR3 RAM, 500 GB SATA3 HD
Single FDE container holding LMDE 2, LM 17.2, LM 18.1 MATE & CINN, LM 18.2 MATE, Debian Jessie, swap, and shared data LV's.

TomRoche
Level 4
Level 4
Posts: 248
Joined: Thu Jan 13, 2011 2:52 pm

Re: LMDE install with encrypted partitions or resizable volu

Postby TomRoche » Thu Apr 23, 2015 12:00 pm

Pepas wrote:(Tom, some minor clarifications in [url]j.mp/lmde2bash[/url] )


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: 51
Joined: Mon Jan 24, 2011 10:18 am
Contact:

Re: LMDE install with encrypted partitions or resizable volu

Postby Pepas » Thu Apr 23, 2015 11:18 pm

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

LMDE User
Level 1
Level 1
Posts: 4
Joined: Sat May 02, 2015 11:13 am

Re: LMDE install with encrypted partitions or resizable volu

Postby LMDE User » Sat May 02, 2015 11:19 am

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: 51
Joined: Mon Jan 24, 2011 10:18 am
Contact:

Re: LMDE install with encrypted partitions or resizable volu

Postby Pepas » Sat May 02, 2015 1:15 pm

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
Level 1
Level 1
Posts: 4
Joined: Sat May 02, 2015 11:13 am

Re: LMDE install with encrypted partitions or resizable volu

Postby LMDE User » Sat May 02, 2015 11:06 pm

Gracias!

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

Re: LMDE install with encrypted partitions or resizable volu

Postby Pepas » Fri Jun 12, 2015 11:55 am

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
Level 1
Level 1
Posts: 7
Joined: Sat Sep 12, 2015 1:59 pm

Re: LMDE install with encrypted partitions or resizable volu

Postby davschm » Sat Sep 12, 2015 2:13 pm

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 18
Level 18
Posts: 8186
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: LMDE install with encrypted partitions or resizable volu

Postby karlchen » Sat Sep 12, 2015 3:50 pm

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
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.


Return to “Tutorials”