How do you create a live persistent Ubuntu USB on a Mac that will boot to a Mac or PC?

Cloning and maybe a second step

You can use a one-step or two step procedure. dd is a powerful but also dangerous tool, that is 'always' available in a MacOS. Be very careful, check and double-check, that everything is correct, before you start the cloning process.

  • One step: If you find a [compressed] image file of an Ubuntu [based] system, that is persistent live, and can do what you want, clone it to a USB pendrive or a memory card. If the downloaded file is compressed, you need to extract it before cloning, for example

    file.img.zip --> file.img

    file.img.xz --> file.img

    Unmount all partitions on the target drive and run dd

    sudo dd bs=1m if=path_of_your_image.img of=/dev/rdiskn
    

    where n is a number (for example, /dev/rdisk4).

    There are tips in this link.

  • Two steps: Download and clone a [compressed] image file of an Ubuntu [based] system, that is persistent live, and contains mkusb.

    Boot from from the USB pendrive or memory card which was made bootable by cloning.

    Download an iso file of the Ubuntu version and flavour, that you want to install as persistent live.

    Run mkusb-dus and create a persistent live drive in another USB drive or memory card.

  • Links

    Installing operating system images on Mac OS (www.raspberrypi.org)

    help.ubuntu.com/community/mkusb

    help.ubuntu.com/community/mkusb/persistent

    Compressed image file with a persistent live system and mkusb


You should be able to accomplish this using diskutil. I last used this method on Sierra, so ymmv on anything later.

$ diskutil list
$ diskutil eraseDisk FAT32 UBUNTU /dev/<YOUR USB DISK ID>
$ diskutil unmountDisk /dev/<YOUR USB DISK ID>
$ sudo dd if=<path to ubuntu live iso> of=/dev/<YOUR USB DISK ID>

Once that completes you need to restart and boot from the live usb.

Once it boots start gparted from the terminal.

Select the USB drive and select the Unallocated partition on it.

Create a new partition, label it ext3/ext4(unsure if other filesystems will work. never tried.) with the label persistence

Exit gparted

Create a mountpoint for your new persistence partition.

$ mkdir -p /mnt/ubuntu_usb $ mount <USB DRIVE> /mnt/ubuntu_usb

TO enable the persistent storage you need a persistence.conf.

$ echo "/ union" > /mnt/ubuntu_usb/persistence.conf
$ umount <DISK>

Restart the mac and hold down the Option key. You should hopefully have an option for Ubuntu (persistence) to boot from now