Install DUS/MKUSB :
sudo add-apt-repository ppa:mkusb/ppa
sudo apt update
sudo apt install mkusb mkusb-nox usb-pack-efi
dus
- i (install)
- p (persistent)
- Select the ISO
- If there is a question about USB image source, answer NO
- Activate EFI + MSDOS options
- 50% of size
- efi-1 most current cases
- Go!
sudo tune2fs -O has_journal /dev/sda5
Make sure the journal is enabled. The use_journal
feature must be visible there:
sudo dumpe2fs /dev/sda5 | grep "Filesystem features"
Only applies if a partition usbdata
. This partition acts as a regular USB stick, drop it to make the end image lighter.
sudo gparted
Flash th image on a stick, boot on it and install everything that needs to be persistent.
Few interesting settings to setup:
- Etcher
alias ll=ls -l
- Terminator x4
- VSCode
- net-tools git-cola python3-rosinstall
Things to delete:
/var/cache/apt/archives/*
/var/lib/dhcpcd5/*
/var/log/*
/var/tmp/*
/tmp/*
~/.bash_history
git config --global user.email ""
git config --global user.name ""
- With gparted resize partitions to a smaller size (e.g. 20GB for 32GB USB sticks. In any case keep >5GB of free space)
sudo dd if=/dev/yourstick of=disk.img bs=4M status=progress
sync
sudo fdisk -l disk.img
- Read the last end sector = END
truncate -s $(((END+1)*512)) disk.img
- Compress the img with 7z and share the archive to your recipients
- Unzip the 7z into
disk.img
dd if=disk.img of=/dev/yourtarget bs=4M status=progress
sudo sync
When copying a stick to another with a slighty smaller one, dd will complain that no space left on device and end GPT/partition tables are likely to be corrupted. To fix it:
sudo gdisk /dev/sda
r recovery menu
d use main GPT header (rebuilding backup)
e load main partition table from disk (rebuilding backup)
YES
w write table to disk and exit
YES