I'm using netboot/pxeboot with grub.
menuentry "Install Ubuntu 20.04" {
set gfxpayload=keep
echo 'Loading vmlinuz ...'
linux /tftp/vmlinuz ip=dhcp netboot=nfs nfsroot=10.0.0.20:/data/netboot/nfs/ubuntu2004/ boot=casper toram noquiet splash=off console=tty0 console=ttyS1,57600n8 ---
echo 'Loading initrd, this takes a long time ...'
initrd /tftp/initrd
}
It works fine, however, the loading of initrd over tftp is taking a long time (30+ minutes). I would like to compress (gz/bz2) this file to save on some file transfer time.
I had seen some examples out there referring to a initrd.gz
(One example: https://unix.stackexchange.com/questions/217002/which-iso-file-vmlinuz-and-initrd-gz-to-use-for-installing-centos-from-multiboo) but when I tried to just compress the file with gzip and use it, I get an error such as:
[ 12.543547] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 12.558487] Please append a correct "root=" boot option; here are the available partitions:
[ 12.575161] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Is there a way to compress this file so it can transfer a smaller file size, and have it uncompress before it tries to mount the root fs?
Alternatively, is there a way to transfer it over a different protocol (HTTP/FTP/SFTP/SCP/etc) ?
An initrd is a compressed CPIO structure created from a file tree structure with a command like:
The
ubuntu-20.04-desktop-amd64
initrd is already compressed and weights about 87MB. TFTP transfer of that file should be around 36 seconds.If your TFTP transfer takes half an hour you have a different problem in your network-TFTP setup. A Wireshark traffic capture can help you to pin point your issue.
@Pat's answer is accepted and more detailed, however here are the direct answers to the original questions:
No, it's already compressed. The accepted answer gives an example of this.
Not with regular PXE. Use another network boot system, like iPXE, which allows http/nfs