Creating and installing Multiple Distros in to USB / Pendrive involves two parts:-
"After googling around for few days i found this useful script from www.multicd.tuxfamily.org. Multicd.sh is a shell script written by maybeway36 which enables two or more Live Linux distros / utilities to be able to boot from single CD/DVD. It is really very simple to create multi Live Linux distro in a single disc. Create a folder in your home folder and name it as multicd
. Put all the live Linux iso images along with multicd.sh script inside multicd folder. Close the window. Open terminal and give the following commands
cd multicd
chmod +x multicd*.sh
sudo ./multicd*.sh
Above commands will execute multicd.sh. While executing, this script will download few packages from Internet and make a new iso image called multicd.iso for you inside multicd folder. Check the size of multicd.iso image file. If it exceeds more than 700 mb then you must insert DVD to write it. Choose burn image option from your favorite image burning software to write multicd.iso file. Upon reboot, with the CD/DVD present inside CD/DVD drive, new GRUB will display list of live distros available in the disc. Choose your favorite one to login...
Note: When you download any Linux iso image from internet it will look like this "ubuntu-9.04-desktop-i386" but this has to be renamed as ubuntu.iso (inside multicd folder). Presently this script supports 20 live distros. List of Live Linux distros supported in this script are given below (and the names accepted by this script are on the right side of each distro)."
There's a list of distro's on the blog page.
- Installing Multiple Live distro in to a USB / Pendrive.
UNetbootin allows you to create bootable Live USB drives for Ubuntu, Fedora, and other Linux distributions without burning a CD. It runs on Windows, Linux, and Mac OS X. You can either let UNetbootin download one of the many distributions supported out-of-the-box for you, or supply your own Linux .iso file if you've already downloaded one or your preferred distribution isn't on the list.
Support amongst others: Ubuntu (and official derivatives) 8.04 LTS 9.10 10.04 LTS 10.10 11.04 Daily CD Images, Fedora 10, 11, 12, 13, 14, Rawhide and lots lots more.
If you look at them image you can choose distro's or download ISO's yourself and add them or add a custom. And you can set this up on a hard disc or a USB flash drive.
I hope it is enough information but there is a lot more info on this blog.
What i did is I modify casper script inside initrd.lz.
The script will mount casper-rw as read-only and then on overlay it on top of /.
It will then mount tmpfs on top of the overlay.
I use mint btw, not sure about ubuntu, hope it works for you.
Here are more details:
- Extract initrd using instruction from here.
Edit scripts/casper, modify the setup_unionfs()
function.
You find the modified function here.
...
p_ro_mount=""
if [ -n "${PERSISTENT}" ]; then
cowprobe=$(find_cow_device "${root_persistence}")
if [ -b "${cowprobe}" ]; then
p_ro_device=${cowprobe}
p_ro_fstype=$(get_fstype "${cowprobe}")
p_ro_mountopt="ro,noatime"
p_ro_mount="/persistent"
mkdir -p $p_ro_mount
mount -t ${p_ro_fstype} -o ${p_ro_mountopt} \
${p_ro_device} \
${p_ro_mount} || panic "Can not mount"
...
case ${UNIONFS} in
...
overlayfs)
mounts=""
for mount in /cow $p_ro_mount $rofslist
...
Replace initrd.lz, or in my case, I just created a new one.
find . | cpio --quiet -o -H newc | lzma -7 > ../ro-initrd.lz
Add more boot option to syslinux.cfg
append initrd=/casper/ro-initrd.lz file=/cdrom/preseed/linuxmint.seed boot=casper splash -- persistent
Note: I use Mint 16 (x86) and unetbootin.
Best Answer
Get the
uuid
of the partition on the disk:Store the ISO in the root of the partition, in this example we will use
ubuntu-19.04-desktop-amd64.iso
.Mount the ISO and copy the first
menuentry
from/boot/grub/grub.cfg
, and paste it in/etc/grub.d/40_custom
:Change the following in bold:
Update grub:
Next time you reboot you will have an entry to boot the ISO.