PDA

View Full Version : Persistence on Live USB is only 1/2 working



natv
2015-12-12, 14:40
I used Win32DiskImager on a Windows machine to write the Kali2 ISO to my 64GB USB Flash Drive.

I then mounted the USB drive on a linux system and used gparted to convert the "unallocated" space to an ext4 partition named "persistence".

I created a file in the persistence partition named persistence.conf with the word "/ union" in it.


When I now boot from the USB into Kali Linux, selecting the boot option in the menu for "persistence", I do have some persistence (a folder I create on the desktop persists after reboots for example)

BUT - system changes, like resetting the root password does not persist. It goes back to the default password after I reboot.


Any idea how to fix this?

longGoneSun
2015-12-12, 15:25
From http://docs.kali.org/downloading/kali-linux-live-usb-persistence "The persistent data is stored in its own partition on the USB drive, which can also be optionally LUKS-encrypted." I don't think you can overwrite any of the system data itself. Kali in this setup would be seen as a "live" distro with some extra space so that you can save files to that extra partition.

natv
2015-12-13, 00:00
I see... is there a way to install it to USB and boot to it, but have it be all persistent?

fcricardofc
2015-12-13, 01:48
You could modify squashfs as discussed in http://unix.stackexchange.com/questions/80305/mounting-a-squashfs-filesystem-in-read-write, or create your custom live as discussed in http://docs.kali.org/development/live-build-a-custom-kali-iso, but all persistent... squashfs is filesystem read-only and you should change it every time. You could start a custom script in boot but... all persistent with iso, with squashfs...

Knedlic
2015-12-13, 22:56
I see... is there a way to install it to USB and boot to it, but have it be all persistent?

I found an easier way and posted it here: https://forums.kali.org/showthread.php?28653-A-full-install-on-a-thumb-drive


the result is a USB stick working the same as a hard drive. you need to do this on a desktop with at least 32 gigs on the stick.

fcricardofc
2015-12-19, 09:50
Yes, if you do not create a live-usb and hard drive you choose as installation usb, then if it works

Careful when installing grub in the installation process. Although you can always from another GNU / Linux:

grub-install --debug --recheck --boot-directory = /mnt/boot /dev/sdX

where:

X, is the USB device b,c, etc . Example: /dev/sdb or /dev/sdc
--boot-directory = path /boot usb kali device mounted (/mnt/boot) on the GNU/Linux to run the command.