Tuesday, 14 June 2016

Add Mepis antiX MX-15 with persistence to E2B

MX-15 ISOs can be booted straight from E2B - just copy the ISOs to the E2B drive (e.g. \_ISO\LINUX folder), make them contiguous (run \MAKE_THIS_DRIVE_CONTIGUOUS.cmd) and boot.


By default, MX-15 will boot from a cd or USB device, but to boot from a hard disk you need to add the cheat code 'from=hd'. So when I tested it under Virtual Box, I had to add this cheat code using the boot menu option because the USb drive appears as a SATA hard disk under the VM - and it worked fine (it boots pretty quickly too!).

Trouble at t'mill!

However, when I tried to boot to Mepis on my Z87 PC from my FE2005 USB 3.0 E2B drive, I found that the x64 version would not boot on a real system (i.e. as a USB device). The 386 version worked, but not the x64 version!

I also found that the MX-15 x64 ISO file booted OK if it was on a SanDisk Extreme flash drive or on a WD Passport 2TB USB 3.0 HDD.

MX-15.01_386.iso (MD5 BA446B7B407317222AA2382F13D0951F)  WORKS
MX-15_x64.iso      (MD5 31A7AB75779E06C76CC3CB9710C0C693) ONLY WORKS ON non-UASP USB DRIVE!

The latest MX-15 x64 May 2016 build also failed to boot on my FE2005 USB drive.

It looks like the x64 ISO is missing the UASP driver (I am in communication with James from Mepis about this).

P.S. James has given me a new test version of initrd.gz which fixes the problem for MBR and UEFI-booting from a UASP device (English support only). MX-16 should contain the fix, when it is becomes available. The June release of MX-15 should also contain the bugfix.

Persistence

MX-15 will automatically create persistence files if you 'ask' it to during booting by adding a cheat code, so I created the following .mnu file which allows you to boot Mepis with persistence (3rd menu). For help setting up persistence see this YouTube video.

MX-15_x64_persistent.mnu
# add the ISO and this file to \_ISO\MAINMENU\MNU or \_ISO\LINUX\MNU folder
# Due to USB detection bug in x64 MEPIS 15, this may only work from a non-UASP USB drive.
# Note: use from=usb instead of from=hd,usb if not booting via a VM.
# ISO should be contiguous. Works on NTFS and FAT32.
# http://mepiscommunity.org/wiki/system/boot-parameters

title MX-15_May_x64.iso \n
set ISO=$HOME$/MX-15_May_x64.iso
if exist CD echo WARNING: Cannot use partnew command! && pause && configfile (bd)/menu.lst
if "%E2BDEV%"=="" set E2BDEV=hd0 && pause E2BDEV forced to hd0!
partnew (%E2BDEV%,3) 0x0 %ISO%
map %ISO% (0xff)
map --hook
root (0xff)
kernel /antiX/vmlinuz quiet from=hd,usb fromiso=%ISO%
initrd /antiX/initrd.gz
boot

title MX-15_May_x64.iso (Safe Mode) \n FailSafe mode
set ISO=$HOME$/MX-15_May_x64.iso
if "%E2BDEV%"=="" set E2BDEV=hd0 && pause E2BDEV forced to hd0!
partnew (%E2BDEV%,3) 0x0 %ISO%
map %ISO% (0xff)
map --hook
root (0xff)
kernel /antiX/vmlinuz from=hd,usb failsafe
initrd /antiX/initrd.gz
boot

title MX-15_May_x64.iso (Persistent all) \n Set up persistence on E2B drive on first boot.\n Persistence files will be in \\antiX folder.
set ISO=$HOME$/MX-15_May_x64.iso
if "%E2BDEV%"=="" set E2BDEV=hd0 && pause E2BDEV forced to hd0!
uuid () > nul
set UUID=%?%
partnew (%E2BDEV%,3) 0x0 %ISO%
map %ISO% (0xff)
map --hook
root (0xff)
kernel /antiX/vmlinuz from=hd,usb persist=root!,home,hd,usb puuid=%UUID%
initrd /antiX/initrd.gz
boot

When you first boot to the 'Peristent all' menu, you will be prompted to create two persistence files for root and home (I entered '2' for each option just to get going quickly) and you will also be asked to change the demo and root passwords. When you next boot using the 'Persistent all' menu, it will boot automatically with persistence using the persistence files in the \antiX folder that were created on the first boot.

If you do not use a VM for testing, it is best to change the from=hd,usb cheat code to from=usb so that Mepis does not get confused by the contents of any  hard disks in the system which may possibly contain a Mepis installation.

I will add this sample .mnu file to the next Beta of E2B v1.81.

If you have problems with antiX not detecting your drive, try the cheat code from=all.

UEFI-booting

The x64 version contains 64-bit UEFI boot files, so you can simply drag-n-drop the ISO onto the MakePartImage.cmd script shortcut to make a .imgPTN file (do NOT use the MPI_FAT32 or MPI_NTFS shortcuts).

You will need to choose the syslinux v6 option when prompted (the default syslinux 4 doesn't work).
Don't forget to increase the default suggested size by about 1GB+ if you want to run Mepis with persistence, because the \antiX folder will have to be created inside the partition image. Use a volume name of MX-Persist and say 'Yes' to auto-correct. I used FAT32 for the .imgPTN file, but if you want >4GB persistence, you will need to use NTFS (untested)...

  • FAT32 or NTFS
  • Volume Name = MX-Persist
  • Size = Add 500MB+ if you want persistence
  • Syslinux v6
You can directly UEFI-boot from the image (after switching to it), but to MBR-boot, choose the 2nd or 3rd 'Alternate Boot' option in the CSM menu (the default boot option doesn't work unless you use MPI v0.063+).

For the first boot, choose the 'Custom' boot option and follow the prompts to create the persistence files (I used 'all').

Modify the \boot\grub\grug.cfg file inside the .imgPTN file and add a new menu entry:

menuentry "MX-15_x64 Persistent (24 December 2015)" {
set gfxpayload=keep
linux /antiX/vmlinuz quiet persist=root!,home,usb,hd
initrd /antiX/initrd.gz
}

Once persistence has been set up, you can use this menu to boot with persistence without any prompts.