Saturday 6 August 2022

Add MX Linux with persistence to agFM

If you want to UEFI64 (or legacy) boot to an MX-Linux ISO and have persistence, you can use a .grubfm file. The .grubfm file must be the same name as the ISO file and in the same folder, e.g.

  • \_ISO\LINUX\MX-21.1_x64.iso
  • \_ISO\LINUX\MX-21.1_x64.grubfm

1. Copy on the two files. The grubfm file can be found on Partition 2 at "\e2b\Sample agFM menu files\LINUX\MX-21.1_x64.grubfm" folder or download from here.

2. The persistence files that will be created by MX-Linux must be stored on either Partition 2 of the E2B USB drive or Partition 3. Check that you have enough room (the default files are 8GB and 10GB but you can choose a smaller size). If you do not have a Partition 3 on the E2B USB drive then you could resize the partitions using EaseUS Home Partition Master or a similar tool. 

3. Edit the .grubfm file and change the partition number to the one that you are going to use - either 2 or 3, e.g.  line 15-17, make sure set PERSIST_PTN= 2 (or 3) as the only line and comment out any other set PERSIST_PTN= line...

set PERSIST_PTN=3

There are also some locale, keyboard and timezone settings you may want to change, I used:

set params="lang=en_GB kbd=uk,us tz=Europe/London video=1280x1024"

You can comment this out and uncomment the USA setting line if you wish or do not use any params setting.

4. Now boot to the agFM menu (either UEFI64 boot or legacy boot to E2B and then boot to agFM) and choose the MX-21.1_x64.iso file.

5. Select the 'User Menu' entry in the secondary menu..


6. Select the persistence menu option (as in the .grubfm file)...


7. You will now be prompted to create the new home and rootfs persistence files


Choose 1 for the default size or 2 if you want a different size.

You will be prompted again for the home file size.

8. Now make the swap file size (this seems to not work?). I just got the option of Quit.


9. Now set up new passwords as prompted and then chose the save mode. Use 2 if you want to be prompted to save the changes when you shutdown. Otherwise use 1.


10. It should now boot to the Desktop. When you shutdown, it will save any changes (it will prompt you if you chose 2 for Semi-Automatic).

Try creating a new folder on the Desktop and reboot to test if persistence is working.

11. Now, when you next boot using the 'User Menu' option, it should boot straight to the Desktop and support persistence.

The new persistence files should be on the specified partition (either ptn 2 or ptn 3):

Persistence files on Partition 3 are in use.

Notes:
MX-Linux looks for a volume labelled 'MX-Persist' by default. If it cannot find one it may ask you to pick a partition and then ask if you want to rename the volume label to 'MX-Persist'. If you do then it will be automatically found on the next persistent boot. If it cannot find the 'MX-Persist' labelled  partition with the persistence files on it, then it lists all viable partitions and ask you to specify the partition where the persistent files is or should be located.

Type 0 partitions seem to be ignored by the booted OS (not auto-mounted), so any partition that has the persistence files on should have a non-zero partition type.

The fromiso= parameter seems to make MX-Linux create and look for the persistence files in a different folder, e.g. fromiso=/_ISO/LINUX/MX-Linux.iso makes it create the persistence files in \_ISO\LINUX instead or \antiX. So I avoided using fromiso=  and use partnew to set Partition 4 as the ISO file.

Also, the boot partition (E2B Ptn1) is marked as read-only, so that cannot be used for the partition files even though it is listed as a viable candidate and allows you to set up persistence initially - on rebooting, the persistent files will not be saved or loaded and it will complain about the volume being read-only. So we must use either Partition 2 (FAT32) or Partition 3 (the extra user partition on E2B drive).

During a normal boot first from ISO (not using the .grubfm file or 'User menu', etc.), persistence can be enabled manually using the Advanced menu - use persist_all. If your E2B USB drive is a USB HDD (or HDD under VBox/VMWare), you also need to set  'boot options - from=all' option. This will have to be done manually each time.

Ventoy
If using Ventoy, you can use the Advanced menu in a similar way (set persist_all and from=all). Currently, adding a persistence file to Ventoy and storing the two persistence files inside the ext4 persistence .dat filesystem does not seem to work properly (Ventoy 1.0.79) - the passwords do not seem to be changed or saved/restored correctly but home persistence seems to work. The issue has been reported. However, you can use Partition 3 for persistence instead and that does work.

Other articles on persistence

No comments:

Post a Comment