-   Linux - Server (
-   -   Unable to PXEboot Minimal CentOS via pxelinux (

joshualan 07-09-2012 02:17 PM

Unable to PXEboot Minimal CentOS via pxelinux
I am trying to pxeboot minimal CentOS. I basically installed the minimal CentOS on sda1 on my machine, used the comand 'dd' to make an initrd.img. It complained that it was too large when I tried to boot it so I used:

gzip < initrd.img > initrd-boot.img

Seems to be working fine though.

Here is my pxelinux.cfg file:
DEFAULT pxeboot
LABEL pxeboot
append initrd=/initrd2.img console=ttyS0 nodiskmount nolvmmount root=/dev/ram0 ramdisk_size=80000000 rootfstype=tmpfs init=/sbin/init

When I try to boot it though, I get an error saying:

Kernel panic - not syncing: No init found. Try passing init= option to kernel.

I checked and my minimal install DOES contain /sbin/init so I'm just wondering why it refuses to work.

smallpond 07-09-2012 02:32 PM

80GB ramdisk? Hope that's enough.

jefro 07-09-2012 02:50 PM

It supports the easier to read ramdisk_size=80MB as choice.

Why did you use the /initrd2.img? Put that file in the correct place on your tftp server.

Dunno about the ram0. I forget the difference but you didn't get that far in the boot process.

joshualan 07-09-2012 03:07 PM

Yeah, the initrd2.img is already in the tftp server, initrd.img is the uncompressed file so I just named it initr2.img

And that was a typo, I kept getting a read/write error and it only went away when I put an obscenely large number for the ramdisk size.

jefro 07-09-2012 09:38 PM

What is the block size of the tftp server?

TobiSGD 07-09-2012 10:20 PM

Do you have compiled support for the filesystem of the compressed image into your kernel (not as module)?
Otherwise you have a simple problem: The kernel can't run the init-process, just because it can't access the file-system.

joshualan 07-10-2012 03:17 PM

I'm not sure about the block size of my TFTP server, how do I find that out?

TobiSGD, I suspect that's the problem. Would the fix be a make menuconfig and change the ext2, ext3, and ext4 from <m> to <*> file systens on the kernel?

TobiSGD 07-10-2012 03:50 PM

Yes, that would be the fix if that is really the problem, which I think it. It may be that there are more problems when I take a look at the approach you have chosen, but this should be the first step.

joshualan 08-02-2012 03:09 PM

Figured It Out
Just in case anyone stumbles on this same problem, initrd needs to be in a CPIO archive! Let's assume in /home/LQ/src you have the root folders like usr, src, var, boot, etc. You'd have to use this command:

cd /home/LQ/src
find . | cpio -o -H newc --verbose | gzip > ../initramfs.gz

All times are GMT -5. The time now is 02:47 AM.