Kali is the go-to operating system of choice if you’re looking to get into any form of hacking or penetration testing scenario. It’s loaded with tools, utilities and features that make using it an absolute beast.
One of the biggest strengths of Kali Linux is its ability to run off flash drives, but there’s a catch. You see, after you’re done using the OS and shut down the system; the drive loses all data and modifications made to any settings.
You can counter this problem by creating a bootable media with persistence enabled. Persistence in Kali is a feature that saves any settings you change in the OS and any files you create, much like a regular OS.
The process can be a bit confusing; hence, for the sake of simplicity, we’ve divided it into three main steps:
- Creating Kali Linux bootable media
- Creating the persistence partition
- Mounting the persistence partition
Here’s how to go about these steps.
Also read: How to update Kali Linux?
Creating Kali Linux bootable media
This has been previously covered in an article before. Basically, all you need to do is download the latest version of Kali from the official website, using a disk burning program (we recommend Win32 Disk Imager on Windows, Etcher on Linux). You’ll have your bootable drive in a matter of minutes.
Creating the persistence partition
Here’s the interesting part. Now that you’ve burnt the flash drive, you need to create a ‘persistence’ partition for Kali where you’ll save all the data. If you’re working on Windows, we suggest using the MiniTool Partition wizard for the job.
Once you’ve downloaded and installed it, here’s what to do:
Step 1: Locate your flash drive, right-click on it and click on Move/Resize.
Step 2: Resize the partition to a minimum of 4 GB. You can resize it to whatever you want; just make sure to not go below 4 GB as you need to give ample space to Kali to work properly.
Step 3: Right-click again on the grey unallocated partition and select Create.
Step 4: Create a partition with the following settings
- File System: ext4
- Partition label: persistence (it’s essential to get the spelling right)
Use the maximum partition size and click OK.
Step 5: Click on Apply in the top-left hand corner and wait for the changes to be saved.
We have now created a partition that Kali will use to save all its data. However, the job’s not done yet.
How to mount the persistence partition?
Here are the last few steps you need to complete to get persistence working on your drive
Step 1: Boot into Kali and select the ‘Live System (with persistence)’ option.
Step 2: Fire up a terminal and run the following command:
You’ll see a bunch of data come up. Locate your bootable drive and note the name of the persistence partition. Then run the following commands, of course after making the required changes
mkdir -p /mnt/my_usb
mount /dev/sdb3 /mnt/my_usb
echo “/ union” > /mnt/my_usb/persistence.conf
And that’s it. That’s how you make a persistence installation of Kali Linux.