You are not logged in.

#1 2012-05-01 14:55:59

ealrann
Member
Registered: 2012-03-22
Posts: 9

PXE : can't boot (initramfs ?) [solved]

Hi all !

I have followed these tutorials on pxe, step by step, more than once :

https://wiki.archlinux.org/index.php/Di … t_NFS_root
https://wiki.archlinux.org/index.php/Di … t_NBD_root

But I always have the same problem : "Boot failled".

The client computer is able to get the tftp server address and get the kernel.

So it loads the vmlinuz-linux and it's "OK".
Then it loads the initramfs and ... never end. After a moment, the client finally shows "Boot failled" (no other message sad ).


I tried to remake the initramfs with mkinitcpio, but nothing change. I had check the NFS share (for the first tutorial), and it was accessible through network.

So I need help please sad , I don't know what to do.

Currently, I have the exact same configuration that the second tutorial (https://wiki.archlinux.org/index.php/Di … t_NBD_root)




EDIT : The solution is :

brain0 wrote:
tuxtard wrote:

service tftp
{
    per_source = 11
    socket_type = dgram
    protocol = udp
    user = root
    server = /usr/sbin/tftpd
    server_args = /diskless/boot
    wait = yes
    cps = 100 2
}

/etc/conf.d/tftpd:
TFTPD_ARGS="-l -s /diskless"

@Brain0
I am using default tftp-hpa with xinetd.

That is not tftp-hpa, but iputils/tftpd, which is sort of broken. tftp-hpa is in /usr/sbin/in.tftpd, and there is no xinetd file for it currently (only rc.d script and systemd socket-activated unit).

tuxtard wrote:

Well guys, that was IT! When I switched to tftp-hpa I was able to boot normally. Now we all know that we should stay clear of xinetd and use regular tftp-hpa. That was the only problem in the Network boot guide I was following. Thank you all so much on your help!

Thank you all !

Last edited by ealrann (2012-10-12 16:36:50)

Offline

#2 2012-10-11 13:11:46

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

I have exactly the same problem. I've created a test environment and followed this guide completely: https://wiki.archlinux.org/index.php/Di … t_NBD_root
vmlinuz-linux loads but the initramfs starts loading and then stops at some point. I don't know what could be the problem, but it lies in the TFTP configuration or the mkinitcpio process.

Offline

#3 2012-10-11 14:11:42

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: PXE : can't boot (initramfs ?) [solved]

I haven't tested this for a while (and apparently, nobody else has either), but I can say that this used to work. I'm not going to look into it, but feel free to ask more specific questions when you try to figure out what's wrong.

Offline

#4 2012-10-11 14:30:06

ealrann
Member
Registered: 2012-03-22
Posts: 9

Re: PXE : can't boot (initramfs ?) [solved]

Sorry tuxtard, I never solved this, so I can't help. But I'm always interested by a solution.

Offline

#5 2012-10-11 14:47:53

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,040

Re: PXE : can't boot (initramfs ?) [solved]

I have success with it, I use PXE all the time.
For a PXE client, all you need in /etc/mkinitcpio.conf is NFS in MODULES, and base, udev, net, autodetect in HOOKS.  The rest of it will come in if you want to actually mount a device after it mounts root.
This will make your initramfs smaller if you are having size limitations, in which you would access the file through the web server (/srv/www).
Probably what you are doing wrong is putting the kernel and initramfs separate from the rest of the root filesystem.
In /srv/tftp the only thing I have there is pxelinux.cfg and pxelinux.0.  Then I have a directory for the root filesystem including the /boot where the kernel and initramfs that I boot from just like a regular root filesystem.  Tftp server's root is /srv/tftp and NFS root is /srv/tftp/<some root filesystem> shared in /etc/exports.  Did you remember to give your client a DHCP address?

Last edited by nomorewindows (2012-10-11 14:48:53)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#6 2012-10-11 16:22:50

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

Yes, I have a DHCP server running fine. When I set autodetect hook in the mkinitcpio.conf file, when I run the mkinitcpio command I get "ERROR: failed to detect root filesystem", but the process does not stop there and generates the image successfully.

Offline

#7 2012-10-11 16:40:27

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,040

Re: PXE : can't boot (initramfs ?) [solved]

Did you remember to mount proc, sys, and dev and run mkinitcpio under chroot?


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#8 2012-10-11 16:43:52

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

@nomorewindows
I've followed that guide exactly, no more and no less. I am new to network boot concept so I can't figure out at the moment if some steps in that guide are wrong or missing, but I am trying to learn as much as I can on the fly. I've tried this in both virtual and hardware environment and I get the same result. Here's the shot of the error screen:

http://s10.postimage.org/njsn7hpd3/IMG_ … 142526.jpg

Last edited by tuxtard (2012-10-11 16:46:33)

Offline

#9 2012-10-11 16:45:35

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,040

Re: PXE : can't boot (initramfs ?) [solved]

Uh oh it thinks the link is broke.--It's working now.
You have all the arguments appended to the kernel line?
What does your pxelinux.cfg/default look like?

Last edited by nomorewindows (2012-10-11 16:48:05)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#10 2012-10-11 16:45:51

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

nomorewindows wrote:

Did you remember to mount proc, sys, and dev and run mkinitcpio under chroot?

Yes, I did that. And when I set the autodetect hook I get the "failed to detect root filesystem" error.

Offline

#11 2012-10-11 16:51:04

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

nomorewindows wrote:

Uh oh it thinks the link is broke.--It's working now.
You have all the arguments appended to the kernel line?
What does your pxelinux.cfg/default look like?

It is really the same as in the mentioned guide, so it looks like this:

default linux

label linux
kernel vmlinuz-linux
append initrd=initramfs-linux.img rootfstype=nfs root=/dev/nfs nfsroot=10.0.0.1:/diskless,v4,rsize=16384,wsize=16384 ip=:::::eth0:dhcp

The only thing that is changed is the folder name.

Last edited by tuxtard (2012-10-11 16:51:34)

Offline

#12 2012-10-11 16:51:48

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,040

Re: PXE : can't boot (initramfs ?) [solved]

tuxtard wrote:
nomorewindows wrote:

Did you remember to mount proc, sys, and dev and run mkinitcpio under chroot?

Yes, I did that. And when I set the autodetect hook I get the "failed to detect root filesystem" error.

I have gotten the failed to detect root filesystem error before, I don't remember what I did differently.  Maybe used a working machine to make the image, but I just did a fresh PXE install to try out the systemd on it and the latest kernel, and to preserve the PXE image I already had and coming up with some differences.  It's almost like your vmlinuz-linux is corrupt; this is the file that doesn't change.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#13 2012-10-11 16:56:13

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,040

Re: PXE : can't boot (initramfs ?) [solved]

tuxtard wrote:
nomorewindows wrote:

Uh oh it thinks the link is broke.--It's working now.
You have all the arguments appended to the kernel line?
What does your pxelinux.cfg/default look like?

It is really the same as in the mentioned guide, so it looks like this:

default linux

label linux
kernel vmlinuz-linux
append initrd=initramfs-linux.img rootfstype=nfs root=/dev/nfs nfsroot=10.0.0.1:/diskless,v4,rsize=16384,wsize=16384 ip=:::::eth0:dhcp

The only thing that is changed is the folder name.

That's it right there
kernel vmlinuz-linux needs to be diskless/boot/vmlinuz-linux (but with tftp it would actually be located at /srv/tftp/diskless/boot/vmlinuz-linux).
initrd=initramfs-linux.img needs to be diskless/boot/initramfs-linux.img and nfsroot=10.0.0.1:/srv/tftp/diskless
ip=::::::dhcp is fine eth0 isn't needed.  If you have conflicts with a wireless device (which is kind of pointless on a diskless workstation), install the firmware and blacklist it (if needed would be included in FILES mkinitcpio.conf)

Just make a directory diskless under /srv/tftp and mount your stuff on diskless or mv your /diskless to /srv/tftp whichever applies.
Also make your /etc/exports point to /srv/tftp/diskless not /diskless.

You should be set!

Last edited by nomorewindows (2012-10-11 17:47:48)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#14 2012-10-11 16:59:15

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

@nomorewindows
Thank you for your effort. I will try these and wait to see what happens.

Offline

#15 2012-10-11 18:06:03

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

Unfortunately it did not help. I've changed paths as you suggested, but then TFTP wasn't able to find vmlinuz nor initramfs. It seems that the initial paths correspond to the other settings from the network boot guide and are correct. PXE does load vmlinuz correctly and initramfs loads for some time (I can see the network load goes up to the maximum), but then it stops for no apparent reason. I was also able to run mkinitcpio this time without any errors using arch-chroot instead of the regular chroot, but even now I am unable to boot.

Offline

#16 2012-10-11 18:40:38

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,040

Re: PXE : can't boot (initramfs ?) [solved]

arch-chroot, that sounds like you are using the LiveCD to do that with, and not daisychaining off of a running ArchLinux.
Check /etc/conf.d/tftpd to make sure it is pointing to /srv/tftp it used to be /var/tftpboot
And you changed the paths in pxelinux.cfg/default: kernel diskless/boot/vmlinuz-linux and not /diskless/boot/vmlinuz-linux
If you changed /etc/exports, you did exportfs -r
And you have mkinitcpio-nfs-utils installed?  For net HOOK and nfs modules it would have to be installed to make an initramfs image.

Just comment out everything below kernel and see what it does just for grins or comment out the default line and go to the pxelinux command line and type the kernel line manually.  It should respond back with some hexidecimal numbers showing it loaded properly.  Then type in initrd=diskless/boot/initramfs-linux.img without the rest of it and see if it takes the initramfs or what error it shows.
Your screenshot is missing a / for TFTP prefix, not sure if this would change anything.
If nothing else go to your initramfs-linux image and type lsinitcpio initramfs-linux.img | less to see it's contents.

It does say in the wiki article that tftp is basically just the pxelinux.cfg, pxelinux.0, and the vmlinuz-linux and initramfs-linux.img files, and that you could actually have the NFS root located on another server and mount it.  I just save the steps of having to copy the new kernel files over to tftp by just having the root filesystem underneath the tftp directory and have the pxelinux.cfg/default just call the kernel from underneath the tftp directory (in the same place), it just saves an extra step.  Maybe your network card is having collisions on the network and corrupting the image.

Last edited by nomorewindows (2012-10-11 18:56:11)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#17 2012-10-11 19:21:35

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

Well I am not using livecd, I've just installed arch-install-scripts packet to try arch-chroot. I made some progress though. I've generated initramfs in a regular environment, not using chroot, and copied it to the proper place. With this initramfs (this one is 3.2 mb big and the other one generated in chroot environment is 19 mb big) I was able to actually boot the kernel. Now I am stuck at "Device /dev/nfs not found" and being dropped to a recovery shell. So I guess that the problem itself wasn't in the tftp configuration but the initramfs file itself. I don't know why it is not generated properly in the chroot environment.

Offline

#18 2012-10-11 19:35:02

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,040

Re: PXE : can't boot (initramfs ?) [solved]

FYI...if your client has the exact architecture as the host, you should just be able to generate from the host.  You can even add net and nfs to your host's mkinitcpio.conf and it will not harm it if it isn't used.  You can then copy the kernel files over to your tftp as long as you keep updating the PXE client at the same time.  Which it just still saves work to have the NFS export under the tftp directory.
My working initramfs-linux image right now is 19MB. The vmlinuz-linux is 3MB.

From the recovery shell, you should be able to get an ip address and to mount 10.0.0.1:/srv/tftp/diskless to new_root.

What arch is your host and what arch is your PXE client?

Last edited by nomorewindows (2012-10-11 19:37:16)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#19 2012-10-11 19:48:28

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

Yes that's just what I did, but I forgot to add net hook to the mkinitcpio.conf, so that's why image was only 3,2 mb and that's why it was able to boot to the recovery shell. When I put net hook to the host's mkinitcpio.conf and copied initramfs (now again it has 19mb) to the proper place it again stuck on the initramfs loading screen sad I also tried both i686 and x64 architectures, there is no difference.

Last edited by tuxtard (2012-10-11 19:49:06)

Offline

#20 2012-10-11 19:54:31

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,040

Re: PXE : can't boot (initramfs ?) [solved]

If your computer boots on both architectures (I'm guessing it's your PXE client), then your PXE client is at least 64-bit which will work either way.  I usually just go with 32-bits for a PXE client unless they are over the 4GB memory limit then it's time for the 64-bits.  I still don't know exactly what your host is.  Did you remember to put nfs in modules in mkinitcpio.conf when you did net hook?


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#21 2012-10-11 20:00:33

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

Yes, I've put nfs in modules section. So without nfs in modules and net in hooks kernel is able to decompress and start in the recovery shell, but with the nfs and net hook it just hangs upon loading initramfs. It does not even try to decompress the image nor mount the nfs, just hangs there. I really don't know what could be the problem. I am now testing this in VirtualBox environment, but this morning I tried it in a real network with my server as a host and laptop as a client. The result was the same as when I used VirtualBox host and client.

Offline

#22 2012-10-11 20:11:20

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

@nomorewindows
Can you please send me your working nfs export line and append line? Maybe problem lies in the nfs configuration.

Offline

#23 2012-10-11 20:17:05

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,040

Re: PXE : can't boot (initramfs ?) [solved]

Qemu has command-line arguments that let you test the PXE configuration from your tftp on the same machine.
VirtualBox with the downloaded ipxe.iso for the CD, is the way you can get IPXE to run, but still from the same machine.
This sounds strange unless your equipment is having a problem.
Have it load memtest or something from PXE, kernel memtest+.bin, something that can be tested easily.  Remember to install it and then copy the file to your tftp directory and make it default in your pxelinux.cfg/default.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#24 2012-10-11 20:27:02

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,040

Re: PXE : can't boot (initramfs ?) [solved]

tuxtard wrote:

@nomorewindows
Can you please send me your working nfs export line and append line? Maybe problem lies in the nfs configuration.

It's stalling at the loading of the kernel files, I doubt that is it, but the line I'm using it right out of the wiki.

/etc/exports:
/srv/tftp/diskless *(rw,fsid=0,no_root_squash,no_subtree_check)

/etc/conf.d/tftpd:
TFTPD_ARGS="-l -s /srv/tftp"

/srv/tftp/pxelinux.cfg/default:
default linux
label linux
kernel diskless/boot/vmlinuz-linux
append initrd=diskless/boot/initramfs-linux.img rootfstype=nfs root=/dev/nfs nfsroot=x.x.x.x:/srv/tftp/diskless,v3,rsize=16384,wsize=16384 ip=::::::dhcp


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#25 2012-10-11 20:46:00

tuxtard
Member
Registered: 2012-10-11
Posts: 30

Re: PXE : can't boot (initramfs ?) [solved]

Yeah, that isn't it. The only difference is a NFS version. I switched to v3 but got the same result, obviously. I will check my hardware but I guess that since I have the same problem with virtual and hardware environment and since Ealrann has the same problem as I do, that there is some kind of an error in that guide or maybe a bug in mkinitcpio.

Offline

Board footer

Powered by FluxBB