LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 05-15-2007, 06:50 AM   #1
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Rep: Reputation: 86
How to boot Slackware via PXE ?


I just succeeded in booting the new Alien BOB's wonderful pxe installer :
ftp://ftp.slackware.com/pub/slackwar...README_PXE.TXT

And now i want to boot a diskless using a nfs root. I installpkg -root /nfsroot all needed files (/a /l /n package series).

And this is where i'm stuck. I think i have to do a new initrd, and make some changes to /tftpboot/slack/pxelinux.cfg/default
I already did that :
default linux initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 nfsroot=192.168.223.1:/nfsroot rw

But when i boot i got a kernel panic unable to mount rootfs blahblah.
So is the new initrd the answer ?
Do i have to compile a more generic kernel on my main machine, in order to mkinitrd/transfer it on the diskless ?

Keep on slackin'

Last edited by Linux.tar.gz; 10-16-2008 at 04:25 PM.
 
Old 05-15-2007, 11:27 AM   #2
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
From kernel configurator, nfs section :

If you are configuring a diskless machine which will mount its root
file system over NFS at boot time, say Y here and to "Kernel
level IP autoconfiguration" above and to "Root file system on NFS"
below. You cannot compile this driver as a module in this case.
There are two packages designed for booting diskless machines over
the net: netboot, available from
<http://ftp1.sourceforge.net/netboot/>, and Etherboot,
available from <http://ftp1.sourceforge.net/etherboot/>.



I wonder if netboot and etherboot are mandatory as the pxe installer booted the kernel more than fine.

EDIT : --------------------
Rectified links :
http://netboot.sourceforge.net/
http://www.etherboot.org/wiki/index.php

Last edited by Linux.tar.gz; 05-15-2007 at 11:31 AM.
 
Old 05-15-2007, 03:11 PM   #3
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Should they be compiled into the kernel some way? If not, I don't believe that they are required, because can't think of how kernel executes them.
 
Old 05-16-2007, 04:23 AM   #4
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
Netboot and etherboot are "userspace" programs. And as the pxe installer works without them, maybe we can get rid of them.
 
Old 05-16-2007, 07:48 AM   #5
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,116

Rep: Reputation: Disabled
Quote:
Originally Posted by Linux.tar.gz
I just succeeded in booting the new Alien BOB's wonderful pxe installer :
http://slackware.mirrors.tds.net/pub...allers/pxe.txt

And now i want to boot a diskless using a nfs root. I installpkg -root /nfsroot all needed files (/a /l /n package series).

And this is where i'm stuck. I think i have to do a new initrd, and make some changes to /tftpboot/slack/pxelinux.cfg/default
I already did that :
default linux initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 nfsroot=192.168.223.1:/nfsroot rw

But when i boot i got a kernel panic unable to mount rootfs blahblah.
So is the new initrd the answer ?
Do i have to compile a more generic kernel on my main machine, in order to mkinitrd/transfer it on the diskless ?

Keep on slackin'
Nice of you to comment on the PXE installer. I always wonder who uses it.

To boot a diskless machine using a NFS filesystem, you will indeed have to rewrite the init script inside the initrd.img. This is not trivial but can be done.
An interesting Wiki article describing a way to use ZipSlack for a diskless client setup is available on Linux.Ars.
You'll find it covers the whole process of setting up the NFS server, the initrd and the linurc script (the actual script that does all the initialization inside the initrd).

Let me know if that Wiki article helped you - if so, I will try to adapt it for modern-day Slackware.

Cheers, Eric
 
Old 05-16-2007, 10:00 AM   #6
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
Well this article is by far the most complete i've read. I'm going to put it in practice next week.
I don't understand (yet) why we have to use ZipSlack (maybe the system is already complete, no need to installpkg -root).

For your nice installer, i used it only for learning purpose, and i learnt well as i succeeded launching the Slack setup program. I may be using it in the near future as it avoid me to put a CD/DVD in the machines ^_^.
In fact, i used to install many Slack by nfs as the process is faster than CD/DVD (especially if the server got a SATA disk, or better if the install set mounted in a ram filesystem).

And it's very important for people who own a laptop with broken CD/DVD player and no floppy.

When using diskless machines, the price is lowered by ~120€. No CD/DVD drive, no floppy, no hard drive.
And when (it's currently my case) you have 15+ diskless machines, no need to draw a picture...
So maybe indeed it will be good to howtorize a Slackware diskless procedure.

Keep in touch.
 
Old 05-16-2007, 11:29 AM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 10,894
Blog Entries: 1

Rep: Reputation: 1308Reputation: 1308Reputation: 1308Reputation: 1308Reputation: 1308Reputation: 1308Reputation: 1308Reputation: 1308Reputation: 1308Reputation: 1308
Quote:
Originally Posted by Alien Bob
Nice of you to comment on the PXE installer. I always wonder who uses it.

To boot a diskless machine using a NFS filesystem, you will indeed have to rewrite the init script inside the initrd.img. This is not trivial but can be done.
An interesting Wiki article describing a way to use ZipSlack for a diskless client setup is available on Linux.Ars.
You'll find it covers the whole process of setting up the NFS server, the initrd and the linurc script (the actual script that does all the initialization inside the initrd).

Let me know if that Wiki article helped you - if so, I will try to adapt it for modern-day Slackware.

Cheers, Eric
Hi,

Eric, I just went to the referenced wiki and read it. To adapt the technique to modern Slackware would be a great tool.
 
Old 05-21-2007, 03:56 AM   #8
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
Back on it.
First, it seems that zipslack is now larger than 100M.
I had to enlarge the .img to 200M.
And now i can't mount umsdos. I have a custom kernel, and i don't see where to enable it in menuconfig.

So i rebooted to 2.4.33.3.
I completed the phase 1. Here's the ###beta### script, and don't forget to edit it :

#!/bin/sh
dd if=/dev/zero of=zipslack.img count=1 bs=200M
/sbin/mkdosfs -F 16 zipslack.img
su
mkdir -p /mnt/zipslack /var/clients/default
mount -t msdos -o loop zipslack.img /mnt/zipslack
cd /mnt/zipslack
##### Change to your username
unzip -qq /home/user/zipslack.zip
cd
umount /mnt/zipslack
##### Change to your username
mount -t umsdos -o loop /home/user/zipslack.img /mnt/zipslack
cd /mnt/zipslack
find . -xdev -print0 | cpio -pa0Vdmu --sparse /var/clients/default
cd
umount /mnt/zipslack
rmdir /mnt/zipslack

Last edited by Linux.tar.gz; 05-22-2007 at 07:26 AM.
 
Old 05-21-2007, 05:15 AM   #9
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
Phase 2 : I had to enlarge initrd to 40M and move all files in /var/clients/default/linux to /var/clients/default/

####this script is beta too####
#!/bin/sh
dd if=/dev/zero of=initrd count=1 bs=40M
su
mke2fs initrd
tune2fs -c0 -i0 initrd
#####Some people like i have already that :
mkdir -p /mnt/loop
mount -o loop -t ext2 initrd /mnt/loop
cd /var/clients/default

for pkg in aaa_base etc glibc-solibs bin coreutils util-linux \
sed gawk grep bash elflibs tcpip; do grep -A10000 \
'^FILE LIST:$' var/log/packages/${pkg}* | sed \
's/\/incoming\//\//' | grep -v '^FILE LIST:$' | sed \
's/\.new$//' | grep -v '^install\/' | cpio -paVdmu --sparse /mnt/loop; done

cp bin/bash /mnt/loop/bin
mkdir mnt/initrd
cd /mnt/loop
ln bin/bash bin/sh
ldconfig -r .
mkdir mnt/nfsroot

#####complete with adding linuxrc and chmod it. Umount loop and compress initrd.

Last edited by Linux.tar.gz; 05-24-2007 at 05:13 AM.
 
Old 05-21-2007, 09:24 AM   #10
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
I succeeded in booting the unzipped initrd, but :

RAMDISK: image too big! (40960/7777 blocks)
Freeing initrd memory: 40960k freed
....
....
Kernel panic blah blah


So i booted with the zipped initrd :

VFS: Mounted root (ext2 filesystem)
attempt to access beyond end of device
01:00: rw=0, want=16388, limit=7777
EXT2-fs error (device ramdisk(1,0)): ext2_read_inode: unable to read inode block - inode=4097, block=16387
....
....
Kernel panic blah blah

Last edited by Linux.tar.gz; 05-21-2007 at 10:16 AM.
 
Old 05-22-2007, 06:41 AM   #11
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
Now i used this option in pxeconfig.cfg/default : ramdisk_size=40960 and i can go further with compressed initrd.gz and uncompressed initrd.img.

But i'm blocked at the root filesystem mount. If i specify root=192.168.223.1:/var/clients/default/linux/

then i have :

VFS: Cannot open root device "192.168.223.1:/var/clients/default/linux/" or 00:00
Please append a correct "root=" boot option
Kernel panic...

and if i specify
nfsroot=192.168.223.1:/var/clients/default/linux/
i have :

kmod: failed to exec /sbin/modprobe -s -k block-major-3, errno = 2
VFS: Cannot open root device "" or 03:07
Please append a correct "root=" boot option
Kernel panic...

Last edited by Linux.tar.gz; 05-22-2007 at 06:43 AM.
 
Old 05-22-2007, 07:39 AM   #12
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
As said before I corrected some /var/clients stuff as zipslack is contained in a "linux" folder. So i had to put root system in /var/clients/default and change some stuff eveywhere else.

Now i have this error message, using root=/dev/ram0 :

Warning: unable to open an initial console

So, according to some info i googled around i did this in the loopbacked initrd, inside dev directory :
mknod console c 5 1

And the next error message is :

/bin/sh: error while loading shared libraries: libtermcap.so.2: cannot open shared object file: No such file or directory

I begin to be confused and i wonder if the howto really works. If someone can help, i'll say "yes".

Last edited by Linux.tar.gz; 05-24-2007 at 05:15 AM.
 
Old 05-22-2007, 10:33 AM   #13
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
I now installpkg -root /mnt/loop libtermcap-1.2.3-i486-6.tgz and generated another initrd.

And the system goes further with more error messages about missing /proc/dev/net and many missing commands in linuxrc. I came to the conclusion that the script generating the initrd from zipslack is bloated.

1st question :
Which technique is better: the script extracting from zipslack, or a installpkg -root ?

2nd question :
Is it possible and viable :
Install a minimal system on the diskless (with a disk just for this moment) and making the initrd on it.
 
Old 05-22-2007, 11:18 AM   #14
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
In the linuxrc script:
Changed CHROOT=/usr/bin/chroot to CHROOT=/bin/chroot
Put the MAC address grepping stuff on the same line as commented.

Because i saw a message complaining about libblkid.so.1
installpkg -root /mnt/loop e2fsprogs-1.39-i486-1.tgz

Less error messages now.
And no idea about missing /proc/dev/net

I installed module-init-tool because modprobe was missing in the initrd. That corrected the error message from missing /proc/dev/net to missing /proc/net/dev.

There's a nfsroot.txt in the document folder in the kernel sources.

I had to recompile kernel to enable the network card driver INSIDE the kernel.
I also enabled, in the networking options section, IP kernel level autoconfiguration for dhcp and bootp.
And also the root filesystem on nfs option.

Plus added this to /etc/dhcpd.conf :
option root-path "/var/clients/default";

Last edited by Linux.tar.gz; 05-23-2007 at 10:56 AM.
 
Old 05-23-2007, 10:30 AM   #15
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
And...

IT WORKS !!!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pxe boot "PXE-T01 file not found" ssharma_02 Linux - Networking 16 05-18-2011 03:21 PM
PXE boot a Live CD zael Linux - Networking 1 11-26-2008 07:23 AM
Unable to boot with PXE managed.service Linux - Enterprise 1 10-18-2005 11:28 AM
PXE no client boot ACID25 Linux - Networking 0 05-31-2005 05:36 AM
SuSE 9.1 PXE boot greentara Linux - Distributions 1 06-09-2004 02:16 AM


All times are GMT -5. The time now is 10:24 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration