Menu

UEFI pxe booting clonezilla.

2019-10-11
2021-03-14
  • jeff.sadowski

    jeff.sadowski - 2019-10-11

    Ok Dell finnally stopped shipping XPS's with legacy support. Now I'll need to use the UEFI methods only.
    So I'll have to learn the new ways of booting clonezilla using something other than pxelinux.
    I see some posts about it but no notable configuration files.
    I would like to see some configurations on booting over PXE using a UEFI boot loader.
    I'll do some more research but documents on such seem few and far between.
    I think I might just be able to use grub but not sure how to give it network options to get files like I do with pxelinux.
    I had pxelinux working so nice and then Dell throws this at me.
    Anyways I figured out the part to switch on UEFI and legacy on the dhcp server side.
    I used the following on server 2012 https://medium.com/visitedspace/pxe-boot-both-legacy-bios-and-uefi-96ecf95a504

    note
    need to check the Append wildcard when adding to the policies. That was tripping me up.

    and I found this for linux
    https://community.theforeman.org/t/uefi-dhcpd-conf/9793

     

    Last edit: jeff.sadowski 2019-10-11
  • Steven Shiau

    Steven Shiau - 2019-10-13

    Actually the lite server of Clonezilla supports uEFI network booting. You can try it:
    https://clonezilla.org/show-live-doc-content.php?topic=clonezilla-live/doc/11_lite_server

    The grub uEFI netboot related files are under /tftpboot/nbi_img/grub-efi.cfg/. You can find them when lite server is enabled.

    Steven

     
  • jeff.sadowski

    jeff.sadowski - 2019-10-14

    I am not understanding the options when starting clonezilla in lite server mode. and it seems incomplete. I don't want it to do dhcp. I started the lite-server option and select existing dhcp server. I picked interactive mode as each computer I connect I want to select images. It started giving error messages. about stuff not existing in nbi_img/
    I'm not sure what to point to from my dhcp server.
    I know the ip but not sure of the filename.

    I'd rather try and set this up on my existing tftp server I have copied the grubx64.efi from the zip file and put it in my /tftpboot/
    When I tried to boot my UEFI PXE boot machine I was left at a grub command prompt.
    grub>
    I had a grub.cfg in /tftpboot/

    that looked as close as I could to my pxelinux.cfg/default file

    my pxelinux.cfg/default file looks like so

    default vesamenu.c32
    display boot.msg
    label Clonezilla-live 2019-07-07 x64
      menu label Clonezilla Live 2019-07-07 stable x64
      kernel cz190707.x64/live/vmlinuz
      append initrd=cz190707.x64/live/initrd.img vga=788 video=800x600 vmwgfx.enable_fbdev=1 boot=live union=overlay username=user hostname=clonezilla ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" locales=en_US.UTF-8 keyboard-layouts=NONE toram=filesystem.squashfs ip=dhcp ocs_prerun="dhclient" ocs_repository="nfs://nfs/clonezilla" fetch=http://tftp/tftp/cz190707.x64/live/filesystem.squashfs
    

    /tftpboot/cz190707.x64 contains the unzip form of clonezilla put out 2019-07-07
    my grub.cfg looks like so

    set pref=/boot/grub
    set default="0"
    
    insmod efi_gop
    insmod efi_uga
    
    if loadfont $pref/unicode.pf2; then
      set gfxmode=auto
      insmod gfxterm
      terminal_output gfxterm
    fi
    set timeout="30"
    set hidden_timeout_quiet=false
    
    insmod png
    if background_image $pref/ocswp-grub2.png; then
      set color_normal=black/black
      set color_highlight=magenta/black
    else
      set color_normal=cyan/blue
      set color_highlight=white/blue
    fi
    
    insmod play
    play 960 440 1 0 4 440 1
    
    menuentry "Clonezilla-live 2019-07-07 x64"{
      set gfxpayload=keep
      linuxefi /cz190707.x64/live/vmlinuz vga=788 video=800x600 vmwgfx.enable_fbdev=1 boot=live union=overlay username=user hostname=clonezilla ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" locales=en_US.UTF-8 keyboard-layouts=NONE toram=filesystem.squashfs ip=dhcp ocs_prerun="dhclient" ocs_repository="nfs://nfs/clonezilla" fetch=http://tftp/tftp/cz190707.x64/live/filesystem.squashfs
      initrd /cz190707.x64/live/initrd.img
    }
    

    Noting that server-lite was using the nbi_img

    I tried creating a nbi_img directory in /tftpboot
    So I have my grub.cfg in /tftpboot/nbi_img/grub-efi.cfg/
    and I also have it in /tftpboot/nbi_img/grub-efi.cfg/x86_64-efi/ and /tftpboot/nbi_img/grub-efi.cfg/i386-pc/ as I see it existing on the light server

    I still get a grub command prompt.

     

    Last edit: jeff.sadowski 2019-10-14
  • Steven Shiau

    Steven Shiau - 2019-10-15

    Which version of Clonezilla live did you use? How did you start the lite server? Please tell us in detail, step by step so that we can reproduce this issue here. If the issue is reproducible, then it can be fixed.

    Steven

     
  • jeff.sadowski

    jeff.sadowski - 2019-10-15

    I got this working.
    My dhcp server is windows server 2012
    I followed the instructions from
    https://medium.com/visitedspace/pxe-boot-both-legacy-bios-and-uefi-96ecf95a504
    note: I had to select Append wildcard while adding vendor classes to conditions in the policy editor.
    My tftp server is an ubuntu-18.04
    I followed the instructions here
    https://docs.openstack.org/ironic/latest/install/configure-pxe.html
    and am now seeing the options I expect in grub

    my grub config file looks as follows

    insmod vbe
    insmod vga
    insmod gfxterm
    set default=master
    set timeout=5
    set hidden_timeout_quiet=false
    set gfxmode=800x600
    set gfxpayload=keep
    
    menuentry "Clonezilla-live 2019-09-03 x64"{
      linux /cz190903.x64/live/vmlinuz vga=788 i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 boot=live union=overlay username=user hostname=clonezilla ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" locales=en_US.UTF-8 keyboard-layouts=NONE toram=filesystem.squashfs ip=dhcp ocs_prerun="dhclient" ocs_repository="nfs://nfs/clonezilla" fetch=http://tftp/tftp/cz190903.x64/live/filesystem.squashfs
      initrd /cz190903.x64/live/initrd.img
    }
    menuentry "Ubuntu-18.04"{
      linux /u18.04.x64/linux vga=788 --- quiet
      initrd /u18.04.x64/initrd.gz
    }
    menuentry "Install Fedora 30 64-bit"{
      linux /f30/vmlinuz inst.stage2=http://download.fedoraproject.org/pub/fedora/linux/releases/30/Workstation/x86_64/os/ edd=off ip=dhcp
      initrd /f30/initrd.img
    }
    

    The only issue now is that the menu is still super tiny on the new machines.

     
  • jeff.sadowski

    jeff.sadowski - 2019-10-15

    Still having a problem with my XPS but it deserves it's own thread and I'll try and use a usb stick and see if I have any better luck.
    Specifically it is a Dell XPS 13 7390
    the older XPS's now work with both methods of PXE booting legacy with pxelinux and UEFI with grub

     
  • Larry Lebowski

    Larry Lebowski - 2021-03-12

    I embarked on this UEFI PXE last night for the first time, latest versions downloaded from drbl.org, etc and it kept booting to grub but without accessing the grub.cfg file. Basically, leaving me at a generic EFI commandline screen and none of the expected commands were made available such as tftp, efinet, etc.

    What I discovered was that the DRBL script which runs grub-mkimage command does not have the TFTP server detail correctly set up for the --prefix= parameter.

    Taken from /tftpboot/nbi_img/ bootx64.efi.info:

    Created by program "/usr/sbin/drbl-gen-grub-efi-nb" with command:
    grub-mkimage -C xz -O x86_64-efi -o /tftpboot/nbi_img/bootx64.efi --prefix='(tftp)/grub/' normal tftp efinet chain echo net gzio xzio linux linuxefi efi_gop efi_uga png gfxterm gfxterm_background gfxterm_menu serial part_gpt part_msdos boot multiboot progress search ext2 xfs reiserfs jfs hfsplus fat ntfs configfile test sleep tr reboot halt
    

    The fix is simply to replace '(tftp)/grub/' with '(tftp,your_server_ip_here)/grub', so in my case, the command line I ran was (IP intentionally messed up for this post):

    grub-mkimage -C xz -O x86_64-efi -o /tftpboot/nbi_img/bootx64.efi --prefix='(tftp,192.432.234.432)/grub' normal tftp efinet chain echo net gzio xzio linux linuxefi efi_gop efi_uga png gfxterm gfxterm_background gfxterm_menu serial part_gpt part_msdos boot multiboot progress search ext2 xfs reiserfs jfs hfsplus fat ntfs configfile test sleep tr reboot halt
    

    This gave me a successfully booting EFI that correctly called upon grub. After that, I edited the grub.cfg file to suit the three different boot options for automatically backing up two particular PCs, as well as having an interactive mode of Clonezilla Live, and we were in business. The good thing is that I have both BIOS and UEFI working together without issue.

    To achieve this, I:
    * left the PATH variable in pxelinux.cfg/default set to "bios/", so no change out of the box there
    * wrote /etc/dnsmasq.conf with only the following within it, keeping in mind that my router is my DHCP server, so I simply needed dnsmasq to function as a DHCP Relay

    # DNS Options
    port=0
    # DHCP Options
    dhcp-range=192.432.234.1,proxy,255.255.255.0
    dhcp-no-override
    dhcp-option=vendor:PXEClient,6,2b
    pxe-service=X86PC, "Boot from network (Legacy)", pxelinux.0
    pxe-service=X86-64_EFI, "Boot from network (UEFI PXE-64)", bootx64.efi
    pxe-service=BC_EFI, "Boot UEFI PXE-BC", bootx64.efi
    # TFTP Options
    tftp-root=/tftpboot/nbi_img/
    

    Took me a while to figure it out, so I figured it would be best to post it here and hopefully save someone else the same pain I put my feeble mind through. For my next trick, I might be daring and upgrade to a layer 3 switch so I can have the Clonezilla PXE server hosted off its own VLAN, with an IP Helper to facilitate the interVLAN routing, just for the learning exercise.

    Good luck folks!

     
  • Steven Shiau

    Steven Shiau - 2021-03-14

    Thanks for sharing this.
    BTW, are you using stable DRBL or unstable DRBL?
    On which GNU/Linux did you install that? Debian buster or Ubuntu 20.04? Or?

    Steve

     
  • Larry Lebowski

    Larry Lebowski - 2021-03-14

    Apologies! Details do matter and I left out the most important bits!

    Stable DRBL and Ubuntu 20.04.

     
  • Steven Shiau

    Steven Shiau - 2021-03-14

    Thanks. If you have a chance, next time please give unstable DRBL a try. It has many changes, and we still have no time to make sure if it works on most of the GNU/Linux... However, for Debian buster and Ubuntu 20.04, it should work.

    Steven

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.