Notes on setting up Porteus v5.0

Aim: install a lightweight Linux onto a bootable USB. Boot Linux computer using Porteus USB (sdb1) instead of the Ubuntu server on the HDD (sda1,sda2). When in Porteus, use tools to completely backup the Linux computer's Ubuntu installation.
Requirements: Linux must boot from USB, be able to access the existing partitions (/dev/sda1,/dev/sda2), must have utilities installed: dd, gzip. Must be able to save the copied partition information to either (a) the USB, or (b) a cifs (SMB) or nfs network share.
Know which partition that you will need to backup.

lsblk -o NAME,SIZE,FSTYPE,FSSIZE,FSUSED,FSUSE%,MOUNTPOINT,PARTTYPENAME,STATE
sda                       447.1G                                                                     running
├─sda1                        1M                                                    BIOS boot
├─sda2                        2G ext4          1.9G 252.4M    13% /boot             Linux filesystem
└─sda3                    445.1G LVM2_member                                        Linux filesystem
  └─ubuntu--vg-ubuntu--lv   100G ext4         97.9G  15.3G    16% /                                  running

Reviwing the above response, sda1 is boot, sda2 is swap, sda3 is the root partition we want.

##################
### PuTTY
# Windows app to connect to your server via secure sockets SSH
# https://www.putty.org

# Download Ubuntu ISO
# Make a bootable USB stick using Rufus on a windows computer
# When installing Ubuntu don't tick everything, you can apt install it later
### Porteus
# Portable Linux
# http://www.porteus.org
# Porteus-XFCE-v5.0rc1-x86_64.iso

# Negatives:
# NFS not properly working (v5.0)
# nano/pico not installed
# no apt-get
# stopping / starting services?
# not peristent without moderate effort

### Rufus
# Write the ISO to a USB for booting
# https://rufus.ie/

### username password:
# guest guest
# root toor

### Persistence
# By default, Porteus will boot fresh, no changes you made will be saved,
# including no files, no system, no installs, etc. Absolutely nothing is saved.
# save files = files remain after bootup
####
# Create a file to save persistent data file
# Applications > System > Porteus Save File Manager
# - max 4Gig changes data file
####
# Update config to make use of the file created by above process
vi /mnt/sdb1/boot/syslinux/porteus.cfg
#--- File: /mnt/sdb1/boot/syslinux/porteus.cfg
LABEL GRAPHICAL
MENU LABEL Graphics mode
KERNEL /boot/syslinux/vmlinuz
INITRD /boot/syslinux/initrd.xz
APPEND changes=EXIT:/mnt/sdb1/porteussave.dat
TEXT HELP
    Run Porteus the best way we can.
    Changes saved on exit - Persist!
ENDTEXT
#--- END File

### CIFS
# Connect to network shared folder where you want to store your archive. Substitute in your own connection details until you can properly mount the network folder.
mkdir /mnt/nuc
mount -t cifs //192.168.0.55/nucshare /mnt/nuc -o username=thomas

### Backup
# Src linux drives (Ubuntu) on sda3
dd if=/dev/sda3 bs=64M | gzip --fast | dd bs=32M of=/mnt/nuc/porteus/backup-sda3.gz
# Note: (1) I have a 240Gig SSD claims to have used 20Gig, generated a 3.85Gig .gz file
# (2) My 100Gig SSD claims to have used 15Gig, generated a 7.30Gig .gz file

### Restore
dd /mnt/nuc/porteus/backup-sda3.gz bs=32M | gzip --decompress | dd bs=64M of=/dev/sda3

# Other
# Porteus Linux: A portable Linux with a difference
# The 8 Smallest Linux Distros That Are Lightweight and Need Almost No Space