How to make a USB thumb drive boot and retain your work.
by cold iron from LinuxQuestions.org on (#533ZP)
I hope this is the right stop to write this. You may delete it.
This worked on Parrot and Kali 2019, could not make it work on Kali 2020.
If you have to use sudo, I did this sudo -i bash, that stopped the need for each line of text. But if you close the terminal, you will need to redo it.
I make no claims this will work for you, it did for me.
So after your load your Kali on a USB drive, boot to LIVE.
Now type.
fdisk -l this will show all the partitions. I had 3, it's the 3 rd one we are working on.
fdisk /dev/sdb
#now it will ask you for command, type n and hit enter
Now press enter 4 more times, and type w and hit enter.
#we have successfully created the partition.
fdisk -l chk for sdb3
mkfs.ext4 -L persistence /dev/sdb3 wait a bit
e2label /dev/sdb3 persistence
mkdir -p /mnt/duke or any name I used duke.
mount /dev/sdb3 /mnt/duke
echo / union" > /mnt/duke/persistence.conf this may not work.
umount /dev/sdb3
exit
NOW DO THIS IS ABOVE FAILS.
must be in sdb3 or your last part.), If you have 3 partitions. otherwise persistence will not work. You may have 2, just make sure what you have.
Create a new mount point called your choice, I use duke.
sudo mkdir -p /mnt/duke
Mount your USB persistence partition to duke. Reminder: Your persistence partition may not be sdb2, please ensure you mount the right one.
sudo mount /dev/sdb2 /mnt/duke
Create a new file called persistence.conf using the nano text editor.
sudo nano /mnt/duke/persistence.conf
In this file, type / union. enter
/mnt/duke/persistence.conf enter
/ union enter
Save the file and exit. (Press CTRL + X, press Y, then press ENTER).
Now unmount your persistence partition. Reminder: Your persistence partition may not be sdb2, please ensure you unmount the right one.
sudo umount /dev/sdb2
We're done! I would make a fold just to test it is still there after you boot so you know it works.
YOU MUST BOOT TO PERSISTENCE ON MENU, IF YOU GET BLACK SCREEN TYPE EXIT, maybe twice.
IT WILL BOOT BUT IT'S VERY SLOW.


This worked on Parrot and Kali 2019, could not make it work on Kali 2020.
If you have to use sudo, I did this sudo -i bash, that stopped the need for each line of text. But if you close the terminal, you will need to redo it.
I make no claims this will work for you, it did for me.
So after your load your Kali on a USB drive, boot to LIVE.
Now type.
fdisk -l this will show all the partitions. I had 3, it's the 3 rd one we are working on.
fdisk /dev/sdb
#now it will ask you for command, type n and hit enter
Now press enter 4 more times, and type w and hit enter.
#we have successfully created the partition.
fdisk -l chk for sdb3
mkfs.ext4 -L persistence /dev/sdb3 wait a bit
e2label /dev/sdb3 persistence
mkdir -p /mnt/duke or any name I used duke.
mount /dev/sdb3 /mnt/duke
echo / union" > /mnt/duke/persistence.conf this may not work.
umount /dev/sdb3
exit
NOW DO THIS IS ABOVE FAILS.
must be in sdb3 or your last part.), If you have 3 partitions. otherwise persistence will not work. You may have 2, just make sure what you have.
Create a new mount point called your choice, I use duke.
sudo mkdir -p /mnt/duke
Mount your USB persistence partition to duke. Reminder: Your persistence partition may not be sdb2, please ensure you mount the right one.
sudo mount /dev/sdb2 /mnt/duke
Create a new file called persistence.conf using the nano text editor.
sudo nano /mnt/duke/persistence.conf
In this file, type / union. enter
/mnt/duke/persistence.conf enter
/ union enter
Save the file and exit. (Press CTRL + X, press Y, then press ENTER).
Now unmount your persistence partition. Reminder: Your persistence partition may not be sdb2, please ensure you unmount the right one.
sudo umount /dev/sdb2
We're done! I would make a fold just to test it is still there after you boot so you know it works.
YOU MUST BOOT TO PERSISTENCE ON MENU, IF YOU GET BLACK SCREEN TYPE EXIT, maybe twice.
IT WILL BOOT BUT IT'S VERY SLOW.