Overview

summary

Current LMDE installers currently (as of early 2015)

• do not support headless operation
• install only to "normal" drive partitions

This project attempts to make it easier for users to install LMDE

2. onto resizable "volumes", currently using LVM2
3. onto encrypted partitions, currently using LUKS

until such time as the LMDE team can support this functionality, and perhaps to enable them to do so. (My guess is 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.)

Branch= master currently uses both LVM2 and LUKS, but my intent is to allow the user to choose either, both, or none (i.e., to just run the character-mode LMDE installer). (Branch= support_LVM2_without_LUKS currently contains initial, untested work toward its stated goal.)

The following process has been most recently tested with an LMDE2 MATE RC. Other news regarding this project may be available on the comment thread for this LMDE2 tutorial.

support

If you have a bug to report or feature to request that is specific to this code/project, please first check previously-created project issues to see if someone else has already reported/requested. Then,

• if there is a relevant current issue: please contribute a comment to it, or just follow the issue.
• if there is not a relevant current issue: please create a new issue.

For more general comments, complaints, or questions, consider posting to this LMDE2 tutorial. Note that the LMDE2 tutorial also contains information about and links to other manual and automated options for providing this functionality.

implementation

Currently this install

This project currently includes two examples of properties files:

Feel free to fork this project to send us a pull request with your properties file! Note however that install_LMDE_plus_LUKS_LVM2.sh will want to source install_LMDE_plus_LUKS_LVM2.properties at runtime, so be sure to make your properties file have that name at runtime. (Or edit the script, but I deprecate that.)

instructions

1. Create a Live LMDE installer (e.g., LiveCD, LiveUSB). Note
• The following instructions assume you will use a LiveUSB as created by, e.g.,
• older instructions for creating a single-ISO host-specific LiveUSB (used by this author with LMDE-201403).
• newer instructions for creating a multi-ISO LiveUSB (including LMDE2 ISOs)
• You can edit your properties file (and script if desired) now and then add them to your install media pre-boot, or you can download the default properties file (i.e., install_LMDE_plus_LUKS_LVM2.properties) and script (i.e., install_LMDE_plus_LUKS_LVM2.sh) to your device after booting the install media (editing in place using whatever editor(s) are included with the Live installer).

• Note that, at boottime, your LiveUSB will be mounted read-only. I.e., I am unaware of any way to edit and rerun your script or properties on a booted LiveUSB.

• Note that / on a LiveUSB when not booting becomes /lib/live/mount/medium/ at boottime. I.e., if you're editing files that are in /media/you/YourUSBDrive/foo/bar/ pre-boot, at boottime the files will be in /lib/live/mount/medium/foo/bar/.

• At boottime, you will need to run your script as sudo, or else deal with privileges throughout your script.

1. Boot your LiveUSB (or other install media).

2. If not previously saved to your installer (which is recommended), you can setup your install script and properties at boottime (not tested by me, but believed to work):

• download script and properties. Open a Terminal (mainmenu>Terminal, which here is assumed to run bash) and run
DIR='/path/to/your/files' # choose path carefully: DIR must *NOT* be
# - on the LiveUSB or other read-only mount
# - on a device which you will be formatting or installing
mkdir -p "${DIR}" # in case DIR does not exist (which '.' of course does :-) # download the script (if not creating your own) URI='https://bitbucket.org/tlroche/install_resizable_encrypted_lmde/raw/HEAD/install_LMDE_plus_LUKS_LVM2.sh' # or where you get this from, if different FN="$(basename ${URI})" # filename of your download FP="${DIR}/${FN}" wget -c -O "${FP}" "${URI}" # download this, allowing restart (JIC) chmod +x "${FP}"        # script must be executable to chroot

URI="$(echo -e "${URI}" | sed -e 's/\.sh$/.properties/')" FN="$(basename ${URI})" # filename of your download FP="${DIR}/${FN}" wget -c -O "${FP}" "${URI}" chmod +r "${FP}"        # properties must be readable to source

• inspect and edit your local properties file. Use one of the editors included on your install media (e.g. gedit, nano) to run something like
your_editor_here /path/to/your/files/install_LMDE_plus_LUKS_LVM2.properties

3. Partition the target drive (here assumed to be /dev/sda--see var= grub_device in the script. This example

• creates a 128 MB boot partition in /dev/sda1
• gives all remaining space to a single volume (/dev/sda2) to be encrypted with LUKS and managed with LVM2.
sudo fdisk /dev/sda [hit Enter]
o [Enter]
n [Enter]
[Enter]
[Enter]
[Enter]
+128M [Enter]
n [Enter]
[Enter]
[Enter]
[Enter]
[Enter]
w [Enter]

4. Start the script: e.g.,

pushd /path/to/your/files/
sudo ./install_LMDE_plus_LUKS_LVM2.sh ./install_LMDE_plus_LUKS_LVM2.properties

5. Interact with the script: e.g.,

• give password for encryption when prompted (twice the same)
• give password for decryption when prompted (once)
6. Wait a bit for this script to and to start the the LMDE installer, then interact with the non-graphical version of LMDE installer. You will provide the same information as with the GUI installer to which you might be more accustomed, but inside the terminal. (A blast from the past !-)

7. When the script completes, you are back at the command line. Shut down your device (e.g., with sudo shutdown -Ph now) and remove the install media (LiveCDs are a bit more tricky at this point), then restart your device.

8. First thing to do on restart: check your mounts! Open a terminal, and run (as a normal user)

df -h
mount
cat /etc/fstab