Installing PVE 6.2 from PXE, both initrd and loopback methods are broken

sacarias

Active Member
Oct 2, 2019
59
0
26
Trying to install latest PVE 6.2 from PXE. First tried the "initrd" method.

So I extracted linux26 and initrd.img from Proxmox ISO, and prepared a new initrd.img by copying ISO inside it and repacking. Then put both files in the PXE server.
The grub config entry is like this (based on Proxmox ISO's /boot/grub/grub.cfg):
Code:
menuentry 'Proxmox Installer'{
   bootoptions=ramdisk_size=16777216 rw quiet splash=silent
   linux <url>/proxmox/linux26 $bootoptions
   initrd <url>/proxmox/initrd.iso.img
}

This worked with PVE 6.0, which ISO was circa 750 Mb size.

However, this no longer works with PVE 6.2, which ISO is circa 860 Mb. Upon booting I get the following:
Code:
error: the initrd is too big
Press any key to continue

I "fixed" it by changing "linux" for "linuxefi", and "initrd" for "initrdefi" in the grub config entry above. Then it seemingly booted normally.

Could someone help me understand why this happens?
Does it mean Proxmox can no longer be installed on legacy BIOS machines?

Thanks.
 
Last edited:
So I extracted linux26 and initrd.img from Proxmox ISO, and prepared a new initrd.img by copying ISO inside it and repacking. Then put both files in the PXE server.
By "repacking", do you mean you created a new cpio archive? Did you try compressing it (e.g. gzip)? That should decrease the size.

I "fixed" it by changing "linux" for "linuxefi", and "initrd" for "initrdefi" in the grub config entry above. Then it seemingly booted normally.

Could someone help me understand why this happens?
Does it mean Proxmox can no longer be installed on legacy BIOS machines?
No, legacy BIOS is definitely supported, the reason in your case was just that EFI probably supports larger initrd's, so it wasn't a problem that your repacking increased the size.
 
By "repacking", do you mean you created a new cpio archive? Did you try compressing it (e.g. gzip)? That should decrease the size.


No, legacy BIOS is definitely supported, the reason in your case was just that EFI probably supports larger initrd's, so it wasn't a problem that your repacking increased the size.

I repacked by using this command:
Code:
find . | cpio -c -o | gzip -9 > ../initrd.iso.img
The result was a 880 Mb size initrd img file. If I check it with the "file" command I get "gzip compressed file [...] max compression".
The original Proxmox 6.2 ISO is 862 Mb size.

EDIT: just doublechecked by doing the whole process with a Proxmox 6.0 ISO again, which results in a circa 760 Mb size img file, and booting this img file gives no errors with plain "linux" and "initrd". But the larger initrd img file for Proxmox 6.2 gives the error and needs "linuxefi" and "initrdefi".

So if needing to install Proxmox in legacy BIOS, I can no longer do it via PXE and need to do it via writing the ISO to a DVD or USB?
 
Last edited:
Your command looks ok in general, so yes, that seems to indicate that this way of PXE booting no longer works. In general, there should be a way to boot the official ISO directly via PXE as well, without repacking, but if that's your preferred workflow I'm afraid it is indeed broken.

Considering it still works with UEFI and pretty much all somewhat modern hardware supports that these days, I suppose it's less of an issue, but if you're really bothered by it you can of course open an issue on our bugtracker - though I'm not sure if there even is an easy fix for it.
 
Your command looks ok in general, so yes, that seems to indicate that this way of PXE booting no longer works. In general, there should be a way to boot the official ISO directly via PXE as well, without repacking, but if that's your preferred workflow I'm afraid it is indeed broken.

Considering it still works with UEFI and pretty much all somewhat modern hardware supports that these days, I suppose it's less of an issue, but if you're really bothered by it you can of course open an issue on our bugtracker - though I'm not sure if there even is an easy fix for it.

Of course this is *not* my preferred workflow; that would be indeed booting the official ISO directly, just as you mention.

Which gets me to the second method I tried.

I had already tried the case of putting the Proxmox ISO in another file system partition, and then using Grub2's feature of loopback devices. Please see previous thread of mine here. Seemingly the same can apply to ISO placed in PXE.

But, as I well describe in that thread along with details, there's a problem with Debian-based distros including Proxmox itself: they have an initrd lacking some scripts and thus making loopback to fail.

Indeed, I gave a try again booting the original Proxmox 6.2 ISO via Grub2 loopback with a menuentry similar to this one (sorry, I'm away from the office, so it's best effort memory):
Code:
(previously defined $isopath with PXE server address)
loopback loop $isopath
menuentry 'Proxmox Installer'{
   bootoptions=ramdisk_size=16777216 rw quiet splash=silent
   linux (loop)/boot/linux26 $bootoptions
   initrd (loop)/boot/initrd.img
}
And the -expected- result: kernel loaded but "cannot find cdrom".

In the previous thread I tried asking if Proxmox's initrd could be fixed, and @Alwin, a staff member, despotically answered this.

@Stefan_R:
Do you think something could be done to "fix" Proxmox initrd so it can be used with Grub2 loopback?
Or can there be another way to be able to directly boot official Proxmox ISO via PXE?

Thanks.
 
Last edited:
When trying to boot using the above menuentry with Grub2 loopback, the output was this:
Code:
[...]
searching for block device containing the ISO proxmox-ve-6.2-1
with ISO ID 'd39f6c1c-92f3-11ea-8823-3bf1bb1bc4e6'
testing device '/dev/sr0' for ISO
testing again in 5 seconds
testing device '/dev/sr0' for ISO
testing device '/dev/sda' for ISO
found ISO9660 FS but no or wrong proxmox cd-id, skipping
testing again in 5 seconds
[...]
no cdrom found
unable to continue (type exit or CTRL-D to reboot)

@Stefan_R:
Do you think something can be done for this?
 
I tried tracing the above error to the init script within ISO's /boot/initrd.img file. This seems to be the relevant part:
Code:
else

    cdrom=

    initrdisoimage="/proxmox.iso"

    if [ -f $initrdisoimage ]; then
    # this is useful for PXE boot
    echo "found proxmox ISO image inside initrd image"
    if mount -t iso9660 -o loop,ro $initrdisoimage /mnt >/dev/null 2>&1; then
        cdrom=$initrdisoimage
    fi
    else
    echo "searching for block device containing the ISO $ISONAME-$RELEASE-$ISORELEASE"
    reqid="$(cat /.pve-cd-id.txt)"
    echo "with ISO ID '$reqid'"
    for try in 5 4 3 2 1; do
        for i in /sys/block/hd* /sys/block/sr* /sys/block/scd* /sys/block/sd* /sys/block/nvme*; do

        # don't try to mount /all/ devices, as it produces IO, as a
        # heuristic check all those which are removable and all those
        # which are of type iso9660 (we can mount only those anyway) and those
        # which have it's main partition < 1 GiB (ISO has normally 750MiB)
        # this also gets USB sticks on strange systems where the
        # firmware says it's not removable...
        if [ -d "$i" ]; then
            basedev="${i##*/}"
            path="/dev/$basedev"

            if [ "$(cat "$i/removable")" = 1 ] ||
                 blkid "$path" | grep -q ' TYPE="iso9660"' ||
               [ "$(cat "$i/size")" -lt $(( 1024 * 1024 * 65 )) ]
            then
            echo "testing device '$path' for ISO"
            if mount -t iso9660 -o ro "$path" /mnt >/dev/null 2>&1; then
                if [ -r /mnt/.pve-cd-id.txt ] && [ "X$(cat /mnt/.pve-cd-id.txt)" = "X$reqid" ]; then
                echo "found $PRODUCTLONG ISO"
                cdrom=$path
                break
                else
                echo "found ISO9660 FS but no or wrong proxmox cd-id, skipping"
                fi
                umount /mnt
            fi
            else
            {
            echo "dev $i either not removable, not of type 'iso9660' and/or to big, skipping ISO check";
            echo "  removable: $(cat "$i/removable")";
            echo "  blkid: $(blkid "$path")";
            } >> skipped-devs.txt
            fi
        fi
        done
        if test -n "$cdrom"; then
        break;
        fi
        if test $try -gt 1; then
        echo "testing again in 5 seconds"
        sleep 5
        fi
    done
    fi

    if [ -z $cdrom ]; then
    debugsh_err_reboot "no cdrom found"
    fi
fi

As far as I could understand, script looks for Proxmox ISO into physical cdrom drives and detected hard drives -even SSD drives-, but no loopback devices are checked anywhere. For some weird reason /dev/sda in my case is detected as iso9660 and is tested, getting the "found ISO9660 FS..." error.

So perhaps is not initrd lacking modules (like Debian-like distros) as I tried to guess previously, but just lacking some instructions.

Overall, though init script has changed over Proxmox releases, this looks like this same problem from a decade ago.
@dietmar had said back then that something could be done, but up until now nothing...

By the way, I did file a bug report. Totally ignored until now...
 
Last edited:
Do I need to pay in order to not be ignored?
You even ignore some subscribers...
 
Do I need to pay in order to not be ignored?
You even ignore some subscribers...
No one ignores anything, but it looks your request is not on top priority.

But yes, if you are a subscriber you can get guaranteed SLA, you will get a fast answer (or the money back).
 
You mix here topics
I edited thread title and some of my posts. Let's see if it now sounds more "on-topic"...

your posting style will for sure NOT help to motivate someone to help you with your specific problem ...
"my posting style"?
I have no idea what you talk about
 
Use this script: https://github.com/morph027/pve-iso-2-pxe this method work for PXE and USB boot

If You want boot "pure" proxmox iso, use servers with iLO, DRAC or something like this.

Or, You can prepare own "rescue" image with proxmox.iso and qemu inside, boot from these "rescue" image and install Proxmox VE through qemu.
 
I use kernel and modified (by script from url in message #14) initrd from original proxmox iso.

You have all needed information, try using it.
 
I use kernel and modified (by script from url in message #14) initrd from original proxmox iso.

I already used the script, getting same results as post #1 of this thread.

Code:
linux http://${webserver}/proxmox/${version}/linux26
initrd http://${webserver}/proxmox/${version}/initrd.iso.img
For me this is broken in PVE 6.2. See post #1.

Code:
linuxefi http://${webserver}/proxmox/${version}/linux26
initrdefi http://${webserver}/proxmox/${version}/initrd.iso.img
Makes PVE 6.2 work again, but at the cost of not being able to install this way on legacy BIOS machines.
 
PXE HTTP boot

Config:
Code:
label Proxmox621
        menu label Install Proxmox 6.2.1
        linux /proxmox/linux26621
        initrd /proxmox/initrd621.iso.img splash=verbose
        append vga=791 video=vesafb:ywrap,mtrr ramdisk_size=16777216 rw splash=verbose

label Proxmox621D
        menu label Install Proxmox 6.2.1 (Debug Mode)
        linux /proxmox/linux26621
        initrd /proxmox/initrd621.iso.img splash=verbose
        append vga=791 video=vesafb:ywrap,mtrr ramdisk_size=16777216 rw splash=verbose proxdebug

label Proxmox621-http
        menu label Install Proxmox 6.2.1 HTTP
        linux http://192.168.12.200/proxmox/linux26621
        initrd http://192.168.12.200/proxmox/initrd621.iso.img splash=verbose
        append vga=791 video=vesafb:ywrap,mtrr ramdisk_size=16777216 rw quiet splash=verbose

label Proxmox621D-http
        menu label Install Proxmox 6.2.1 HTTP (Debug)
        linux http://192.168.12.200/proxmox/linux26621
        initrd http://192.168.12.200/proxmox/initrd621.iso.img splash=verbose
        append vga=791 video=vesafb:ywrap,mtrr ramdisk_size=16777216 rw quiet splash=verbose proxdebug

How many RAM on your "legacy BIOS machines" ?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!