MBR-boot from a Debian\Kali ISO with persistence

This example is for Kali but should work with most Debian-based LiveCD ISOs which use a volume label of ‘persistence’ for their persistent filesystem and a ‘persistence.conf’ file.

The .isopersistdebian file extension used in this article is only for E2B Legacy booting – for UEFI and MBR booting with persistence, see here.

MBR-boot + persistence from ISO

Partition 3 on the USb drive must be free (unused).

1. Copy your Debian-based Linux LiveCD ISO to a menu folder such as \_ISO\LINUX.

2. Rename the file so that it looks nice as a menu entry (it can contain spaces and parentheses).

Ensure the file name does not contain any dots (otherwise the -rw persistence file will be displayed as a menu item in the E2B menu but it is not actually bootable).

Change the file extension of the .iso file to .isopersistdebian  (or .isopersistdebian64 if it is for 64-bit systems only).

e.g. Kali 2019 v2 amd64.isopersistdebian

3. Click on \_ISO\_Make_Ext.bat to make an ext3 persistence file of the required size. 

  • The persistence file must have exactly the same name as the ISO but with -rw at the end and it must have no file extension (no dot in the name). 
  • The persistence file must saved to the root of the E2B drive or to the same folder as the .isopersistdebian file.
  • Use ext3 and a volume name of ‘persistence‘.

You should now have these two files on the E2B drive:

  • \_ISO\LINUX\Kali 2019 v2 amd64.isopersistdebian
  • \_ISO\LINUX\Kali 2019 v2 amd64-rw

Tip: Instead of making your own persistence file, you can extract a ready-made ext4 file from here – e.g. persistence_ext4_512MB_persistence.dat. Extract one of the files of the required size and that ends in *persistence.dat which will work with Debian\Kali ISOs and rename the .dat file to Kali 2019 v2 amd64-rw (must match the name of your ISO plus ‘-rw’. You can then skip the remaining steps as the file will already contain the persistence.conf file.

You can also create a .txt file if you wish to change the menu entry.

4. Boot to the E2B menu system and select and run the .isopersistdebian file.

If the -rw persistence file cannot be found or if it does not have a volume name of ‘persistence’ you will be warned. In this case, fix the problem before continuing.

For the first boot, you should expect to see a warning message similar to ‘WARNING: persistence.conf is not present in xxxxxx-rw’ because the persistence file does not yet contain the correct contents.

5. Continue and choose the ‘Live USB Persistence‘ menu option…

6. Run a Terminal session (click on square black icon with $ sign) and make a persistence.conf file on the new 3rd partition of the USB drive.

In the example below which was run from a Virtual Machine, the USB drive is sda but on a real system it will be sdb or sdc, etc.

If you get an ‘Access denied’ error, then precede the command with ‘sudo’, e.g.

sudo bash -c "echo '/ union' > /mnt/usb/persistence.conf"

7. Now shutdown and reboot linux again using the same ‘Live USB Persistent’ menu option.

There should be now be no warning message from E2B.

To test that persistence is working, type df in a terminal session, you should see the persistence volume listed as /run/live/persistence

If you make any changes now (except for kernel updates which won’t work) they should be persistent.

You can instead use the _isopersistdebian.iso file extension so that the ISO file will also be seen by agFM\grubfm\Ventoy as a standard ISO

e.g.

  • \kali-linux-2022.2-live-amd64_.isopersistdebian64-rw
  • \_ISO\LINUX\kali-linux-2022.2-live-amd64_.isopersistdebian64.iso

By using ’64’ we ensure that the file is not listed in the E2B menu when you boot to E2B on a 32-bit CPU.

E2B (64-bit CPU) – Note that _.xxxxx.iso file extensions are not displayed in the E2B menu (unless you have configured it to show file extensions).

You can check the persistence.conf file inside your *-rw file by opening it in 7Zip – then select the conf file and press F3 to view the contents.

LUKS encryption

You can use a LUKS encrypted volume if the menu option is present, but it requires some additional commands.

This example assumes sdb is the E2B drive… 

cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb3
cryptsetup luksOpen /dev/sdb3 my_usb
mkfs.ext3 -L persistence /dev/mapper/my_usb
e2label /dev/mapper/my_usb persistence
mkdir -p /mnt/my_usb
mount /dev/mapper/my_usb /mnt/my_usb
echo "/ union" > /mnt/my_usb/persistence.conf
umount /dev/mapper/my_usb
cryptsetup luksClose /dev/mapper/my_usb

UEFI booting

See blog post here

Parrot OS – error: symbol ‘grub_file_filters’ not found – If you see this error on UEFIbooting from a .imgPTN file, it is because the grub2 version used does not understand the FAT32 filesystem that the linux files are now on.

To fix this, extract all the files from a Ubuntu x64 ISO’s  \EFI\BOOT folder and overwrite the files in the \EFI\BOOT folder of the FAT32 partition.

If you also want UEFI32 boot to work, repeat this using a Ubuntu or similar 32-bit ISO and copy the *.efi files over.

Get the eBooks!

This website contains over 150 pages of information about Easy2Boot but a selection of easy-to-read eBooks are also available (in PDF format) (rated 4.5/5 stars by readers).
Learn the secrets of Legacy and UEFI USB booting and then make your perfect multiboot USB drive.
E2B eBook #1 includes instructions on how to remove the E2B blue 5-second start-up delay screen.

Most eBooks are over 100 pages long, contain original content and step-by-step exercises which are suitable for both the beginner or the more experienced user.
Customer reviews are located at bottom of each eBook product page and multi-buy discounts are available when you buy more than one eBook. Please also visit RMPrepUSB.com and the E2B Forum.
Subscribe to my blog for the latest news, tips, USB boot articles and free eBook updates.