2

In the past I've run Kubuntu from a USB stick. Use it to download and stream movies/sports from pirate sites that would otherwise plague my windows OS with spyware, and can take it anywhere to use on any machine. Problem is, any time I do this, I need to configure the Kubuntu OS with desired settings and add-ons to maximize the experience, which is time consuming.

Is it possible to configure Kubuntu to my liking, then generate a bootable USB stick with these settings in place, so that when I book from the stick, all of my favorite settings/software/add-ons are all set to go without any configuring?

muru
  • 197,895
  • 55
  • 485
  • 740
  • Well, in a sense yes, you can create a persistent live system using mkusb. You can install programs and modify settings, and they will persist, which is what you want. But spyware and other nasty things might also persist. You could backup the 'master system' and restore to that system after lurking at fishy websites. – sudodus Jul 20 '20 at 14:43
  • Thanks for the prompt response. Will take a look. This should be ideal. I use a very basic bare-bones system for this purpose, so starting from scratch is not big deal. It would just be nice if I didn't have to do it every single time, so mkusb should be the right solution. – rheostatic Jul 20 '20 at 19:13
  • The only thing that changes on a persistent USB are the persistence partitions, casper-rw (now labeled writable) and home-rw, (if used).. With mkusb the system partition is read only and can't be corrupted. Mkusb can make backups of your home folder. It is also possible to make a backup image of your writable partition and store it in mkusb's NTFS usbdata partition so the persistence partition can be reset as needed. Just boot in mkusb's toram mode when overwriting partitions. – C.S.Cameron Jul 21 '20 at 04:55

2 Answers2

1

Persistent USB with easy to reset writable partition

The only thing that changes on a mkusb persistent USB is the persistence partition, casper-rw (nowadays labeled writable) and the NTFS usbdata partition.

enter image description here

With mkusb the system partition is read only and can't be corrupted. Mkusb comes with an option for making backups of your home folder, the most likely item to get corrupted.

enter image description here

It is also possible to make a backup image of your writable partition using the included Gnome-Disks and then store the image in mkusb's usbdata partition, so that the persistence partition can be reset, (overwritten), as needed. Just boot using mkusb's toram mode when overwriting partitions.

C.S.Cameron
  • 19,519
0

Ventoy can create a bootable USB (even with multiple Linux distributions) with persistence, so your changes are saved on the stick across reboots.

Download Ventoy from here, install it on an USB stick using:

sudo ./Ventoy2Disk.sh -i /dev/sdX

Where "sdX" is the USB drive. This formats the drive!

Now any ISO copied to the USB stick will be bootable. With multiple ISOs, you'll get a menu when booting from the USB stick.

For persistence support, you'll need to create the persistence file using (e.g. for 4 GB):

sudo ./CreatePersistentImg.sh -s 4096

The created image file is called persistence.dat, and it should be available in the Ventoy folder (next to the CreatePersistentImg.sh script). Plug-in the USB stick on which you've installed Ventoy, and copy this persistence.dat file to the USB drive.

On the USB drive on which you've installed Ventoy, create a folder called ventoy. Inside this folder create a file called ventoy.json, and open this file with a text editor.

Inside the file, paste this:

{ 
 "persistence" : [
    { 
       "image": "/ISO-file-name.iso",  
        "backend": "/persistence.dat" 
     }
   ] 
 }

Replace ISO-file-name.iso with the ISO filename (and path if it's not in the root of the USB), and persistence.dat with the persistence image filename and path (in case you've changed the name and didn't place it in the root of the USB).

Guide from here.

Logix
  • 2,230