Jefro, thank a lot: you pointed me into the right direction and after some work I solved this!
I insisted with syslinux for a day or two, but at the end I gave up: nothing worked. Then your post came, I made a quick search for "grub usb multiboot" and landed
here.
This sounded really promising so I followed the steps on the page (except those about formatting the pendrive as I already had my partitions):
Code:
mkdir /mnt/USB && mount /dev/sdxy /mnt/USB
grub-install --force --no-floppy --boot-directory=/mnt/USB/boot /dev/sdx
Then I gave a look to the
grub.cfg file they hosted and searched around the web for "grub menu configuration" and "manually edit grub.cfg" until I understood how it worked.
First try:
take the grub.cfg off the site pretty much "as it is" and change the name of the ISOs and labels.
Result: Linux Mint works. No persistence however<.
Second try:
Take the grub.cfg, edit it interpolating some info from the old syslinux.cfg and the new grub.cfg. Add my custom entries for "persistence", "live", "ISO to RAM", "compatibility mode" and "PAE forced". Add submenus. Repeat for Remix OS.
Result: Linux Mint fully functional (all modes at 100%, even persistence - yay!). Memtest working. Remix OS Guest working. Remix OS Resident refusing to boot up (it got stuck with the logo). From the message it spit out before the logo I was able to understand that it was trying to mount the data partition (the one where files are stored)
inside obviously readonly.
Third try:
Take a spare USB, format it FAT32, flash RemixOS on it with Unetbootin, copy all the files except the grub.cfg into my USB. Make RemixOS boot from initrd instead of ISO file.
Result: the same. RemixOS could not make the data partition work.
Fourth try:
Read up some forum posts about "RemixOS multiboot USB", especially the grub configurations. Find out one promising: it removed all the specification at the end of the "linux /kernel" line.
Result: MAGIC! It works! It really does! Everything boots up nicely!
SUMMARY
It took me ages, but finally I do have my MULTI-USE-MULTI-BOOT USB key.
For those interested here I leave you a small summary of the steps (leaving out all the trial and error):
- format the key (say it's /dev/sdx) so that:
- /dev/sdx1 is a FAT32 partition. Give it a nice name. This partition will be the only one available under Windows;
- /dev/sdx2 is ext4. This partition will be encrypted in the next step
- /dev/sdx3 as FAT32, however it won't be recognized by Windows. Here we'll keep the boot files and ISOs;
- /dev/sdx4 as ext2 with label casper-rw (mandatory). This partition will hold the persistence files of Linux Mint
- encrypt /dev/sdx2: I followed this guide.
- download all the ISOs file you want to put on the USB
- install unetbootin and use it to flash RemixOS on /dev/sdx3
- install grub on the USB. Make sure it's mounted somewhere in your system (say "/mnt/USB"):
Code:
grub-install --force --no-floppy --boot-directory=/mnt/USB/boot /dev/sdx
- copy the ISO of Linux Mint on /dev/sdx3 (I also downloaded memtest as suggested here)
- edit /boot/grub/grub.cfg on /dev/sdx3 to look something like the file you'll find at the end of the post
- The End: boot your USB to test it
Now you have a USB key which:
- works with Windows/Linux/Mac for file transfer
- has an encrypted linux compatible partition
- can boot as many OSes as you like (as long as you have space on /dev/sdx3 and have time to find the right options for grub.cfg)
- can boot OSes with persistence
This works best with USB 3.0 and 32 GB or more of total space.
Other things you could add are obviously other OSes (antivirus scan, system rescue...) or portableApps for Windows (they must go to /dev/sdx1 as it's the only partition visibile from Windows).
So thank you again jefro for your hint! You saved me
Here is my final grub.cfg file:
Code:
set timeout=10
set default=0
submenu "Linux Mint" {
menuentry "Linux Mint XFCE 18.0 Sarah (persistent)" {
loopback loop /linuxmint-18-xfce-32bit.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-18-xfce-32bit.iso quiet splash -- persistent
initrd (loop)/casper/initrd.lz
}
menuentry "Linux Mint XFCE 18.0 Sarah (live)" {
loopback loop /linuxmint-18-xfce-32bit.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-18-xfce-32bit.iso quiet splash --
initrd (loop)/casper/initrd.lz
}
menuentry "Linux Mint XFCE 18.0 Sarah (ISO to RAM)" {
loopback loop /linuxmint-18-xfce-32bit.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-18-xfce-32bit.iso toram -- persistent
initrd (loop)/casper/initrd.lz
}
menuentry "Linux Mint XFCE 18.0 Sarah (compatibility mode)" {
loopback loop /linuxmint-18-xfce-32bit.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-18-xfce-32bit.iso xforcevesa nomodeset b43.blacklist=yes ramdisk_size=1048576 root=/dev/ram rw noapic noacpi nosplash irqpoll -- persistent
initrd (loop)/casper/initrd.lz
}
menuentry "Linux Mint XFCE 18.0 Sarah (PAE forced)" {
loopback loop /linuxmint-18-xfce-32bit.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-18-xfce-32bit.iso quiet splash -- forcepae persistent
initrd (loop)/casper/initrd.lz
}
}
submenu "Remix OS" {
menuentry 'Resident mode - All your data and apps are saved' {
search --file --no-floppy --set=root /system.sfs
linux /kernel root=/dev/ram0 androidboot.hardware=remix_x86 androidboot.selinux=permissive quiet SERIAL=random logo.showlogo=1
initrd /initrd.img
}
menuentry 'Guest mode - No data will be saved after each session' {
search --file --no-floppy --set=root /kernel
linux /kernel root=/dev/ram0 androidboot.hardware=remix_x86 androidboot.selinux=permissive quiet SERIAL=random logo.showlogo=1 REMOUNT_RW=0 DATA= DATA_IN_MEM=1
initrd /initrd.img
}
}
submenu "Tools" {
menuentry "Memtest 86+" {
linux16 /memtest86+.bin
}
menuentry "Turn off the computer" {
echo "Turning off the computer..."
halt
}
menuentry "Reboot the computer" {
echo "Rebooting the computer..."
reboot
}
}