View Full Version : Can't get persistence to work on 32Gb USB drive
I am using a SanDisk Ultra USB 3.0 drive and the kali-linux-2019.1a-amd64.iso to make a live USB with persistence in Windows 7 Professional. I have read and followed every tutorial about persistence that's out there. I get Kali on the usb drive, reboot it and it works like a champ. I get the persistence partition created and labeled and formatted but when I make changes to Kali and download a test file it will not save them through a reboot. I have formatted the persistence partition in EXT3 and EXT4 and neither one works. Following the different tutorials I have used Rufus, unetbootin, LinuxLive USB Creator, win32diskimager, the universal usb installer and/or the minitool partition wizard either alone or in some combination as prescribed by whichever tutorial I was following. I am at a loss as to what the problem could be. Is it the brand of usb drive? Am I not holding my mouth right? Do I need to sacrifice something or someone to the god of persistence? I have inserted a graphic from the minitool partition wizard showing the partition table of the flash drive. Thanks in advance.
3382
Looks like for what ever reason the partition didnt mount at boot. You boot the thumb drive from the persistence mode right?
I made a thread on reddit with instructions ti create persistence usb from terminal of kali. Hope it helps.
https://www.reddit.com/r/Kalilinux/comments/b79hy7/kali_live_persistence_fill_in_what_you_need_when/?utm_medium=android_app&utm_source=share
The last icon isnt a pipe symbol its the cursor of the computer.
Just press enter after every line, also fill in appropriate info. its from offensive security team instructions simplified. Good luck.
Thanks for the info bigbiz. When I do the parted print it gives me a list of all the commands and options I can do then it gives me the info for my hard drive (that has Windows on it) but shows nothing about the flash drive (sdb). When I do /dev/sdb it just gives me the list of commands. I don't want to do mkpart since all it shows me is the primary hard drive and I really don't need to re-partition that. When I do the "mount /dev/sdb2 /mount/frickin" command I get this response: mount: /mount/frickin: mount point does not exist. I did the "mkdir -p /mnt/frickin" step right before that but I don't know what to do from here. If I do mount /dev/sdb2 I get the response: mount: /dev/sdb2: can't find in /etc/fstab. Any advice would be greatly appreciated.
Ok I've gotten to the point that I now have an ext3 partition on my usb drive that is labelled persistence but when I reboot I still don't have actual persistence. What am I not connecting in the process?
Best guess reinstall kali onto the usb make sure the usb is wiped clean. Then try again.
broomdodger
2019-04-07, 22:40
I wrote a linux shell script to write an iso with persistence to a USB drive.
You could boot kali USB without persistence, run the script on another USB drive.
Please let me know if it works for you.
#!/bin/bash
# vi:nowrap
# write iso with persistence
# kali-persistence.sh {iso}
# *** IMPORTANT *** edit DEVICE as needed ***
DEVICE=/dev/sdb
# .......1.........2.........3.........4.........5.. .......6....
if [ ! -e $DEVICE ] # device exists ?
then
echo;echo "device $DEVICE ?";echo;exit 10
fi
ISO=${1}
if [ ! -e "$ISO" ] # iso exists ?
then
echo;echo ".iso $ISO ?";echo;exit 10
fi
# .......1.........2.........3.........4.........5.. .......6....
# writing the iso creates 2 partitions
echo;echo "Write $ISO to $DEVICE"
sudo dd bs=1M if=$ISO of=$DEVICE oflag=direct status=progress && sync
PERSIS=3 # write persistence to partition 3
START=$(du -B1000000 $ISO | cut -f1)
END=$(lsblk --noheadings --nodeps --bytes --output SIZE $DEVICE)
END=$(($END / 1000000))
echo;echo "Persistence on $DEVICE$PERSIS from $START to $END"
sudo parted $DEVICE mkpart primary $START $END &&
sleep 1
sudo mkfs.ext3 -L persistence $DEVICE$PERSIS &&
sudo mkdir -p /mnt/kaliUSB &&
sudo mount $DEVICE$PERSIS /mnt/kaliUSB &&
sudo sh -c "echo '/ union' > /mnt/kaliUSB/persistence.conf" &&
sudo umount $DEVICE$PERSIS &&
sudo rm -fr /mnt/kaliUSB/
sudo fdisk -l $DEVICE
# .......1.........2.........3.........4.........5.. .......6....
That's great! I'll do that. Thanks for the help.