Menu

clonezilla live with pxe boot uefi

2021-07-27
2024-11-06
  • Dave Macias

    Dave Macias - 2021-07-27

    Hello,
    Happy Tuesday!
    First time poster here. :)

    So here is what we currently have:
    USB Stick with clonezilla live which we Kickstart PCs
    -> cat USBSTICK/Clonezilla-Live-Version

    clonezilla-live-2.6.4-10-amd64
    This Clonezilla live iso file was created by this command:
    ocs-iso -s --extra-boot-param quiet -y 6.03 -i 2.6.4-10-amd64

    Which we boot from, then kickstart the PCs using the following grub.cfg
    -> cat USBSTICK/boot/grub/grub.cfg

    menuentry "Kickstart"{
    search --set -f /live/vmlinuz
    linux /live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 locales=en_US.UTF-8 keyboard-layouts=NONE ocs_live_extra_param="" ocs_prerun1="dhclient -v eth0" ocs_prerun2="sudo sshpass -p <redacted> scp -r -o StrictHostKeyChecking=no clonezilla-user@mydomain.com:/home/clonezilla-user/2021-07-20-07-img-NEW_HARDWARE-OLD-CENTOS7/ /home/partimag/" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -j2 -batch -scr -p poweroff restoredisk 2021-07-20-07-img-NEW_HARDWARE-OLD-CENTOS7 sda" ocs_live_batch="yes" vga=788 ip= net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
    initrd /live/initrd.img
    }</redacted>

    We have no issues with the above.

    We want to move to the next step and kickstart with pxe boot. (no usbstick)

    I was able to successfully create a pxe boot server using http, which allows me to install a minimal Centos7 image.
    Both with legacy and UEFI boot.

    I am trying now, to add clonezilla live into this pxe server but struggling....

    Here is how i have my pxe server configured:

    -> cat /etc/dhcp/dhcpd.conf

    not authoritative;
    allow booting;
    allow bootp;
    option option-128 code 128 = string;
    option option-129 code 129 = text;
    option space pxelinux;
    option pxelinux.magic code 208 = string;
    option pxelinux.configfile code 209 = text;
    option pxelinux.pathprefix code 210 = text;
    option pxelinux.reboottime code 211 = unsigned integer 32;
    option architecture-type code 93 = unsigned integer 16;
    ddns-update-style none;
    ignore client-updates;
    option domain-name "greenpoints.com";
    default-lease-time 600 ;
    max-lease-time 7200 ;
    subnet 192.168.201.0 netmask 255.255.255.0 {
    range 192.168.201.60 192.168.201.99;
    option routers 192.168.201.1;
    option domain-name-servers 8.8.8.8;
    option subnet-mask 255.255.255.0;
    class "pxe" {
    match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
    next-server 192.168.201.1;
    if option architecture-type = 00:07 {
    # for uefi; which installs a basic centos7 image
    filename "/centos7/grubx64.efi";
    } else {
    # legacy
    filename "pxelinux.0";
    }
    }
    }

    -> cat /var/lib/tftpboot/pxelinux.cfg/default

    default menu.c32
    prompt 0
    timeout 300
    ONTIMEOUT 1

    menu title ########## PXE Boot Menu ##########

    label 1
    menu label ^1) Install CentOS 7
    menu default
    kernel centos7_x64/images/pxeboot/vmlinuz
    append initrd=centos7_x64/images/pxeboot/initrd.img inst.xdriver=vesa nomodeset method=http://192.168.201.1/centos7_x64 devfs=nomount

    #not working
    label 2
    menu label ^2) Clonzezilla
    kernel /clonezilla/vmlinuz
    append initrd=/clonezilla/initrd.img boot=live username=user union=overlay components noswap noprompt vga=788 keyboard-layouts=en locales=en_US.UTF-8 fetch=tftp:192.168.201.1/clonezilla/filesystem.squashfs

    label 9
    menu label ^9) Boot from local drive
    localboot 0

    -> cat /var/lib/tftpboot/centos7/grub.cfg

    set timeout=5
    menuentry "Clonezilla - Kickstart"{
    linuxefi /clonezilla/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 locales=en_US.UTF-8 keyboard-layouts=NONE ocs_live_extra_param="" ocs_prerun1="dhclient -v eth0" ocs_prerun2="sudo sshpass -p <redacted> scp -r -o StrictHostKeyChecking=no clonezilla-user@mydomain.com:/home/clonezilla-user/2021-07-20-07-img-NEW_HARDWARE-OLD-CENTOS7/ /home/partimag/" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -j2 -c -scr -p choose restoredisk 2021-07-20-07-img-NEW_HARDWARE-OLD-CENTOS7 sda" ocs_live_batch="no" vga=788 ip=dhcp net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
    initrdefi /clonezilla/initrd.img
    }
    menuentry 'Install - CentOS 7' {
    linuxefi centos7/vmlinuz ip=dhcp inst.repo=http://192.168.201.1/centos7_x64
    initrdefi centos7/initrd.img
    }</redacted>

    my tftp dir structure

    pwd
    /var/lib/tftpboot
    ls clonezilla
    EFI filesystem.squashfs initrd.img vmlinuz
    ls centos7/
    BOOTIA32.EFI BOOTX64.EFI fonts grub.cfg grubia32.efi grubx64.efi initrd.img mmia32.efi mmx64.efi README.txt TRANS.TBL vmlinuz

    The files in tftpboot/clonezilla are taken from clonezilla-live-2.6.4-10-amd64.iso

    When I boot using grub.cfg (uefi) and select the clonezilla menuentry, it goes into initramfs ...
    I feel like im close!

    Any input is much appreciated!!

    Thank you,
    Dave

     

    Last edit: Dave Macias 2021-07-27
  • Steven Shiau

    Steven Shiau - 2021-08-02

    So you use pxelinux for uEFI netboot? If so, I suggest you switch to grub. You can follow this:
    https://clonezilla.org/show-live-doc-content.php?topic=clonezilla-live/doc/11_lite_server
    If you start it, it will create a file in /tftpboot/nbi_img/grub/grub.cfg.
    You can switch to console 2 by pressing ctrl-alt-F2 to read that file.

    Steven

     
  • Steven Shiau

    Steven Shiau - 2021-08-02

    It's nice to know you have made it.
    Great.

    Steven

     
  • Viet Than

    Viet Than - 2022-10-04

    Hi guys, another first time poster, Dave Macias left the company but he made us some documentation that led to this forum as we inherit this system.

    We are looking to create a second pxe server to boot from and did the steps like Dave did above.

    However, when we get a client plugged in and PXE boot, the screen is stuck at:

    >>Checking Media Presence......
    >>Media Present......
    >>Start PXE over IPv4
      Station IP address is 192.168.100.60
    

    Any input is much appreciated!

    Edit1: I found that with a booted client, I can't ping 8.8.8.8

    Viet

     

    Last edit: Viet Than 2022-10-04
  • Viet Than

    Viet Than - 2022-10-04

    Just want to come back and say we got it working, it was a routing/network problem.

     
    • Dave Macias

      Dave Macias - 2022-10-04

      Boss!

       
      😄
      1

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.