OS boot fails after running any TBS script in BIU

User discussion and information resource forum for BootIt Bare Metal, BootIt UEFI and PartWork for Windows
Post Reply
dnlathrop
Posts: 55
Joined: Sat Sep 01, 2012 10:21 pm

OS boot fails after running any TBS script in BIU

Post by dnlathrop »

Please excuse me if this has been posted before - I did not find anything relevant after searching.

This is my first time to experiment with TBS scripts. I created a script to run immediately before booting a Linux OS; the script checks for a flag file in the EFI partition and if present backs up the OS partition; otherwise it just exits. The BIU menu item specifies the script and runs it OK, then starts the Linux OS boot but the boot never completes.

What I see from the boot attempt is the grub menu is displayed, then times out and starts the OS boot. The monitor screen goes dark after the grub menu disappears and stays dark indefinitely -- well, I waited as long as 5 minutes with nothing showing.

I created an entry on the BIU boot menu to run just the script and then tried to boot the OS separately with no script. The same result occurs; the boot is initiated but it never completes. If I restart the machine and attempt a boot without running any script, the boot succeeds.

After restarting the machine and booting into the OS, I examined the system journal. In both cases where a script is run, there are no journal entries for that boot attempt.

According to the BIU manual, BIU supports running scripts immediately prior to starting a boot but in my case if any script is run, no boot is possible unless the machine is restarted before attempting the boot.

Does anyone have any ideas about why this is failing? Am I doing something wrong? I am running BIU 1.44.
TeraByte Support
Posts: 4105
Joined: Thu May 05, 2011 10:37 pm

Re: OS boot fails after running any TBS script in BIU

Post by TeraByte Support »

It may be the Linux loader not initializing memory. What OS distro and version are you booting, is it just running the script including something simple like just printing something to the screen (or doing nothing) or is it after running the image?
dnlathrop
Posts: 55
Joined: Sat Sep 01, 2012 10:21 pm

Re: OS boot fails after running any TBS script in BIU

Post by dnlathrop »

The OS is Linux Mint 22.3

I have tried several scripts but none of them modify the OS partition. The only modification my scripts have made is to delete a file in the EFI partition (the file I use as a flag indicating a backup is to be taken). For the backup script, it attempts to delete the file, detects a non-zero return code, prints two lines and exits. I show the scripts below.


srvr_bkup_check.tbs - This is the script I want to run immediately before booting the OS.

Code: Select all

INCLUDE "srvr_bkup_routines.tbs"

SUB MAIN()
    check = RMFILE("srvr_bkup_flag")
    IF check = 0 THEN
        PRINTL("Backup flag detected; starting backup ...")
        SLEEP(2)
        srvr_bkup()
    ELSE
        PRINTL("Backup flag not detected; skipping backup.")
    END IF
    PRINTL("Continuing ...")
    SLEEP(2)
END SUB

srvr_bkup.tbs - This is the script I invoke from a BIU boot menu item. The reboot is done only to avoid the subsequent OS boot problem reported here.

Code: Select all

INCLUDE "srvr_bkup_routines"

SUB MAIN()
    srvr_bkup()
    PRINTL("Rebooting ...")
    SLEEP(2)
    reboot()
END SUB

srvr.bkup_routines.tbs - Common subroutine module.

Code: Select all

SUB srvr_bkup()
    EXEC("C:\EFI\BootIt\imageu.efi /b /uy /d:2@0x1,0x4 /f:1@0x1:^"\Bkup\HX100G\Mint-$~YYYY$-$~MM$-$~DD$-$~HHMM$ (22.3 & efi)^" /max:2TiB /v /con", 1)
END SUB

SUB reboot()
    EXEC("C:\EFI\BootIt\imageu.efi /reboot", 1)
END SUB
TeraByte Support
Posts: 4105
Joined: Thu May 05, 2011 10:37 pm

Re: OS boot fails after running any TBS script in BIU

Post by TeraByte Support »

is it only after running the imageu.efi or even if it does the check and not time to create the image; I tested the later (no file so no backup) on two different VMs (virtualbox and qemu) and couldn't reproduce the issue. although with the 7.2.x version of virtualbox, I find that it sometimes hangs when booting Linux at points - typically during boot and shutdown, the way to get it to continue is to add/remove an .iso to the cd drive icon.
dnlathrop
Posts: 55
Joined: Sat Sep 01, 2012 10:21 pm

Re: OS boot fails after running any TBS script in BIU

Post by dnlathrop »

The problem occurs under all conditions I have tried.
- When the flag file is present and a backup is taken, the boot fails.
- When the flag file is not present and nothing but print and sleep statements are executed, the boot fails in the same way.

I did another test. From the BIU desktop I executed the following script:

Code: Select all

SUB MAIN()
    PRINTL("Testing ...")
END SUB
I entered "exit" at the scripting prompt and returned to the desktop. Then I resumed to the BIU boot menu and attempted to boot the OS. The boot failed.

Just to be clear, I mention again that I examined the system journal and there are no entries for the failing boot attempts. Either the boot never starts or it fails silently before the journal is opened.

EDIT: I tested on another machine using an older version of BUI ver 1,33. I created the simple PRINTL script from the BIU text editor, ran it from the desktop, resumed to the BIU boot menu and attempted to boot a different version of Linux Mint (22.1). Same result -- the GRUB menu appears, then times out and the screen goes black. I powered down (the only way to recover) and booted in to the OS. There are no journal entries for the previous failed boot attempt.
dnlathrop
Posts: 55
Joined: Sat Sep 01, 2012 10:21 pm

Re: OS boot fails after running any TBS script in BIU

Post by dnlathrop »

I did more testing on the system using BIU 1.33. From the BIU desktop I clicked on the script icon to open the command window. I then entered "exit" and returned to the BIU desktop. After resuming to the BIU boot menu, I tried to boot an OS. It failed as before.

Just to be clear, I did nothing more than open the script command shell and exit back to the desktop.

I tried booting three different OS after doing this: Mint 22.1, Mint 21.3 and Windows 11. All boots failed.

For the Linux systems, the GRUB menu appears then times out. The screen goes dark and remains that way. I have found no way to recover using the keyboard. The only way to recover is to power down the machine.

When I attempted to boot Windows 11, the blue 4-pane window appears but the circular dots showing busy do not appear. The only way to recover is to power down.
dnlathrop
Posts: 55
Joined: Sat Sep 01, 2012 10:21 pm

Re: OS boot fails after running any TBS script in BIU

Post by dnlathrop »

I did more testing. The machines I tested previously have AMD Ryzen 9 processors.I wondered if an Intel processor would make a difference.

I tried an older machine which has an Intel NUC10 i5 processor.It has BIU 1.33 installed. I ran the same tests as before with both Linux and Windows OS. I had the same result - the OS will not boot successfully if I just open the scripting shell window in BIU before attempting to boot.

Terabyte Support indicated his/her testing with VMs did not have the same problem. I tested with physical machines. Apparently that makes a difference.

Will anyone else give this a try? Just press Maintenance on the BIU boot menu, press the Script icon near the right-hand edge of the BIU desktop to open a window with a command line prompt, type "exit" and press Enter, then press Resume near the upper left corner of the desktop and attempt to boot any OS. What are your results?
TeraByte Support
Posts: 4105
Joined: Thu May 05, 2011 10:37 pm

Re: OS boot fails after running any TBS script in BIU

Post by TeraByte Support »

A physical machine was used too, it just didn't have your flavor of mint on it, it booted pclinuxos, fedora, and win10 ok. But it was the latest 2.x version, not a V1.x version.
dnlathrop
Posts: 55
Joined: Sat Sep 01, 2012 10:21 pm

Re: OS boot fails after running any TBS script in BIU

Post by dnlathrop »

Thank you for correcting my misunderstanding. From what I can tell, the choice of OS probably does not matter.

But the version of BIU might. Are you able to test BIU version 1? If someone can confirm it's not just me who is having this problem with version 1 and that the problem is fixed in version 2, then I guess it is time to upgrade.
Post Reply