Skip to main content

Comprehensive Guide to Installing Kali Linux with Manual Partitioning, LVM, and LUKS Encryption

·1662 words·8 mins· loading · loading ·
Kali Linux LVM LUKS
UmmIt
Author
UmmIt
Loves to write about technology, and cybersecurity related topics :)

Introduction
#

This article is a comprehensive guide to installing Kali Linux with manual LVM partitioning. The steps outlined here will help you set up Kali Linux with Logical Volume Management (LVM) and LUKS encryption. Here are the results when you successfully complete the installation:

done

What the fuck?
#

Before I started this guide, I was unsure whether I should write it or not. I mean, using a GUI to install is really easy and doesn’t seem to need a guide. But when I tried to install it, I found the Debian installer to be quite challenging and hard to use. Like Linus Torvalds said, The Debian installer is really hard to use.

So, I decided to write this guide to help you install Kali Linux with LVM and LUKS encryption.

I did a lot of research on Kali Linux LVM installation with LUKS, but unfortunately, I couldn’t find any articles or guides available online. I had to figure it out on my own. Two weeks ago, I spent a day and a half trying to figure out how to install Kali Linux with LVM and LUKS. Now, I’m sharing my experience with you! :)

Let’s Get Started
#

I won’t go through the very basics, like how to download the ISO, create a bootable USB, boot from the USB, or set up a new VM. I’ll start from the boot screen of the Kali Linux installer, and this will be my starting point.

started

1. Basic Setup
#

The basic setup should be pretty easy—just follow the instructions on the screen. You’ll need to configure a few things like the language, location, keyboard layout, network settings, user account, and password. Just take it step by step, and you’ll be good to go!

Select a language

Select your location

Configure locales

Configure the keyboard

Load installer components from installation media

Configure the network

Set up users and passwords 1
Set up users and passwords 2
Set up users and passwords 3

Detect partition disks

2. Partition Disks and Configure LVM
#

This is the most important part of this guide. I will show you a very detailed step to create an LVM partition with LUKS encryption. Let’s start by clicking on Manual on the partition disks screen.

Manual partitioning

2.1. GPT Partition Table Creation
#

Since I was using a KVM virtual machine, this is the initial partition choice screen. Go ahead and click on Virtual disk 1 (vda).

Initial partition choice 1

Now, it will ask you if you want to create a new empty partition table on this device. Click on Yes.

Initial partition choice 2

You should now see a new free space partition table created on the device. Click on this free space, and we will proceed to create a new partition.

Select new block device

2.2. Create ESP Partition
#

Kali Linux, also known as the Debian installer, requires an EFI System Partition (ESP) to be created. Unlike Arch, where the EFI and boot partitions can be combined, we will create a separate partition for the EFI. Click on Create a new partition and use the following settings:

Create ESP 1

For safety, I will create a 1G partition for the ESP partition, type in 1GB and click on Continue.

Create ESP 2

for the Beginning or End of this space, choose Beginning and click on Continue.

Create ESP 3

Now, we need to choose the partition type, by clicking on Use as.

Create ESP 4

Choose EFI System Partition and click on Done setting up the partition.

Create ESP 5

And now, click on Done setting up the partition to finish the ESP partition creation.

Create ESP 6

And you should see the new ESP partition created!

Create ESP 7

2.3. Create BOOT Partition
#

Now, we will create a new partition for the boot partition. Click on FREE SPACE.

Create BOOT 1

Click on Create a new partition.

Create BOOT 2

Same as the ESP partition, I will create a 1G partition for the BOOT partition, type in 1GB and click on Continue.

Create BOOT 3

Choose Beginning and click on Continue.

Create BOOT 4

Again, click on Use as, but this time choose Ext2 file system as filesystem.

Create BOOT 5

Now, setting the mount point, click on Mount point.

Create BOOT 6

Choose /boot as the mount point.

Create BOOT 7

Click on Done setting up the partition to finish the BOOT partition creation.

Create BOOT 8

And you should see the new BOOT partition created! Keep going, you are almost there!

Create BOOT 9

2.4. Create LVM Partition
#

This is the most anonying part of setting up LVM partition. Click on Create a new partition.

Click Create a new partition again.

Create LVM 1

As the example, i use 100% of the remaining space for the LVM partition, type in 100% or press the Enter key as the default value and click on Continue.

Create LVM 2

NOT GOOD IMAGE: The image of this should be label as the Use as.

Click on Use as.

Create LVM 3

Choose physical volume for lvm.

Create LVM 4

Click on Done setting up the partition to finish the LVM partition creation.

Create LVM 5

The new LVM partition is created! Now, we will configure the Logical Volume Manager.

Create LVM 6

2.5 Configure encrypted volumes
#

We now will setting up the LUKS encryption for the LVM partition. Click on Configure encrypted volumes.

Configure encrypted volumes 1

Click on Yes to write the changes to the disk.

Configure encrypted volumes 2

Click on Create encrypted volumes.

Configure encrypted volumes 3

Select the LVM partition, and click on Continue.

Configure encrypted volumes 4

Click Done setting up the partition.

Configure encrypted volumes 5

Click Finish to finish the encrypted volumes configuration.

Configure encrypted volumes 6

The installer will ask you do you want to earse the data on the partition, you can skip this step by clicking on No.

Configure encrypted volumes 7

enter your preferred password for the LUKS encryption, and click on Continue.

LVM password 1

If your password is less than 8 characters, the installer will ask you to confirm the password, in my case, i dont care, this virtual machine is just for the guide. so click on Continue.

LVM password 2

2.6. Configure the Logical Volume Manager
#

This part is about configuring the Logical Volume Manager (LVM). Click on Configure the Logical Volume Manager.

Configure the Logical Volume Manager 1

Will asking you to create a new volume group, and write the change to the disk, click on Yes.

Configure the Logical Volume Manager 2

Click on Create volume group.

Create volume group 1

Type the name of the volume group you want to naming, i use kali as the name, and click on Continue.

Create volume group 2

Find out the device you want to add for this volume group, and check the box, and click on Continue.

Create volume group 3

Click on Yes to write the change to the disk.

Create volume group 4

To verify the volume group is created, click on Display configuration details.

Create volume group 5

Nice, the volume group is created! Now, we will create the logical volume for the swap partition.

Create volume group 6

2.7. Create Logical Volume for Swap Partition
#

Click on Create logical volume. we will create two logical volumes, one for the swap partition and the other for the root partition.

You might want to create home partition, but i dont create it because i dont need it.

Create logical volume swap 1

Select the volume group that before you created, and click on Continue.

Create logical volume swap 2

Type the name of the logical volume, i use swap as the name, and type the size of the logical volume.

Create logical volume swap 3

Type a size for the swap partition, i use 10GB as the size, and click on Continue.

Create logical volume swap 4

To verify the logical volume is created, click on Display configuration details.

Create logical volume swap 5

Nice, the logical volume for the swap partition is created! Now, we will create the logical volume for the root partition.

Create logical volume swap 6

2.8. Create Logical Volume for Root Partition
#

Click on Create logical volume.

Create logical volume root 1

Select the volume group that before you created, and click on Continue.

Create logical volume root 2

Type the name of the logical volume, i use root as the name.

Create logical volume root 3

Type a size for the root partition, i use 100% as the size, for the maximum size you also can enter to use the default value, and click on Continue.

Create logical volume root 4

To verify the logical volume is created, click on Display configuration details.

Create logical volume root 5

Nice, the logical volume for the root partition is created! Now, we will format the LVM partitions.

Create logical volume root 6

Click the Finish button to finish the partitioning.

Create logical volume root 7

2.9. Format LVM Partitions
#

The following partition of correct format is important, you should see a similar screen table as below :)

now, we will format the logical volume for the root partition and the swap partition make it useable.

Create logical volume root 8

Use arrow keys to select the root partition, and press Enter.

Format LVM root 1

Click on Use as.

Format LVM root 2

Choose Ext4 journaling file system as the filesystem, and click on Done setting up the partition.

NOTE: You also can choose btrfs as the filesystem, which also a good choice for the snapshot filesystem, but i choose ext4 because it is just for this guide.

Format LVM root 3

Click on Mount point.

Format LVM root 4

Choose / as the mount point with root filesystem.

Format LVM root 5

Click on Done setting up the partition to finish the root partition format.

Format LVM root 6

You should see the root partition is mounted with d label as /.

Format LVM root 7

Now, we will format the logical volume for the swap partition, select the swap partition, and press Enter.

Format LVM swap 1

Click on Use as. Our swap partition will be used as a swap area.

Format LVM swap 2

Choose swap area as the filesystem.

Format LVM swap 3

Click on Done setting up the partition to finish the swap partition format.

Format LVM swap 4

And yes! our table is ready to use !!!

Format LVM swap 5

2.10. Write the changes to the disk
#

Now, the partitioning is done, click on Finish partitioning and write changes to disk.

Partition finished 1

Click on Yes to write the changes to the disk.

Partition finished 2

The installer will start to install the base system. just wait for a while.

Install the base system

3. Software Selection
#

Select the software you want to install, mostly the default option is good enough, but find one that suits you. the Desktop environment of what you want to use.

Software selection

Wait for the installation to finish.

Select and install software

4. Reboot the system
#

After the installation is finished, click on Continue. you now can try out your new Kali Linux system with rebooting the system.

Finish the installation 1
Finish the installation 2

5. Booting the system
#

After rebooting the system, you will see the GRUB boot loader screen :)

GRUB configuration

6. Unlock LUKS
#

You will be asked to unlock the LUKS encryption, type in the password you set before, and press Enter.

Unlock LUKS 1
Unlock LUKS 2
Unlock LUKS 3

Login screen 1
Login screen 2

Check the LVM partition
#

Wow, you have successfully installed Kali Linux with LVM and LUKS encryption! You can check the LVM partition by running the lsblk command.

List block devices

My feeling
#

Debian is harder than Arch Linux to install. I can more confirm I’m cli guy XD

Related

Complete Guide to setting up LUKS on LVM encryption in Arch Linux (Minimal System)
··1839 words·9 mins· loading · loading
Arch Linux LUKS LVM Encryption
Encrypting External Drives with LUKS: A Beginner's Guide (LVM Not Included)
·869 words·5 mins· loading · loading
LUKS Encryption Security GNU/Linux External Drive
How to Add More Keys and Verify Keys on LUKS
·319 words·2 mins· loading · loading
LUKS Encryption Security GNU/Linux
Resizing LVM and LUKS Encrypted Btrfs Filesystem
·383 words·2 mins· loading · loading
BTRFS LUKS Linux
Full Disk Encryption with GRUB and Including /boot: Step-by-Step Guide
··567 words·3 mins· loading · loading
LUKS Linux Arch Linux
Encrypt and Decrypt Your Internal Disk with an Existing Decrypted Filesystem Inside Keyfile
·1085 words·6 mins· loading · loading
LUKS