LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-22-2010, 12:29 PM   #1
kbs1
LQ Newbie
 
Registered: Feb 2010
Posts: 6

Rep: Reputation: 1
Lightbulb 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):

DEFAULT menu
PROMPT 0
MENU TITLE NETWORK BOOT SERVER
TIMEOUT 200
ONTIMEOUT f

LABEL f
kernel /images/F12-x86_64/vmlinuz
MENU LABEL Fedora 12 x86_64
APPEND root=/netboot/movieserver/ initrd=/images/F12-x86_64/initramfs.img rdshell

LABEL local
MENU LABEL Boot z lokalneho disku
MENU DEFAULT
LOCALBOOT 0

MENU end

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.

Thanks!
 
Old 02-23-2010, 09:56 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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:
Code:
LABEL f
    MENU LABEL Fedora 12 x86_64
    KERNEL /images/F12-x86_64/vmlinuz
    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.
--- rod.
 
Old 02-23-2010, 06:20 PM   #3
kbs1
LQ Newbie
 
Registered: Feb 2010
Posts: 6

Original Poster
Rep: Reputation: 1
Post

I've tried that, AFAIK the "root=/dev/nfs nfsroot=xxx" syntax is outdated, or for an older kernel. Current dracut options are listed here: http://fedoraproject.org/wiki/Dracut/Options#NFS

...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.
 
Old 02-23-2010, 11:29 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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 2.6.29.3 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.
--- rod.
 
Old 02-24-2010, 02:41 AM   #5
kbs1
LQ Newbie
 
Registered: Feb 2010
Posts: 6

Original Poster
Rep: Reputation: 1
Smile

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.

My bootserver's DHCP config below:

subnet 192.168.0.0 netmask 255.255.255.0 {
#range 192.168.0.150 192.168.0.160;
option routers 192.168.0.1;
filename "pxelinux.0";
next-server 192.168.0.112;

host movieserver {
hardware ethernet 00:22:15:21:63:23;
fixed-address 192.168.0.114;
option root-path "/netboot/movieserver/";
}
}


.112 is my bootserver, and .114 is the diskless client.

If you like I can post my initrd somewhere, would that be helpful?

Thanks

Last edited by kbs1; 02-24-2010 at 02:44 AM.
 
Old 04-30-2010, 11:07 PM   #6
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
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.

-----
Bill
 
Old 05-02-2010, 05:10 AM   #7
kbs1
LQ Newbie
 
Registered: Feb 2010
Posts: 6

Original Poster
Rep: Reputation: 1
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

Thanks
 
Old 05-03-2010, 02:16 PM   #8
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
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.
  1. chroot to /diskless/f12/root (or wherever you put the client root) and cd to /boot.
  2. dracut dracut.img 2.6.32.11-99.fc12.i686.PAE (dracut.img is your initramfs, 2.6.32... is the kernel version)
  3. cp dracut.img /tftpboot/linux-install/Fedora12
  4. cp vmlinuz-2.6.32.11-99.fc12.i686.PAE /tftpboot/linux-install/Fedora12/vmlinuz
  5. correct entries in pxelinux.cfg (see sample config file below)

name of config file is C000025B

Code:
default Fedora12
prompt 0
menu title Choose Your Diskless Environment

timeout 100
f1 msgs/help.txt
f2 msgs/options.txt

label Fedora12
  menu label F^edora 12
  kernel Fedora12/vmlinuz
  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.
 
1 members found this post helpful.
Old 05-05-2010, 03:54 AM   #9
gitch
LQ Newbie
 
Registered: May 2010
Posts: 1

Rep: Reputation: 0
Thanks wmakowski!!

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...

Correct me if I am wrong

Cheers
Gitch
 
Old 05-08-2010, 12:06 AM   #10
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
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.
 
1 members found this post helpful.
Old 05-11-2010, 07:07 PM   #11
kbs1
LQ Newbie
 
Registered: Feb 2010
Posts: 6

Original Poster
Rep: Reputation: 1
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
 
Old 05-12-2010, 02:23 PM   #12
kbs1
LQ Newbie
 
Registered: Feb 2010
Posts: 6

Original Poster
Rep: Reputation: 1
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!
 
1 members found this post helpful.
Old 05-15-2010, 08:35 AM   #13
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
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.
 
1 members found this post helpful.
  


Reply

Tags
boot, diskless, fedora, linux, network, pxe, pxelinux



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help please! Installing Slackware 12.2 by PXE boot fails! beyond291 Slackware 4 01-15-2009 08:21 AM
Can a PXE based diskless workstation config work for different desktops? lumix Linux - Networking 3 07-03-2008 03:48 PM
how to setup thin client just for telnet or ssh client use using boot diskless PXE. hocheetiong Linux - Newbie 3 05-21-2008 07:02 PM
nfslock hangs on boot with diskless workstation wmakowski Fedora 5 02-14-2008 05:02 PM
Howto: Diskless client Linux-machine with extra old AMD <300Mhz, without PXE&USB boot frenchn00b Linux - General 1 11-13-2007 04:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration