1

I have a Persistent USB that I made using UNetbootin. Home directory is just how I want it. What is the best way to upgrade the drive from 16.04 to 18.04?

C.S.Cameron
  • 19,519

1 Answers1

1

Persistent Flash Drive Upgrade

About the best we can do for a Persistent upgrade is reinstall program files and copy the existing home directory. User installed programs are listed in synaptic, make a copy, they will need to be reinstalled. The usual method of copying and syncing home folders is with rsync.

Unetbootin's Persistence file is casper-rw, it is the only thing that ever changes on a persistent USB. Casper-rw can not be reused from version to version of 'buntu, as all user installed programs need to be reinstalled. Casper-rw contains the standard set of folders for Ubuntu including the home folder. The home folder contains all of the users private data, desktop, documents, downloads, pictures, Browser favorites, etc. The home folder can be recycled from 'buntu version to 'buntu version. The home folder can be located in it's own persistence file named home-rw.

Method to extract home-rw file from casper-rw file.

Create or copy a casper-rw file, size to suit home directory up to 4GB, rename to home-rw.

Locate the home-rw file in the root of the persistent USB, along side of the casper-rw file.

Make directories in which to mount the persistence files

sudo mkdir /media/casper
sudo mkdir /media/home

Mount the persistence files

sudo mount -o loop casper-rw /media/casper/
sudo mount -o loop home-rw /media/home/

Run

sudo rsync -Hva --progress /media/casper/upper/home/ubuntu /media/home/

Delete the home folder from casper-rw or rename it as backup.

Next version upgrade just copy the home-rw file to the new install before first booting of the USB.

Persistent installs that use persistent casper-rw partitions, (ie mkusb), can similarly be upgraded, make sure the path in rsync is correct.

Grsync

Rsync is a little bit scary like dd, a little ignorance can go a long way. Grsync adds a GUI to rsync to make it a little less scary. I usually use Grsync when working with home directories.

Grsync

C.S.Cameron
  • 19,519