Return to BSD News archive
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yeshua.marcam.com!news.kei.com!sol.ctr.columbia.edu!meteor.ctr.columbia.edu!wpaul From: wpaul@ctr.columbia.edu (Bill Paul) Newsgroups: comp.os.386bsd.questions Subject: Re: diskless problem Date: 8 Nov 1994 04:16:15 GMT Organization: Columbia University Center for Telecommunications Research Lines: 111 Message-ID: <39mu2f$gfb@sol.ctr.columbia.edu> References: <39mcle$39m@gnu.mat.uc.pt> NNTP-Posting-Host: meteor.ctr.columbia.edu X-Newsreader: TIN [version 1.2 PL2] Daring to challenge the will of the almighty Leviam00se, Paulo Menezes (paulo@@dee.uc.pt) had the courage to say: : Hi, : I have some problems with the FreeBSD 1.5.1 diskless configuration: : first I had to modify the netboot code to making it able : to load the files cfg and 386bsd in the /tftpboot directory : after getting the kernel loaded it does not mount the (nfs) root : and aborts with the message "init died". : Can someone please tell me what am I doing wrong? : Note: I have configured the kernel for diskless and it is booting : from a FreeBSD 1.5.1 server. : Thanks : Paulo : -- : Paulo Menezes | EMail: paulo@dee.uc.pt : Instituto de Sistemas e Robotica | paulo@mercurio.uc.pt : Dept. de Engenharia Electrotecnica | : Largo Marques de Pombal | Phone: 351 39 34884 : 3000 COIMBRA | Fax: 351 39 35672 : Portugal | : \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ I've been doing quite a bit of playing around with diskless booting lately with great success. If you follow the netboot.doc file's instructions carefully, you shouldn't have any trouble. Here's some things to look out for: - You not only need to use 'options DISKLESS' when you build a kernel, you also need a line that says: config "386bsd" swap on nfs size (# of 512 byte blocks) For example, for a kernel that uses about 16 megs of swap, use: config "386bsd" swap on nfs size 30000 - You must make sure that the kernel is properly configured to use the ethernet card installed in the machine. If the driver is incorrectly configured, it will be unable to mount its root filesystem and it will panic. Remember: just because netboot can see you ethernet card, that doesn't automatically imply that your kernel will too. - You need to compile the diskless_cfg program on the machine being used as the NFS server. The source in in the usr.sbin.?? source archive. This program will create a configuration file called cfg.xxx.xxx.xxx.xxx which netboot.com loads and passes to the kernel at startup. This file contains file handles for the root filesystem and swap file to mount from the server, as well as the NFS read and write buffer sizes to use and the default router. All of these are specified to the diskless_cfg program as command line arguments. - You must make sure that the diskless client is allowed to mount its root filesystem from the NFS server. Check the /etc/exports file on the server. If the client doesn't have permission to mount the rootfs and the swap file, the diskless_cfg program will bomb when run, complaining that it can't get the required file handles. Note that you must also allow the client to access the rootfs as root, unless you're setting up a limited environment where it isn't necessary for the client to be allowed root access to the NFS server (an Xkernel setup is a good example). - You must have a properly configured bootp server running. The netboot.doc file has a sample /etc/bootptab entry for such a server. The bootp server will tell the client several things: its IP address, the address of its boot server, the gateway to use (if the boot server is on a different subnet), the directory in which to search for its kernel, and the name of the kernel to load. - Naturally, you also need a tftp server, but since you're able to load the kernel you obviously have one running. Note that you shouldn't have to modify the netboot code to tell it where to find the kernel. The bootptab entry is supposed to provide the kernel's location and name. - If the root fs is in fact successfully mounted, you must then make sure that the binaries installed on the root fs aren't corrupt. You need to make sure that your diskless rootfs is properly laid out: you need a proper /sbin/init plus enough support programs to support whatever environment is is that you're trying to put together. - You must make sure to properly create the /dev directory on the NFS server with the FreeBSD MAKEDEV script. This can actually be done quite easily even on non-FreeBSD servers. Go to the /dev directory of the exported FreeBSD root fs and type: ./MAKEDEV all In some cases the owner and group may not be set correctly but this glitch can be safely ignored for the time being. Once the FreeBSD client is booted you can run the MAKEDEV script again to set the ownerships properly. Following these guidelines I've been able to boot several diskless machines as X terminals (using a modified Xkernel setup) and as multi-user systems. (I have one multi-user system set up that I'm using for development.) The only modification I've made to the netboot.com program myself was to add support for 3Com 3c503 ethernet cards, which were the only ethernet adapters I had available to work with. You can get a copy of my modified version from my machine: skynet.ctr.columbia.edu:/pub/netboot/netboot.tar.gz -- -Bill Paul wpaul@ctr.columbia.edu