I have a flash drive, whose information given by sudo fdisk -l is

Device     Boot Start     End Sectors  Size Id Type
/dev/sdb1           1 7864319 7864319  3.8G  c W95 FAT32 (LBA)

I would like to know how I can use the flash drive for two things simultaneously:

  1. a bootable flash drive for Lubuntu 18.04, which is 1GB

  2. for storing temporary personal files.

Originally I created a bootable flash drive for Lubuntu 18.04, by

dd /path/to/ubuntu.iso /dev/sdb

After installing Lubuntu to my laptop, I didn't know how I could continue to use the flash drive as temporary storage of other personal files, so I asked how to revert the flash drive back to a storage device for my other personal files only, and followed the reply there to change my flash drive to be what I have shown at the beginning of this post.

Now I think that in case that my Lubuntu can't boot for whatever reason, I still need to run the OS on a bootable flash drive to retrieve the files on the file systems on my laptop. So here I am asking how I can create a bootable flash drive for Lbuntu and also store temporarily other personal files in the same flash drive.



Persistent live drive

You can use mkusb to make a persistent live drive with Lubuntu.

  • Very portable between computers
  • Personal files can be saved
  • Application programs can be installed (but new kernels and hardware drivers cannot be used)
  • Sensitive to corruption, so you need frequent backups.

Installed system

You can also create an installed linux operating system in a USB drive, but this 4GB pendrive is too small for that purpose. In order for an installed system to work well, you should have a fast USB3 pendrive with at least 16 GB.

  • Portable between computers, but not as portable as a [persistent] live system.

  • Flexible, can be made up to date, 'all' program packages, kernels and drivers can be installed. But if you install a proprietary driver for graphics or wifi, the portability may be reduced.

  • Very stable except that Windows may hijack the boot system in UEFI mode. This can happen, when you boot Windows with this drive connected, and Windows does a major upgrade.

Background information

  • Cloning: dd is a very powerful but also very dangerous tool, often nicknamed 'disk destroyer' or 'data destroyer'. dd is used to clone an iso file to a USB pendrive. When creating live-only USB boot drives, mkusb 'wraps a safety belt around dd'. This method works for all hybrid iso files, and most modern linux distros provide this kind of iso files. The new Ubuntu Startup Disk Creator in 16.04 LTS uses the cloning method too.

  • Many other tools extract the content of the iso file to a FAT32 partition, for example Rufus and Unetbootin. (Rufus has also a cloning dd mode.)

  • mkusb is a linux tool. It does not work in Windows.

  • mkusb is a bash script, that uses several standard tools, available in most linux distros. mkusb uses zenity for a graphical user interface when available.

  • mkusb-nox (No X) works in text mode, for example in Ubuntu Server. mkusb-dus (alias mkusb version 12) can work in text mode too with dialog text mode menus or with a plain text interface.

  • Some of the other tools consist of compiled code.

  • mkusb can also work as an extracting tool and create persistent live systems for Debian and Ubuntu. These systems are booted via grub2, and the iso file is cloned to a separate partition. A casper-rw partition will be created for persistence and a usbdata partition will be created for storing data and sharing data with computers running Windows. These persistent live systems can boot in UEFI and BIOS mode.

  • mkusb-nox and mkusb-dus (alias version 12) can create a USB installer for Windows 7-10 via extraction. It uses the grub-pc package to install grub2, which makes the USB pendrive boot in BIOS mode. This system can boot in UEFI and BIOS mode.

  • mkusb does not create multi-boot USB drives. There are other tools for that purpose.

  • mkusb can also wipe confusing data and/or restore a USB boot drive to a standard storage device with an MSDOS partition table and a FAT32 file system.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.