Вы находитесь на странице: 1из 6

2/8/2018 Creating Kali Linux Live USB with Persistence, a simple guide

Fatah Nur Alam Majid Follow


Just want to share, Linux enthusiast, SysAdmin wannabe, DevOps wannabe, SRE wannabe
Feb 17, 2017 · 4 min read

Creating Kali Linux Live USB with


Persistence, a simple guide

Source: Google Image

Who knows you can add a persistent storage with your Kali Linux on-
the-go? Well actually you can do it with simple steps. In this tutorial I
would like to tell you how to make a Kali Linux on-the-go (Live USB),
but this Kali is special because we can save our data in the same USB we
use for boot that “portable” Kali. We call it Kali Linux with Persistence.
Actually there is an o cial documentation for making this stu in here.
You may want to follow the o cial documentation then, but this post is
based on those documentation too. You can choose either you want to
read this post or read the o cial documentation above.

Requirements for this tutorial:

1. Kali linux ISO image (get it here)

2. terminal

https://medium.com/@fatahnuram/creating-kali-linux-live-usb-with-persistence-a-simple-guide-54e3eb01b6aa 1/6
2/8/2018 Creating Kali Linux Live USB with Persistence, a simple guide

3. run as root (for simple executions, but not mandatory)

4. USB ashdisk or any portable storage (minimum size of 4GB,


recommended size 8GB+)

Note: I’m using Lubuntu 16.04 when I wrote this post

Okay let’s begin the steps..

First, you must load your Kali ISO image into your USB ashdisk. You
can read how to do that in here. And make sure you have enough space
left for the persistent storage.

Second, make the unallocated space left in your USB ashdisk to


become an ext4 lesystem, and label it with “persistence”. You can do
this using command fdisk /dev/sdX or you may want to use command
gparted instead.

root@linux:~# fdisk /dev/sdX

In my case, it should be like this:

root@linux:~# fdisk /dev/sdb

After going into fdisk command line, press n to make a new partition.
Then type p to specify the partition primary. Then go give the partition
number, rst sector, and last sector for the persistent storage. In my
case, I would like to use the default from the system, and looks like this:

As you can see, I make the new partition number 3, rst sector default,
last sector default, because I just want to make the space left to become

https://medium.com/@fatahnuram/creating-kali-linux-live-usb-with-persistence-a-simple-guide-54e3eb01b6aa 2/6
2/8/2018 Creating Kali Linux Live USB with Persistence, a simple guide

the persistent storage. Then we can type w to save the new partition,
and the result is the new partition is created and its size is 905MB
(because I’m using the Kali Linux ISO image of size 2.9GB and I use my
4GB USB ashdisk, 3.8GB of actual size).

Note: If you get a warning like this:

You may want to replug your USB ashdisk to refresh or to tell the
system that the partition table has been changed.

After the partition created, now we can make the lesystem inside that
partition. We can execute:

root@linux:~# mkfs.ext4 -L persistence /dev/sdXY

Where /dev/sdXY is your partition location. In my case, it should be


like this:

root@linux:~# mkfs.ext4 -L persistence /dev/sdb3

You may want to run fdisk -l command to nd the correct partition.

Next, the third step, we make that new partition into becoming really
“persistence” storage. This can be done by mounting the partition at
/dev/sdXY to /mnt/directory, and do some con guration. You can
execute this command to mount the desired partition:

root@linux:~# mkdir /mnt/directory

root@linux:~# mount /dev/sdXY /mnt/directory

In my case:

root@linux:~# mkdir /mnt/my_kali

https://medium.com/@fatahnuram/creating-kali-linux-live-usb-with-persistence-a-simple-guide-54e3eb01b6aa 3/6
2/8/2018 Creating Kali Linux Live USB with Persistence, a simple guide

root@linux:~# mount /dev/sdb3 /mnt/my_kali

Next we should do some con guration. This kind of con guration I


mean is that we must make a text le named “persistence.conf” and
type “/ union” (without quotations) into that le. This can be done by
following command:

root@linux:~# echo “/ union” > /mnt/directory/persistence.conf

In my case:

root@linux:~# echo “/ union” > /mnt/my_kali/persistence.conf

Next we must unmount the persistent partition using umount


command, like this:

root@linux:~# umount /dev/sdXY

In my case:

root@linux:~# umount /dev/sdb3

Finally, our “Kali Linux with Persistence” is ready to use. Now you can
boot your persistent Kali by selecting the “Live USB with persistence”
option at startup.

Note: To tell whether your persistent storage is working or not, you can
check in your Kali Linux desktop, like this:

https://medium.com/@fatahnuram/creating-kali-linux-live-usb-with-persistence-a-simple-guide-54e3eb01b6aa 4/6
2/8/2018 Creating Kali Linux Live USB with Persistence, a simple guide

Failed persistence partition

Successful persistence partition

If the “persistence” partition is coming up in your desktop, we can tell


that you failed to make the persistent storage. Otherwise, if the
“persistence” storage doesn’t coming up, you’re ready to use the Kali
Linux with Persistence.

Note: The third step can also be done when you’re booting from your
Kali Linux Live USB.

https://medium.com/@fatahnuram/creating-kali-linux-live-usb-with-persistence-a-simple-guide-54e3eb01b6aa 5/6
2/8/2018 Creating Kali Linux Live USB with Persistence, a simple guide

https://medium.com/@fatahnuram/creating-kali-linux-live-usb-with-persistence-a-simple-guide-54e3eb01b6aa 6/6

Вам также может понравиться