Return to the main mkusb page


Persistent live systems

Most of the time it is enough with a live only USB pendrive and only a waste of effort to create a persistent live system. The cloning method of mkusb is very reliable and works with most linux distros. It needs hybrid iso files. But sometimes it is better to have a persistent live system, and beginning with version 10 mkusb can create such systems.

mkusb

mkusb version 10-11, classic

../pictures/persist-01-persistence-selected-small.png

mkusb version 12, dus

../pictures/persist-01-select-persistence-1202-small.png

../pictures/dus-24-persistent-live-system_quick-start-manual.png

Method developed from 'grub-n-iso'

This persistent live system is developed from booting via grub and the ISO file 'grub-n-iso' by Andre Rodovalho, described in

One pendrive for all PC (Intel/AMD) computers - single-boot dual-boot multi-boot and

How to Create a EFI/UEFI GRUB2 Multiboot USB drive to boot ISO images

The same pendrive can boot in UEFI mode and BIOS mode with a 32-bit operating system. Today 64-bit operating systems can boot almost all except the oldest computers. But this persistent live system cannot boot with secure boot. Data from usb-pack_efi.tar.gz are used to boot.

Using data from the source iso file

The grub boot system can be copied from an amd64 iso file. It can be modified slightly (to make a menuentry for persistence and to point to another partition). This works with the amd64 (64-bit) systems based on Ubuntu also with secure boot.

Persistent live systems made with this method boot in UEFI mode and can be made to boot in BIOS mode, if the program grub-install is available. And it is, except in installed systems running in UEFI mode, where the package grub-pc cannot be installed without conflict with existing EFI grub packages. So this method provides a tool the make persistent live systems in UEFI mode and for UEFI mode (for amd64 systems).

In a live or persistent live system it is 'always' possible to install grub-pc, so it is possible to create systems that boot also in BIOS mode from a persistent live system running in UEFI mode.

Compressed image file with a persistent live system

Use a cloning tool, for example Disks or mkusb in linux, or 7-zip and Win32 Disk Imager in Windows to expand and {copy/clone/flash/burn/restore/install} this kind of files into a USB pendrive, a flash memory card or a hard disk drive or SSD with at least 8 GB. You can expand one or more partitions in order to use the whole drive, if it is bigger than 8 GB. This is described in the following link: growit.pdf; alternate link: ../../Installation/UEFI-and-BIOS/GrowIt.pdf

Short explanation: The reason to create such images with mkusb is that, if the computer runs an installed Ubuntu system in UEFI mode, it will not be possible to install and use the package 'grub-pc' to make the target persistent live drive bootable in BIOS mode (because there is a conflict with 'grub-efi'). But in a persistent live Ubuntu, both 'grub-pc' and 'grub-efi' can be installed alongside each other. So it is possible to create systems that boot also in BIOS mode from a persistent live system running in UEFI mode.

There is a question "Why are img files provided for mkusb persistent but only iso file are allowed?" and an answer at AskUbuntu: with a more detailed explanation.

Download one of the following compressed image files from one of these links,

drive.google.com/open?id=0BzX-18u3W1sQUXI2YV95dHJxVlE

phillw.net/isos/linux-tools/uefi-n-bios

If one link does not work, please try the other one.

Lubuntu 14.04.3 LTS (32 bit) and mkusb version 10.4

A compressed image file with a persistent live system of Lubuntu 14.04.3 LTS (32-bit) and mkusb version 10.4 can be installed into a USB pendrive or flash memory card. If you run Ubuntu installed in UEFI mode, it provides an alternative to create persistent live systems that work in BIOS mode, and even for 32-bit computers.

See this link to post #49 in the thread 'One pendrive for all PC (Intel/AMD) computers - single-boot dual-boot multi-boot' for more details.

Lubuntu 16.04.2 LTS (32 bit and 64 bit) with mkusb 12.1.4

If the explicit link (to http://phillw.net/isos/linux-tools) does not work, please try drive.google.com/open?id=0BzX-18u3W1sQUXI2YV95dHJxVlE

dd_Lubuntu_16.04.2_i386_persist-live_mkusb-12.1.4_7.8GB_msdos-pt.img.xz

for 32 & 64 bit in BIOS & UEFI mode, not secure boot; msdos partition table, suitable when not installing with mkusb, for example in Windows

dd_Lubuntu_16.04.2_amd64_persist-live_mkusb-12.1.4_7.8GB_guid-pt.img.xz

for 64 bit in BIOS & UEFI mode, works in secure boot; gpt, which is good for big drives but needs fixing (done automatically by mkusb)

dd_Lubuntu_16.04.2_amd64_persist-live_mkusb-12.1.4_7.8GB_msdos-pt.img.xz

for 64 bit in BIOS & UEFI mode, works in secure boot; msdos partition table, suitable when not installing with mkusb, for example in Windows

  • Advantages: flexible and stable systems, that work in most PC computers
  • Disadvantage: Two systems (image files) are necessary to work in all computers. The 32-bit version does not work with secure boot, and the 64-bit version does not with with 32-bit computers
  • You find more information about these Lubuntu systems at the following link, /lubuntu.

Very flexible LXLE 16.04.2 system (32 bit) with mkusb version 12.1.5

If the explicit link (to http://phillw.net/isos/linux-tools) does not work, please try drive.google.com/open?id=0BzX-18u3W1sQUXI2YV95dHJxVlE

Download the compressed image file from the following link

dd_LXLE_16.04.2_i386_persist-live_mkusb-12.1.5_7.8GB_msdos-pt.img.xz

and check the md5sum

2576227d0fed29d57acc94f9f2c5a11d  dd_LXLE_16.04.2_i386_persist-live_mkusb-12.1.5_7.8GB_msdos-pt.img.xz

New improved version, dated 2017-05-13:

dd_LXLE_16.04.2_i386_persist-live_mkusb-12.1.5_2017-05-13_7.8GB_msdos-pt.img.xz

and check the md5sum

a1e024206ca328779cce3891d8b9c17e  dd_LXLE_16.04.2_i386_persist-live_mkusb-12.1.5_2017-05-13_7.8GB_msdos-pt.img.xz
  • The system is very flexible. It works in 32 & 64 bit computers in BIOS & UEFI mode, also in secure boot. There is an msdos partition table, suitable when not installing with mkusb, for example in Windows.

  • Advantages: very flexible and stable system, one image works for 'almost all' PC computers.
  • Disadvantage: big image file, ~ 2GB.
  • You find more information about this LXLE system at the following link, /LXLE. There are screenshots from running in old, middle aged and [rather] new computers (2004-2016).

Very flexible Bodhi Linux 4.1.0 system (32 bit) with mkusb version 12.1.5

If the explicit link (to http://phillw.net/isos/linux-tools) does not work, please try drive.google.com/open?id=0BzX-18u3W1sQUXI2YV95dHJxVlE

Download the compressed image file from the following link

dd_bodhi-4.1.0-32_i386_persist-live_mkusb-12.1.5_7.8GB_msdos-pt.img.xz

and check the md5sum

ed9e72c9cd18205173e92b5ac6f11e6c  dd_bodhi-4.1.0-32_i386_persist-live_mkusb-12.1.5_7.8GB_msdos-pt.img.xz
  • The system is very flexible. It works in 32 & 64 bit computers in BIOS & UEFI mode, also in secure boot. There is an msdos partition table, suitable when not installing with mkusb, for example in Windows.

  • Advantages: very flexible, modern and rather small system (~800 MB, smaller than the corresponding Lubuntu and LXLE images), one image works for 'almost all' PC computers.
  • Disadvantage: The system is not as stable as Lubuntu and LXLE.
  • You find more information about this Bodhi system at the following link, /bodhi. There are screenshots from running in an old and a [rather] new computer (2004, 2016).

Small and low resource text mode Debian live 8.8.0 (64-bit) with mkusb version 12.1.8

If the explicit link (to http://phillw.net/isos/linux-tools) does not work, please try drive.google.com/open?id=0BzX-18u3W1sQUXI2YV95dHJxVlE

Download the compressed image file from one of the following links

dd_text_Debian-live-8.8.0-amd64_persist-live_user-live_mkusb-12.1.8_2017-05-19_4GB_msdos-pt.img.xz

dd_text_Debian-live-8.8.0-amd64_persist-live_user-live_mkusb-12.1.8_2017-05-21_4GB_msdos-pt_ssh-with-password.img.xz

and an updated compressed image with mkusb version 12.2.1:

dd_text_Debian-live-8.8.0-amd64_persist-live_user-live_mkusb-12.2.1_2017-06-01_4GB_msdos-pt.img.xz

and check the md5sum

6d6c0deb0a192d95d9e206700bd979b9  dd_text_Debian-live-8.8.0-amd64_persist-live_user-live_mkusb-12.1.8_2017-05-19_4GB_msdos-pt.img.xz

a704d2fdd871465536fa6148ca0b35f7  dd_text_Debian-live-8.8.0-amd64_persist-live_user-live_mkusb-12.1.8_2017-05-21_4GB_msdos-pt_ssh-with-password.img.xz

e5febbfadb784c678bf62dcf026da675  dd_text_Debian-live-8.8.0-amd64_persist-live_user-live_mkusb-12.2.1_2017-06-01_4GB_msdos-pt.img.xz

These systems come in small files compared to the corresponding persistent live systems with graphical desktops (~470 MiB) and need not much hardware in order to run. They work in 64-bit computers in BIOS & UEFI mode (not in secure boot). There is an msdos partition table, suitable when not installing with mkusb, for example in Windows.

  • It is easy to connect remotely via ssh to the version '...ssh-with-password.img.xz'.
    • user: user

    • password: live

    • Please be aware of the risk, when using remote login with a password. So even if you change the password, you should only use that system behind a router with a firewall.
  • Advantages: modern, should boot in new computers, small, low resource, drivers for advanced graphics chips not necessary (because of text mode).
  • Disadvantages: 'only' text mode, limited support for network hardware compared to the Ubuntu based systems, does not work in 32-bit computers.

Very small and low resource text mode Clonezilla live 2.5.0-25 (64-bit) with mkusb version 12.1.8+

If the explicit link (to http://phillw.net/isos/linux-tools) does not work, please try drive.google.com/open?id=0BzX-18u3W1sQUXI2YV95dHJxVlE

This might be a useful tool for new computers, because it is

  • modern, uses Debian's 64-bit linux kernel 4.9.6-3 (2017-01-28)
    • works in UEFI mode and BIOS mode (but not with secure boot)
  • small, compressed image size, ~260 MiB, expands to 4 GB, so it fits in a 4GB USB pendrive or memory card
  • simple, uses text mode, so less problems with drivers for graphics chips/cards
  • low resource, uses very little RAM
  • combination tool, you get both Clonezilla and mkusb

Download the compressed image file from one of the following links

dd_text_clonezilla-live-2.5.0-25-amd64_persist_mkusb-12.1.8_2017-05-23_4GB_msdos-pt.img.xz

dd_text_clonezilla-live-2.5.0-25-amd64_persist_mkusb-12.1.8_2017-05-23_4GB_msdos-pt_ssh-with-password.img.xz

and check the md5sum

d781cb88b917bed0e0d050f74c417a3d  dd_text_clonezilla-live-2.5.0-25-amd64_persist_mkusb-12.1.8_2017-05-23_4GB_msdos-pt.img.xz

f12b557f2806379b494d35d03b1312eb  dd_text_clonezilla-live-2.5.0-25-amd64_persist_mkusb-12.1.8_2017-05-23_4GB_msdos-pt_ssh-with-password.img.xz

These systems come in small files compared to the other persistent live systems with mkusb (246 MiB and 260 MiB) and need not much hardware in order to run. They work in 64-bit computers in BIOS & UEFI mode (not in secure boot). There is an msdos partition table, suitable when not installing with mkusb, for example in Windows.

  • It is easy to connect remotely via ssh to the version '...ssh-with-password.img.xz'.
    • user: user

    • password: live

    • Please be aware of the risk, when using remote login with a password. So even if you change the password, you should only use that system behind a router with a firewall.
  • Advantages: modern, should boot in new computers, small, low resource, drivers for advanced graphics chips not necessary (because of text mode).
  • Disadvantages: 'only' text mode, limited support for network hardware compared to the Ubuntu based systems, does not work in 32-bit computers.
  • You find more information about this Clonezilla system at the following link, /clonezilla. There are screenshots from running in BIOS mode and UEFI mode.

Screenshots

Lubuntu:

../pictures/persist-28-lubuntu-with-mkusb-welcome.png

LXLE:

../pictures/persist-26-LXLE-with-mkusb-welcome.png

Bodhi Linux:

../pictures/persist-27-bodhi-with-mkusb-welcome_800x600.png

Debian live:

../pictures/debian-01-ssh-into-Debian-live-8.8.0-amd64_persist-live_user-live_mkusb-12.1.8_2017-05-19.png

Clonezilla:

../pictures/clonezilla-02-starter-screen-UEFI.png

Small 9w systems with guidus alias mkusb-dus and gparted installed

If the explicit link (to http://phillw.net/isos/linux-tools/9w) fails, please try drive.google.com/open?id=0BzX-18u3W1sQUXI2YV95dHJxVlE

There are small files, only 230 MiB, as iso files, compressed image files and self-extracting exe files, that can provide systems with mkusb version 12 alias dus, guidus (June 2 2017). These systems can be cloned from their files to USB pendrives or memory cards in Windows as well as linux. These are 32-bit systems, that normally only boot in BIOS mode. One 9w image can boot in UEFI mode (but not with secure boot). It is a persistent live system using usb-pack-efi to allow booting also in UEFI mode.

See the following links,

9W/Small 9w iso file with guidus and gparted installed

http://phillw.net/isos/linux-tools/9w/

Win32DiskImager/compressed-image_2_USB-or-SD

9W-DUS_i686.exe

These 9w systems can be used to create live-only as well as persistent live drives with Ubuntu and Debian Jessie.

../pictures/niow-12_9w-dus12.1.9-screenshot_800x600.png

../pictures/niow-13_9w-dus12.1.9-screenshot_work-done.png

The following link describes how to make a Knoppix system with mkusb, ../install-to-debian#Knoppix

Partitions

When you select persistent mkusb creates a partition for persistence in the target drive and the target system can use it automatically. It creates totally five partitions automatically for you.

In a separate menu window you can choose between a GUID partition table, GPT, and an old style MSDOS partition table. Normally GPT is recommended (and it works with huge drives (greater than 2 TB), but many HP computers need an MSDOS partition table to boot directly from USB.

The first partition, labeled 'usbdata', is actually located at the end of the drive, but it has number one because several Windows versions will only read the first partition (of the partition table) on USB drives. This partition has an NTFS file system, and can be used both when connected to a computer running linux and Windows, so it is suitable for transfer of files as well as a common storage.

The second partition is used to store program code for the grub BIOS bootloader if a GUID partition table, GPT, and as an extended partition, a container for logical partitions if an MSDOS partition table.

The persistent live drive boots from the third partition with a FAT32 alias vfat file system.

The operating system is cloned from the iso file to the fourth partition.

The fifth partition with an ext4 file system stores the overlay data for persistence.

  • partition: (NTFS) usbdata for storage and transfer of files

  • partition: GPT: bios_grub flag for booting in BIOS mode; MSDOS: extended partition

  • partition: (FAT32) boot partition

  • partition: (ISO 9660) cloned iso file

  • partition: (ext4) casper-rw or live-rw or persistence

../pictures/persist-05-mkusb-console-only-partitions-3.png

Comparison with 'live only' systems

Otherwise, when you select live only mkusb clones the iso file and there will be no persistence (except with some openSUSE iso files, that make persistent live systems as cloned). This kind of cloned system with an Ubuntu 64-bit operating system can boot also in secure mode.

Advantages

  • works with all current Ubuntu flavour desktop files (Ubuntu, Kubuntu, Lubuntu, ... Xubuntu) and with Linux Mint, LXLE, ToriOS, several other distros/re-spins based on Ubuntu and with Debian Jessie
  • very safe (minimal risk to overwrite the wrong drive by mistake)
  • easy to use
  • the target drive with the persistent live system works in [almost] all PC (Intel/AMD) computers

Disadvantages

  • works but less flexible in installed systems running in UEFI mode
  • cannot make a system that works in 32-bit systems as well as with secure boot with Ubuntu family iso files, but it works with LXLE and Bodhi Linux.
  • does not work with linux distros that are not based on Ubuntu or Debian (maybe you can tweak the grub.cfg file and make it work)
  • does not work with non-desktop iso files for example the Ubuntu mini.iso or the Ubuntu Server
  • in some computers (for example middle-aged HP desktop and laptop computers), ToriOS can boot only with a cloned 'live-only' pendrive, and with the system of method 3 from the compressed image file

Alternatives

Unetbootin and the 'Ubuntu Startup Disk Creator' alias usb-creator 0.2.x can also be used, when you want persistence in the target drive. They create and use a casper-rw file with the maximum size 4 GB (due to the file system FAT32). (But usb-creator version 0.3.2 in Xenial Xerus is cloning like mkusb makes live-only drives.)

Persistence works with an ext2, ext3 or ext4 partition with the label casper-rw, and that partition can be 'anywhere', in another pendrive or in an internal drive (which makes it faster). Persistence with an ext partition 'anywhere' works when booting from a DVD as well as from a cloned iso file (from a pendrive made by mkusb). Just add the boot option persistent when you want persistence. Then the live system will search for a casper-rw file or casper-rw partition.

Debian Jessie uses the partition label or file name persistence and ToriOS uses live-rw (instead of casper-rw, and this is managed by mkusb).

You can also create a home-rw partition to store the content of your home directory and it will survive even if the system modifications are damaged in the casper-rw partition.

'Download and install automatically' can break persistent live media

Look at the persistent live Ubuntu 16.04 LTS system - the 'Software & Updates' screen / 'Update' - and notice, that 'Automatic updates' is set to Download and install automatically alias 'unattended upgrades'. This can create severe problems in a persistent live system.

After leaving the persistent live Ubuntu 16.04 LTS system running overnight, it had performed an automatic upgrade:

df revealed that the content in casper-rw had increased to 1.6 GiB (in a fresh system with an almost empty casper-rw partition).

Discussion

If not enough space (and inodes) in the casper-rw partition or file, the upgrade operation will be incomplete and fail. There might be big problems even if there is space left in casper-rw. Finally, it is wasting the available space, if you have a small casper-rw partition or casper-rw file.

This is caused by a change of the default action, when there are security updates. A survey indicates that this default setting is different between the flavours and versions of Ubuntu. Lubuntu keeps the setting 'Display immediately', while the other tested flavours change it from 14.04 LTS to 16.04 LTS.

Select 'Display immediately', if your flavour and version is affected

Until this is resolved, it is a good idea to select 'Display immediately' via the graphical interface, but above all, to take regular backups, when you use a persistent live system. If you want more details, see the following link with screenshots from different Ubuntu flavours and versions:

Re: Unattended-upgrades can break persistent live media

Solution for iso file versions that are affected

Change the default settings by mkusb

A method to change from 'Download and install automatically' to 'Display immediately' was tested in mkusb version 11.0.2, and is available in the current versions of mkusb. See ../v11.

Change the default settings in the Ubuntu flavours

The bug report Bug #1619188: Unattended upgrades can break persistent live media was created at Launchpad in order to change the default settings for security updates for persistent live and live-only systems. The current setting 'Download and install automatically' is good for installed systems. The bug affects Ubuntu 16.04 and 16.04.1. It is squashed in Ubuntu 16.04.2 LTS.

Backup and restore of persistent overlay data

The partition that stores persistent overlay data is easily damaged, particularly if you remove the pendrive before it is unmounted.

It is a good idea to use persistence to add functionality by installing packages and tweak the system to what you like. But it is bad idea to update/upgrade a persistent live system continuously. Then you will soon get a borked system.

If/when the persistence no longer works you may need to start all over again by removing what has been stored. Often you can keep the [overlay copy of the] home directory (and delete all other subdirectories of your overlay system in the casper-rw partition). Delete while running it live-only! This will save many settings, tweaks and personal files, but you must reinstall the program packages, that have been added.

Therefore it is important to have a convenient way to backup and restore the persistent data. This was introduced in mkusb 10.3.4 with shell-scripts to make it easy to backup and restore the overlayed persistent data of the persistent live system created by mkusb. These shell-scripts are written to

  • /dev/sdx1 mounted at /media/xubuntu/usbdata and

  • /dev/sdx3 which can be mounted at /mnt.

These scripts work in linux operating systems based on Ubuntu. In some versions, they are not executable, but can be run as parameter to bash. Boot into the live-only mode and run the scripts according to the following examples. (The scripts will complain if you try to use them in persistent mode.)

Backup example

cd /media/xubuntu/usbdata
ls -l
bash backup

Restore example

cd /media/xubuntu/usbdata
ls -l
bash restore

Automatic tarball names

The name of the tarball file (containing the backup) is updated automatically to create versions. Remove old versions manually!

1-casper-rw.tar.gz
2-casper-rw.tar.gz
3-casper-rw.tar.gz
...

Copy the tarball to another drive

Finally, to be sure the backup survives, you should copy the tarball to another drive, that you keep somewhere else, so that both backup copies are not lost. If you use the pendrive regularly, you should make backup copies of the casper-rw partition regularly too, maybe once a week or twice a month.

Select another directory/file

It is also possible to select another directory where to write/read the tarball. In that case, you add a parameter to the command line, for example

bash backup /media/xubuntu/backup  # target directory in another drive, a 'backup' drive

bash restore /media/xubuntu/backup/1-casper-rw.tar.gz  # source tarball in another drive, 'backup'

The commands under the hood of backup and restore are described in this post in the Ubuntu Forums.

Screenshots

See the whole screenshots at /LXLE#Backup_and_Restore

../pictures/persist-26-LXLE_16_04_02_32_persistent_live_backup-and-restore_after-backup_truncated.png

../pictures/persist-26-LXLE_16_04_02_32_persistent_live_backup-and-restore_after-restore_truncated.png


Return to the main mkusb page

mkusb/persistent (last edited 2017-06-21 07:53:23 by ister-kokos)