Fedora diskless workstation - boot via PXE always fails
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Fedora diskless workstation - boot via PXE always fails
Hello, I am having problems creating a diskless fedora 12 workstation. I have my boot server set-up, dhcp works, tftp works, pxelinux.0 gets sent.
I have installed fedora12 locally [to hdd from dvd] on the desired to-be-diskless workstation and then copied the whole / [root] to my boot server to location /netboot/movieserver. Then I have installed the dracut-network package and a new kernel [on the to-be-diskless pc]. I have copied the /boot/vmlinuz-xxxx and /boot/initramfs-xxxx.img from the to-be-diskless to my bootserver's /var/lib/tftpboot/images/F12-x86_64/vmlinuz and /var/lib/tftpboot/images/F12-x86_64/initramfs.img
Boot options for pxelinux are listed below (the whole pxe config file):
MENU TITLE NETWORK BOOT SERVER
MENU LABEL Fedora 12 x86_64
APPEND root=/netboot/movieserver/ initrd=/images/F12-x86_64/initramfs.img rdshell
MENU LABEL Boot z lokalneho disku
next-server in dhcp is the correct IP.
Initramfs always fails with "no root device found". But the whole new root *is* mounted in /sysroot. It is accessible.
/etc/exports on my bootserver:
/netboot/movieserver 192.168.0.114(rw,no_all_squash,no_root_squash) 192.168.0.113(ro,all_squash)
the "deskless" client's ip is set statically to 192.168.0.114.
Is there anything I am missing? Any info is appreciated. Google is full of outdated information.
You seem to have a boot server that is basically unused. The kernel, upon being launched by the bootloader, must be told that it is to use an NFS root, and it must be told what NFS root filesystem to use:
MENU LABEL Fedora 12 x86_64
APPEND root=/dev/nfs nfsroot=WW.XX.YY.ZZ:/netboot/movieserver/ initrd=/images/F12-x86_64/initramfs.img rdshell
Substitute 'WW.XX.YY.ZZ' with the IP of your boot server. The specified kernel must have been built with NFS Root capability. The initrd must make sense, and not contain references to the disk on which it originally lived.
...so if you specify just root=/netboot/movieserver, dracut interprets it as nfs:dhcp-next-ip:/netboot/movieserver. I've also tried specifying the IP directly, it makes no difference.
How do I make sure the initrd makes sense? As I stated before the new NFS root *gets* mounted correctly AND is writable. (I can cd to /sysroot [which is the new to-be-chrooted root] from the emergency RDSHELL console once the boot fails)
Reading through the initramfs's init script, I see that it tries to launch some other "init scripts", and that the limit of them is 20. It periodically checks after each of the scripts is executed if the new root has been mounted. But where are the scripts that it tries to execute? I'm not that good in bash to find out my self.
I don't know what dracut is, but all you've shown in your example is straight PXE bootloader configuration, which is what I've responded to. I have succesfully booted a 126.96.36.199 kernel with A PXE bootloader as I described to you, so I'm pretty sure the argument format is okay. As long as the kernel understands the args, it should be okay.
I think you need to understand that even though the bootloader has attached to a NFS server, once the kernel has been launched, all of that NFS connection is lost; the kernel only knows that it has been born. It must be told to make a new connection and attach its root file system to the NFS share. Moreover, it must know how to get an IP, which can be assigned statically or from DHCP. You say it has been given a static IP, but I don't see that anywhere.
The initrd must be set up to use the new root filesystem. If it tries to do something that expects the hard disk installation to exist as root, then it cannot work. Without seeing it, it will be impossible for anyone to guess what yours does.
Thanks for your reply. Could you please tell me step by step how have you built your own initrd and maybe kernel? Just to clarify, dracut is something like "initrd maker" for fedora if I understand it correctly.
Example: default F12 installation to HDD did not even want to boot, when i copied vmlinuz and initrd directly to boot server. It complained something like:
"DRACUT: don't know how to handle root= argument"
So then I installed the "dracut-network" package and *updated* my kernel (well the whole system) using yum update -all. I copied the NEW vmlinuz and initramfs to bootserver once again and now it does not complain that it does not know how to handle the root= argument, but instead complains that "no root device was found".
Moreover the new root is mounted via NFS, at that point the client must have a IP, otherwise the NFS mount won't be possible.
I know this is an old post, but I ran across it searching for an answer to getting an F12 diskless client working. I've had some success, and it works, but I will need to do some tweaking to get it perfect. One of the keys to getting dracut to build a proper initramfs for an nfs root is the dracut-network package. You need to install this package before generating your initramfs.
I found this out by locating an old bug report in bugzilla. As a result of the bug report it is now in the FedoraProject Dracut Wiki. Specifically you'll find it in section 2.11 NFS on the Dracut/Options page. Let me know if you are still interested or need additional help getting your client running.
Hello, thank you very much for your reply. I have now compiled a fresh kernel from kernel.org with kernel options NFS root and kernel level IP autoconfiguration, and without any initramfs (there was an option to turn it off). I have also compiled many functions to be built-in, not modules. Actually, I would need some help in the form "what to copy where and what to boot", as I have no general experience with the kernel directory tree. I have compiled the kernel and the modules into the same folder, using -O=folder option for .c/configure and make*. If it would be helpful, I can post my kernel config and the resulting directory structure. /kernel/arch/x86/boot/compressed/vmlinux seems like a good candidate to boot, but I do not know where to copy all the (MUCH) files that accompany it. If I look at my normal /boot folder, well there's just one initramfs-xxx.img file and nothing else, that's why I am confused. Any info on this is appreciated, maybe the diskless client will work with this kernel
I'm still researching what Fedora has transitioned to or recommends for a diskless environment. As I said, my setup works, but it needs some tweaking. In the past I used the package system-config-netboot on the server to setup the client/server environment. It has a help file listing the necessary steps (be sure to check this out). Unfortunately this package has not been kept current and no longer works as it should. It probably doesn't help that my server is running F11 and my client is F12. Upgrading the server is on my to do list.
It wasn't necessary for me to compile my own kernel. I used the delivered kernel and generated an initramfs using dracut. First step was to perform a standard install of f12 on a temporary hard drive on the client machine. Follow up by installing dracut-network. Another package needed for system-config-netboot to work later on is busybox-anaconda. busybox-anaconda does not exist in f12 so I simply downloaded and installed the f11 version. I also disabled selinux (more on that later).
After all that I had a client that I could rsync to the server. Once the root was established on the server I used system-config-netboot to make some configuration changes (see help). There are scripts that run to change fstab, copy the kernel to the tftpboot area, generate the initrd, and make an entry for the client in pxelinux.cfg. Two things didn't work right in the last few steps, initrd should be an initramfs and the config file in pxelinux.cfg needed adjusting. I corrected these problems manually.
chroot to /diskless/f12/root (or wherever you put the client root) and cd to /boot.
dracut dracut.img 188.8.131.52-99.fc12.i686.PAE (dracut.img is your initramfs, 2.6.32... is the kernel version)
correct entries in pxelinux.cfg (see sample config file below)
name of config file is C000025B
menu title Choose Your Diskless Environment
menu label F^edora 12
append initrd=Fedora12/dracut.img rw root=nfs:192.0.2.91:/diskless/f12/root rdshell rdinitdebug
I had to disable selinux in order to login to GNOME. When selinux was enabled, gdm would come up with login names, but after login selinux would prevent you from getting any further. Another thing you'll want to do is turn off NetworkManager with chkconfig. It causes problems on shutdown and isn't needed since the kernel takes care of the network connection early on.
I've had the same problems, so hopefully your short run down will work when I get a chance...
The only thing - for future people and maybe yourself, aparently the filename as you stated "C000025B" is actually the DECIMAL equivelent of the HEX mac address of the card that will be booting that particular config...
The config file C000025B, is generated by system-config-netboot and it is the hexadecimal equivalent of the IP address 192.0.2.91. When pxelinux boots it starts looking for a configuration file first by MAC Address. If that isn't there it looks for the hexadecimal equivalent of the IP address, 8 digits, then 7 digits, and so on down to 1 digit, followed by the "default" file.
As I mentioned, this method isn't perfect, but it is a start.
Hello wmakowski thank you very much for your reply, I have just built a new initramfs using dracut in the chrooted enviroment - seems it's the only step that's been missing! I have already copied the whole client root from the temporary hard drive [however using cp not rsync] and have the boot server [dhcp, tftp, nfs] set-up, so tomorrow I'll try booting with the new dracut initramfs. Seems promising! Thanks and keep up the good work! Will let you know how it runs once I get to it
Guys, it works Finally! In the end, when I installed dracut-network on the tmp-hdd, yum updated the kernel which generated a new initramfs which was capable of booting via NFS. I then rsync'd the entire root partition via NFS to boot server. It now works like a charm. Thank you wmakowski for help!
Excellent, glad to hear things worked out. Finding info on the dracut-network package was definitely the key to getting a usable initramfs. I haven't had a chance to make any other adjustments or discoveries in the diskless world yet. I just finished upgrading my server in anticipation of F11 reaching end of life and F13 being released. I would like to dive into the system-config-netboot package and get it sorted out. All I need is to find the time.