[syslinux] Alternating boot default entry every reboot

Ady Ady ady-sf at hotmail.com
Thu Oct 6 23:54:23 PDT 2016

> Hi,
> I am currently using isolinux (syslinux-6.03) in a clonezilla setup. It
> boots fine, however I want to have a setup where the default boot selection
> alternates every boot.
> * First boot : Default is menu item 0
> * Second boot : Default is menu item 1
> * Third boot : Default is menu item 0
> ...
> The idea is that when it is booted into clonezilla the clonezilla script
> checks if the system needs to be restored by mounting NFS and checking for
> existence of a file. After clonezilla has restored it will reboot and then
> the isolinux will boot the native file system (Windows, OSX or Linux). Once
> the native OS has restarted, then isolinux will again boot clonezilla and
> the cycle continues every time you reboot.
> I have this clonezilla + isolinux installed on a bootable USB.
> I know this is possible with GRUB:
> http://unix.stackexchange.com/a/110539
> however from what I understand GRUB will not work correctly from the
> bootable USB on all hardware, which is why we use isolinux.
> 1) Is there any way I can achieve this currently in isolinux that I did not
> see looking at the docs?
> 2) If not, is this possible (obviously not possible for read-only CD, but
> bootable USB I imagine yes) and would a patch be welcome to support such a
> feature?
> Thanks,
> Brendon.

I guess that when you want to boot "normal" OS, you are selecting some 
"localboot" (or equivalent) option.

It is not completely clear (to me) whether we are talking about 
multiple systems and/or remote locations, or instead we are talking 
about a single system and/or with physical access and/or one location.

In the simpler "personal" cases, changing the BIOS' boot priority to 
boot first the USB (if present) and then the HDD might be suitable. 
This method might not be adequate / recommended in some cases, for 
several reasons.

There is (at least) one potential possibility so as to get the desired 
behavior, by using "--once" with the extlinux command on the USB's 

The "normal" default LABEL would be to boot Clonezilla on the USB. 
Before shutdown (from Clonezilla), a (scripted) command would execute 
the extlinux command with "--once", changing the next boot (and only 
this one boot) of the USB to the alternative "localboot" LABEL.

Leaving the USB connected to the same system, the next boot of the USB 
would actually end up choosing the "localboot" LABEL. The "normal" 
DEFAULT in syslinux.cfg would remain as it was before, so the next 
reboot from the USB would be "back" to normal.

There could be other alternatives, such as using the special keys while 
booting Syslinux, so as to select an alternative LABEL.

Please be aware that at least some of these options might not be 
available in 6.03, unless relevant patches are applied. 6.04-pre1 is 
available for tests.


PS: Please avoid top-posting.

> _______________________________________________
> Syslinux mailing list
> Submissions to Syslinux at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux

More information about the Syslinux mailing list