• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Boot Order

    Scheduled Pinned Locked Moved Unsolved FOG Problems
    5 Posts 2 Posters 71 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      chevengur
      last edited by

      And through FOG, it is possible to change the Boot Order? During deployment, the Boot Order switches to Windows/Debian/Ubuntu. But suppose I want to change it again automatically when creating an OS Task, so that the machine boots via iPXE again and installs the OS I need. If this is possible, please clarify how to do it.

      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @chevengur
        last edited by

        @chevengur I have not had to do this before, but I can tell you in concept how to go about it.

        You will need to create a post install script, that script gets executed just after the image is pushed to the computer and before its rebooted. This script is a bash shell script (remember the FOS engine is linux based).

        Since it is linux based you will need to use linux command line tools to reset the boot image. The tool named is efibootmgr. This command is built into FOS linux engine.

        So on its simplest form, you will create a FOG post install script and that script will call the efibootmgr to set the boot image. Understand that MS Windows will change this order without notice and at random times during its life.

        Its not hard to do, but it will take a little effort on you to work out what is needed.

        I can’t give you a step by step on how to do this but I can give you a general direction to look in if you want to go down this path.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

        C 1 Reply Last reply Reply Quote 0
        • C
          chevengur @george1421
          last edited by

          @george1421 I came to this a day ago, but efibootmgr doesn’t really want to change the boot priority — maybe there are some tricks or specific moments when the script needs to be used. Could you tell me the best way to do this?

          george1421G 1 Reply Last reply Reply Quote 0
          • george1421G
            george1421 Moderator @chevengur
            last edited by george1421

            @chevengur I can tell you how I would go about figuring this this.

            1. Take a computer that represents the finished design of how your disk are laid out.
            2. Schedule a deployment to that computer, but before you hit the schedule task button, tick the debug checkbox then schedule the deployment. No worries as long as you pick debug mode since it will never get to the deployment phase.
            3. Now pxe boot the target computer, it should boot into the FOS linux console. After a few screens of text you need to clear with the enter key you will be dropped to the FOS linux command prompt.
            4. From there issue, the efibootmgr command with no parameters. It should print something similar to below (note this is from my laptop)
            thunder@lightning:~$ efibootmgr
            BootCurrent: 0005
            Timeout: 2 seconds
            BootOrder: 0005,0004,0000,0001,0002,0003
            Boot0000* UEFI BC511 NVMe SK hynix 256GB SN9BN62231050BJ2H 1	HD(1,GPT,d00df89f-1edb-44f8-b325-245b607b2321,0x800,0x100000)/File(\EFI\Boot\BootX64.efi){auto_created_boot_option}
            Boot0001* ONBOARD NIC (IPV4)	PciRoot(0x0)/Pci(0x1f,0x6)/MAC(b44,0)/IPv4(0.0.0.00.0.0.0,0,0){auto_created_boot_option}
            Boot0002* ONBOARD NIC (IPV6)	PciRoot(0x0)/Pci(0x1f,0x6)/MAC(b440)/IPv6([::]:<->[::]:,0,0){auto_created_boot_option}
            Boot0003* UEFI HTTPs Boot (MAC:B445065BDC4B)	PciRoot(0x0)/Pci(0x1f,0x6)/MAC(b445065bdc4b,0)/IPv4(0.0.0.00.0.0.0,0,0)/Uri(){auto_created_boot_option}
            Boot0004* debian	HD(1,GPT,d00df89f-1edb-07b2321,0x800,0x100000)/File(\EFI\debian\shimx64.efi)
            Boot0005* Ubuntu	HD(1,GPT,d00df89f-1edb-607b2321,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
            

            You can see from this the default BootOrder is 5, 4, 0, 1, 2, 3 this lists the different boot managers found by the firmware.

            So it will boot ubuntu first, then debian, the hard drive, onboard nic v4, onboard nic v6, http boot.

            Now lets say I wanted debian to boot first I might issue the command.
            efibootmgr -o 4,5, 0,1, 2, 3

            Now reboot the computer with the reboot command see if it changes the boot order specific to your options.

            After you get this worked out, you will need to clean up this deploy task on your fog server so it doesn’t do this moving forward. But for debugging as long as the fos engine doesn’t complete, every time you reboot the computer will enter the FOS debug console. This helps with debugging and tweaking your post install script.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

            C 1 Reply Last reply Reply Quote 1
            • C
              chevengur @george1421
              last edited by

              @george1421 Could you tell me how to make it work in Windows? bcdedit doesn’t help — bootsequence nominally changes the order, but after reboot, it still boots from the hard drive.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post

              160

              Online

              12.4k

              Users

              17.4k

              Topics

              155.9k

              Posts
              Copyright © 2012-2025 FOG Project