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

    Boot FOG on client PC using a special partition?

    Scheduled Pinned Locked Moved
    General
    3
    36
    4.6k
    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.
    • S
      Sebastian Roth Moderator
      last edited by Sebastian Roth

      @brakcounty said in Boot FOG on client PC using a special partition?:

      The ls command shows hd0 hd0,msdos hd1 hd1,msdos, hd2 hd2, msdos.

      Well then you have a legacy MSDOS partition layout and can’t use the GPT stuff! Have you tried the good old MBR chainloader style yet?

           insmod part_msdos
           insmod chain
           rootnoverify (hd0,0)
           chainloader +1
      

      Play with the numbers (at line rootnoverify) till you hit the right partition/disk.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      D 1 Reply Last reply Reply Quote 0
      • D
        DBCountMan @Sebastian Roth
        last edited by

        @Sebastian-Roth The windows partition I’m trying to boot from is a GPT-EFI bootable system. Is that “+1” always supposed to follow the chainloader entry?

        1 Reply Last reply Reply Quote 0
        • S
          Sebastian Roth Moderator
          last edited by

          @brakcounty Sorry, just updated my post again.

          The windows partition I’m trying to boot from is a GPT-EFI bootable system.

          On the GRUB command line run the following commands, take a picture of the screen and post that here:

          set pager=1
          insmod part_gpt
          insmod part_msdos
          ls
          

          Is that “+1” always supposed to follow the chainloader entry?

          Yes, as far as I know.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          george1421G 1 Reply Last reply Reply Quote 0
          • D
            DBCountMan
            last edited by

            IMG_20200529_132731.jpg

            1 Reply Last reply Reply Quote 0
            • S
              Sebastian Roth Moderator
              last edited by

              @brakcounty Don’t think there is a GPT partition layout on any of those three disks. While hd2 doesn’t even seem to have partitions at all. Maybe this is the USB key? Can you boot to Windows and post a picture of the disk management view? Shall see if it’s MBR or GPT there.

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              1 Reply Last reply Reply Quote 0
              • D
                DBCountMan
                last edited by

                It probably is the USB drive. I don’t think this particular environment is seeing the hard drive in the PC. I know for a fact that the Windows drive is GPT and EFI because I converted it to GPT before I imaged it, also made sure the image itself was created as GPT. I am able to boot from the Windows EFI partition normally.

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

                  @Sebastian-Roth FWIW: the efi boot partition is almost always vfat (fat32) format unencrypted even if bitlocker is enabled on the disk. Windows needs some way to start off the booting process.

                  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!

                  1 Reply Last reply Reply Quote 0
                  • D
                    DBCountMan
                    last edited by DBCountMan

                    I found the Windows partition it is actually (hd1,msdos1). I ran "ls (hd1,msdos1) and it showed filesystem ntfs label “Windows” and the UUID. But when I try to run the command “chainloader (hd1,msdos1)/EFI/Microsoft/Boot/bootmgfw.efi” or “chainloader (hd1,msdos1)/EFI/Microsoft/Boot/bootx64.efi”, says file not found.

                    Correction: This drive was MBR with only one partition. Sorry about that.

                    george1421G 1 Reply Last reply Reply Quote 0
                    • D
                      DBCountMan
                      last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • george1421G
                        george1421 Moderator @DBCountMan
                        last edited by george1421

                        @brakcounty ref from: https://wiki.gentoo.org/wiki/GRUB2/Chainloading

                        menuentry 'Microsoft Windows 7 or Windows 8 (on sdb1)' --class windows {
                                insmod part_msdos
                                insmod ntfs
                                insmod search_fs_uuid
                                insmod ntldr
                                search --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1 2ABF87DC395CFC02
                                drivemap (hd1,msdos1) (hd0,msdos1)
                                #Or, "drivemap (hd1,msdos2) (hd0,msdos1)" for those with Windows installed on sdb2)
                                ntldr /bootmgr
                        }
                        

                        I’m not sure what the apha characters are at the end of the search line, but this looks like a very good menu structure where it looks for windows instead of you telling it where to look.

                        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!

                        1 Reply Last reply Reply Quote 0
                        • D
                          DBCountMan
                          last edited by DBCountMan

                          that didnt work for me. said ntldr and drivemap not a command.

                          1 Reply Last reply Reply Quote 0
                          • D
                            DBCountMan
                            last edited by DBCountMan

                            Got it working! This worked for me after making sure the drive was changed to GPT and I also labeled the efi parition as “EFI”:
                            menuentry “Windows” {
                            insmod chain
                            insmod ntfs
                            insmod part_gpt
                            set root=(hd1,gpt2)
                            chainloader (hd1,gpt2)/efi/microsoft/boot/bootmgfw.efi
                            }

                            Just realized that the set root part is redundant. I am partitoning the drive now to copy the files from the FOG USB key then tell the UEFI on the PC to boot from this new GRUB partition first. Looking good!

                            1 Reply Last reply Reply Quote 1
                            • D
                              DBCountMan
                              last edited by

                              I copied all the files with the folder structure to the partition I created. Set the part type to EFI System, filesystem to FAT32, told the BIOS/UEFI to boot from bootx64.efi in /BOOT/EFI and landed at a grub rescue prompt. After playing out the process in my head I realize that full automation won’t work because the way the menu is set up to autoboot into Windows after 5 seconds will prevent a deploy or capture task from ever starting. I’d have to be at the PC to select the Deploy/Capture option on the FOG Menu. The USB option still works though so all is not lost.

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

                                @brakcounty There should be a default menu timeout function in grub. So that if no entry is selected grub will pick the default menu. This is akin to how iPXE works.

                                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!

                                1 Reply Last reply Reply Quote 0
                                • S
                                  Sebastian Roth Moderator
                                  last edited by

                                  @brakcounty Over all the details about GRUB I lost sight on what this topic is all about… The USB method uses GRUB as boot loader because it can be installed into MBR on the USB to be used to boot legacy machines. As I said before, the alternative USB boot method is not part of the official FOG stuff and has not had enough attention to be fully integrated yet. Not because it’s impossible to do but because we have way to many things on the list.

                                  Now that you use UEFI only in your setup you could skip GRUB altogether and directly boot using iPXE from the hard drive’s UEFI boot partition and should be able to use FOG exactly the way you would if it does PXE boot. For that you just grab one of the iPXE .efi binaries from your FOG server (e.g. /tftpboot/ipxe.efi) and but that on your disk’s EFI boot partition as \BOOT\EFI\BOOTX64.EFI (case doesn’t matter here as Windows will ignor it). When booting the iPXE binary will run its embedded script to get an IP from DHCP and chainload to the FOG boot menu.

                                  Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                  Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

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

                                  251

                                  Online

                                  12.0k

                                  Users

                                  17.3k

                                  Topics

                                  155.2k

                                  Posts
                                  Copyright © 2012-2024 FOG Project