Booting linux from network

Booting linux from network

This is a very old way to operate but it used to be the only one available for a long time. Usually you won’t need to boot from network, except in some very specific cases ( e.g. unsupported I/O devices). That’s why it is detailed here.

All ‘recent’ machines can boot using bootp , starting from 715/100, 715/120, and 712s. Older ones, mostly early 715s, 710s and 725s need rboot .

To use BOOTP you have to enable the ‘ IP: Kernel level autoconfiguration -> IP: BOOTP support ‘ within the ‘ Networking options ‘ section of the kernel configuration, if you want to use a home-made kernel. See Chapter 6 for details.

If you have an old machine that requires rboot to boot over network, use the following procedure to set up, configure, and boot using the PA-RISC/Linux kernel.

Old machines, including the Scorpio 715s, require rbootd . You can obtain the rboot daemon═:

For all distributions but Debian, by getting our archive at http://pateam.esiee.fr/download.html#deb

bash# apt-get install rbootd

For instance, to boot a PA-RISC 715 system, you need a Linux system with rbootd installed (this is the ‘boot server’) on which you will store the PA-RISC/Linux kernel lifimage that you want to use to boot your PA-RISC system with.

Once the rbootd server software is installed, do as follows to configure it to work with your PA-RISC system═:

In /etc/rbootd.conf you will have to add a line like═:

Replace bootfile with the name of your PA-RISC/Linux kernel image, usually ‘ lifimage ‘.

Now get the ethernet address of your PA-RISC system by typing lanaddress at the ‘ BOOT_ADMIN> ‘ prompt (see Section 3.1.2.3 ).

It will return a number like 080009-7004b6 . Take note of this number.

In /etc/rbootd.conf on your boot server, the ethernet address has to be colon-delimited. That means you will have to modify the number you just obtained so that every set of two characters (after removing the ‘-‘) is separated by a colon. For example═:

Add the colon delimited ethernet address to /etc/rbootd.conf on your boot server. The resulting file will look something like this═:

# ethernet addr boot file comments 08:00:09:87:e4:8f lifimage_715 # PA/Linux kernel for 715/33 08:00:09:70:04:b6 lifimage_720 # PA/Linux kernel for 720

This rbootd.conf example contains the ethernet addresses and boot file names for two different machines.

Once you have changed the configuration file, restart rbootd .

By default, rbootd assumes that bootfiles are located in /var/lib/rbootd/ . If you use our archive for other distributions, this directory is /export/hp/rbootd/ . Therefore, you will have to put your bootable kernel image in that directory, or, if you really hate that directory for some reason, you can recompile rbootd to use a different directory.

The easiest thing, of course, is just to drop your kernel images in the default directory═!

We will see here how to use a DHCP server as a BOOTP one.

Debian users will just have to install the packages via these commands as root ═:

bash# apt-get install dhcp bash# apt-get install tftpd

The dhcp package can do far more than a simple bootp daemon. Nevertheless, it is also known to be far easier to configure. If you really want to try bootp , skip this and go to Section 5.3.5 .

Here are the instructions to set up dhcp on your boot server. To keep this explanation simple, we will assume that you want to assign a fixed IP to your box, without DNS update. Your subnet will be 192.168.1.0/24 , with optional═: gateway at 192.168.1.1 , domain name foo.com and DNS at 192.168.1.4 .

This section is dedicated to Debian users. For others distributions, it should be similar though there can be some differences like default directories. Since Debian maintains a dhcp package, we will focus on it only.

Edit /etc/inetd.conf on your boot server to add the following line, if it doesn’t already exist═:

tftp dgram udp wait nobody /usr/sbin/tcpd \ /usr/sbin/in.tftpd /tftpboot

Here, /tftpboot/ is being used as tftpd server’s root. You can choose another directory if you want. According to man tftpd , this is the usual default directory.

When this is done, restart inetd with═: /etc/init.d/inetd restart . You can also issue a killall -HUP inetd .

According to man 5 dhcpd.conf , edit the /etc/dhcpd.conf file to contain something like═:

allow bootp; default-lease-time 600; max-lease-time 7200; # This will tell the box its hostname while booting: use-host-decl-names on; subnet 192.168.1.0 netmask 255.255.255.0 < option routers 192.168.1.1; option domain-name "foo.com"; option domain-name-server 192.168.1.4; >host [hostname]

You have to fill in the [hostname] , [mac address] , [ip address] , [boot filename] and [root path] fields with the appropriate information, where═:

[hostname] is the name of the PA-RISC system.

[mac address] is the colon-delimited ethernet address of the PA-RISC system, which can be obtained by typing lanaddress at the ‘ BOOT_ADMIN> ‘ prompt (see Section 3.1.2.3 ).

[ip address] is the IP address you wish to assign to the PA-RISC system.

[boot filename] is the name of the bootable kernel image you want to boot your system with.

[root path] is the path to the NFS root filesystem exported by the server.

You’ll end up with something like this for each box you want to netboot ═:

For Debian users, you just have to install the packages via these commands as root ═:

bash# apt-get install bootp tfptd

If you need rpm packages, the best way is to go to http://rpmfind.net/ . It seems that Red Hat users need to create the user «nobody» belonging to the group «nogroup». The files present in your /tftpboot/ directory (see below) should have these user/group privileges.

You’ll have been warned═! This daemon is far more obfuscated in its configuration.

Follow these instructions to use bootp on your boot server═:

This section is dedicated to Debian users. For others distributions, it should be similar though there can be some differences like default directories. Since Debian maintains a bootp package, we will focus on it only.

Edit /etc/inetd.conf on your boot server to add the following lines, if they don’t already exist═:

tftp dgram udp wait nobody /usr/sbin/tcpd \ /usr/sbin/in.tftpd /tftpboot bootps dgram udp wait root /usr/sbin/bootpd \ bootpd -i -t 120

Here, /tftpboot/ is being used as tftpd server’s root. You can choose another directory if you want. According to man tftpd , this is the usual default directory.

When this is done, restart inetd with═: /etc/init.d/inetd restart . You can also issue a killall -HUP inetd .

According to man 5 bootptab , edit the /etc/bootptab file to contain═:

[hostname] :hd=/tftpboot:\ :rp= [root path] :\ :ht=ethernet:\ :ha= [mac address] :\ :ip= [ip address] :\ :bf= [boot filename] :\ :sm=255.255.255.0:\ :to=7200:

You have to fill in the [hostname] , [mac address] , [ip address] and [root path] fields with the appropriate information, where═:

[hostname] is the name of the PA-RISC system.

[mac address] is the NOT-delimited ethernet address of the PA-RISC system, which can be obtained by typing lanaddress at the ‘ BOOT_ADMIN> ‘ prompt (see Section 3.1.2.3 ).

[ip address] is the IP address you wish to assign to the PA-RISC system.

[boot filename] is the name of the bootable kernel image you want to boot your system with.

[root path] is the path to the NFS root filesystem exported by the server.

You’ll end up with something like this═:

vodka:hd=/tftpboot:\ :rp=/usr/src/parisc/:\ :ht=ethernet:\ :ha=080069088717:\ :ip=140.244.9.208:\ :bf=lifimage:\ :sm=255.255.255.0:\ :to=7200:

To conclude with the developers’ way to boot the kernel, this section will tell you how to actually boot your system from a network server. But it tends to be less and less used. Most users will prefer to stick to Section 5.2 .

Here we are. These are just some tips to get the boot for those who tried the network way. We assume that you’ve done everything outlined above, your development PC is hooked up to your PA-RISC machine via a serial line, you’ve got a bootable PA/Linux kernel lifimage on your boot server, and you’re willing to give it a try. If everything is ready, as well as you, the following procedure will introduce you to the joy of network booting your PA box into Linux.

Make sure your development box is properly connected to your PA-RISC machine with a serial cable. Sounds obvious, but check anyway.

Start minicom on your development box.

Fire up your PA-RISC system.

Watch your minicom console. When the following message appears during the PA-RISC machine’s boot process, press and hold the Esc key═:

Searching for Potential Boot Devices. To terminate search, press and hold the ESCAPE key.

If needed, select ‘ a) Enter Boot Administration mode ‘ from the menu. This brings up the ‘ BOOT_ADMIN> ‘ prompt.

Type the following at the prompt═: boot lan .

Watch your PA-RISC system magically becoming a PA/Linux system. Ta dah═!

Of course your are supposed to run only one boot server at a time on your network, in order to avoid conflicts.

Источник

PXE Boot from network (DHCP, TFTP, NFS, Samba, FTP, HTTP) — Linux server

The network boot will be explained with working example setups. When you understood the concept, then you can use your own server setups and directory structures. Everything is flexible and can be configured to be anywhere on your server.

The minimum requirements to boot from a network are a DHCP server and a TFTP server.

The access to the Plop Linux files can be via NFS share, Samba share, TFTP, FTP or HTTP.

Download a working sample with the full directory structure: netboot-sample.tar.gz, for ISO netboot-sample-iso.tar.gz

The download links in this description are for the 64-bit version. To create a 32-bit version use the corresponding files from the download area.

Basic conditions for this example setup:

  • Network type: 10.0.0.x Netmask 255.255.255.0
  • Server IP: 10.0.0.1
  • Client IP: will be 10.0.0.250 from DHCP with MAC address
  • TFTP root directory: /tftpboot

It works with other IP addresses too!

Here are config files for a Linux test system in an archive: pxeconfs.tar.gz

1. Setup
1.1. Extract the Plop Linux files
1.2. Setup the DHCP server
1.3. Setup the TFTP server
2. NFS
2.1. Boot with NFS
2.2. Boot ISO over NFS
3. Samba network share
3.1. Boot with Samba network share
3.2. Boot ISO over Samba network share
4. TFTP
4.1. Boot only with TFTP
4.2. Boot ISO over TFTP
5. FTP
5.1. Boot with FTP
5.2. Boot ISO over FTP
6. HTTP
6.1. Boot with HTTP
6.2. Boot ISO over HTTP
7. Boot problems

1. Setup

1.1. Extract the Plop Linux files

Extract the file ploplinux-pxeboot.tar.gz to your root directory.

tar xfz ploplinux-pxeboot.tar.gz -C /

Now you have the basic directory structure and files in ‘ /tftpboot ‘.

tar xfz ploplinux-21.3.tgz -C /tmp

Move the files to ‘ /tftpboot/ploplinux-netboot/ ‘.

mv /tmp/ploplinux-21.3/* /tftpboot/ploplinux-netboot/

Now you should have the following directories and files

1.2. Setup the DHCP server

You need the DHCP server software. If your distribution has none then you can use dhcp-4.4.2.tar.gz (or search for the latest on the net) and compile it.

This is the example DHCP server configuration.
The very important line is ‘ filename «/ploplinux-netboot/pxelinux.0»; ‘.

To start the DHCP server simply run ‘ dhcpd ‘.

Note: For testing you can run ‘ dhcpd -f ‘ to run dhcpd in the foreground and get some debug output.

Note: Change the ‘ next-server ‘ IP to set another TFTP server IP.

1.3. Setup the TFTP server

Download the latest TFTP server from ftp://www.kernel.org/pub/software/network/tftp/ and install it with ‘ ./configure —prefix=/usr && make && make install ‘.

To start the TFTP server we use Xinetd.

Here is the base Xinetd config file

And the configuration for the tftp server.
The important line is ‘ server_args = -s /tftpboot ‘ for the tftp root directory.

To start Xinetd simply run ‘ xinetd ‘.

Note: For testing you can run ‘ xinetd -d ‘ to run Xinetd in the foreground and get some debug output.

2. NFS

2.1. Boot with NFS

Requirements are the DHCP and TFTP Server (Setup).

Basic configs for your NFS server, without security aspects:

Example: nfsmount=10.0.0.1:/tftpboot/ploplinux-netboot
Example: nfsmount=10.0.0.1:/tftpboot/ploplinux-netboot|rsize=2048,wsize=2048,nolock,vers=2,hard,intr

If the DHCP, Xinetd and NFS server are running correct you should be able to boot Plop Linux via network.

2.2. Boot ISO over NFS

You need the ISO ploplinux-21.3-x86_64.iso, the directory structure and files of ploplinux-pxeboot.tar.gz and the ‘ syslinux ‘ directory of ploplinux-21.3-x86_64.tar.gz. The DHCP and TFTP Server must work.

Basic configs for your NFS server, without security aspects:

Create a symlink ‘ ln -s ploplinux-21.3-x86_64.iso ploplinux.iso ‘.

Parameter: nfsmount=NFSSHARE|ADDITIONALPARAMS iso_filename=ISOFILE

On the server: /tftpboot/ploplinux-netboot/ploplinux.iso
Example: nfsmount=10.0.0.1:/tftpboot/ploplinux-netboot iso_filename=ploplinux.iso
Example: nfsmount=10.0.0.1:/tftpboot/ploplinux-netboot|rsize=2048,wsize=2048,nolock,vers=2,hard,intr iso_filename=ploplinux.iso

nfs-iso.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the ‘ # ‘ in the line with ‘ #include pxelinux.cfg/nfs-iso.conf ‘ to enable the loading of nfs-iso.conf .

3. Samba network share

3.1. Boot with Samba network share

Requirements are the DHCP and TFTP Server (Setup).

Basic configs for your Samba server, without security aspects:

Create the share ‘ ploplinux-netboot ‘.
File name: /etc/samba/smb.conf

SMBUSER : user to access the share. If the share permits access to all users then use «» for SMBUSER
SMBPASSWORD : password of the user to access the share. For an empty password use «»

Example: smbmount=//10.0.0.1/ploplinux-netboot:myuser:mypass
Example: smbmount=//10.0.0.1/ploplinux-netboot:myuser2:»»

smb.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the ‘ # ‘ in the line with ‘ #include pxelinux.cfg/smb.conf ‘ to enable the loading of smb.conf .

When the DHCP, Xinetd and Samba server are running correct you should be able to boot Plop Linux via network.

3.2. Boot ISO over Samba

You need the ISO ploplinux-21.3-x86_64.iso, the directory structure and files of ploplinux-pxeboot.tar.gz and the ‘ syslinux ‘ directory of ploplinux-21.3-x86_64.tar.gz. The DHCP and TFTP Server must work.

Basic configs for your Samba server, without security aspects:

Create the share ‘ ploplinux-netboot ‘.
File name: /etc/samba/smb.conf

Create there a symlink ‘ ln -s ploplinux-21.3-x86_64.iso ploplinux.iso ‘.

Parameter: smbmount=//SERVER/SHARE:SMBUSER:SMBPASSWORD iso_filename=ISOFILE

SMBUSER : user to access the share. If the share permits access to all users then use «» for SMBUSER
SMBPASSWORD : password of the user to access the share. For an empty password use «»
ISOFILE : ploplinux.iso (relative to the share)
On the server: /tftpboot/ploplinux-netboot/ploplinux.iso

Example: smbmount=//10.0.0.1/ploplinux-netboot:myuser:mypass iso_filename=ploplinux.iso
Example: smbmount=//10.0.0.1/ploplinux-netboot:myuser2:»» iso_filename=ploplinux.iso

smb-iso.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the ‘ # ‘ in the line with ‘ #include pxelinux.cfg/smb-iso.conf ‘ to enable the loading of smb-iso.conf .

4. TFTP

4.1. Boot only with TFTP

Requirements are the DHCP and TFTP Server (Setup).

Create the file ‘ /tftpboot/ploplinux-netboot/tftpfilelist ‘ for TFTP boot that lists all Plop Linux files.

cd /tftpboot
find ploplinux-netboot > ploplinux-netboot/tftpfilelist

Parameter: tftpboot=SERVER|FILELIST dir=PLOPLINUXDIRECTORY

Example: tftpboot=10.0.0.1|ploplinux-netboot/tftpfilelist dir=/ploplinux-netboot/ploplinux

tftp.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the ‘ # ‘ in the line with ‘ #include pxelinux.cfg/tftp.conf ‘ to enable the loading of tftp.conf .

4.2. Boot ISO over TFTP

You need the ISO ploplinux-21.3-x86_64.iso, the directory structure and files of ploplinux-pxeboot.tar.gz and the ‘ syslinux ‘ directory of ploplinux-21.3-x86_64.tar.gz. The DHCP and TFTP Server must work.

Create the file ‘ /tftpboot/ploplinux-netboot/tftpfilelist-iso ‘ for TFTP boot with the Plop Linux ISO file name.

cd /tftpboot/ploplinux-netboot
echo ploplinux-netboot/ploplinux.iso > tftpfilelist-iso

Create a symlink ‘ ln -s ploplinux-21.3-x86_64.iso ploplinux.iso ‘.

Parameter: tftpboot=SERVER|FILELIST iso_filename=ISOFILE

Example: tftpboot=10.0.0.1|ploplinux-netboot/tftpfilelist-iso iso_filename=ploplinux-netboot/ploplinux.iso

tftp-iso.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the ‘ # ‘ in the line with ‘ #include pxelinux.cfg/tftp-iso.conf ‘ to enable the loading of tftp-iso.conf .

5. FTP

5.1. Boot with FTP

Requirements are the DHCP and TFTP Server (Setup) and a FTP Server.

The FTP root directory is in this example ‘ /tftpboot/ ‘.

Create the file ‘ /tftpboot/ploplinux-netboot/filelist ‘ for FTP boot that lists all Plop Linux files.

cd /tftpboot/ploplinux-netboot
find > ftpfilelist

ftp.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the ‘ # ‘ in the line with ‘ #include pxelinux.cfg/ftp.conf ‘ to enable the loading of ftp.conf .

5.2. Boot ISO over FTP

You need the ISO ploplinux-21.3-x86_64.iso, the directory structure and files of ploplinux-pxeboot.tar.gz and the ‘ syslinux ‘ directory of ploplinux-21.3-x86_64.tar.gz. The DHCP and TFTP Server must work. A FTP Server must be available.

The FTP root directory is in this example ‘ /tftpboot/ ‘.

Create the file ‘ /tftpboot/ploplinux-netboot/ftpfilelist-iso ‘ for FTP boot with the Plop Linux ISO file name.

cd /tftpboot/ploplinux-netboot
echo ploplinux.iso > ftpfilelist-iso

Create a symlink ‘ ln -s ploplinux-21.3-x86_64.iso ploplinux.iso ‘.

Parameter: url=ftp://FTPUSER:FTPPASSWORD@FTPSERVER/FTPDIRECTORY|FILELIST iso_filename=ISOFILE

Example: url=ftp://myuser:mypass@10.0.0.1/ploplinux-netboot|/ftpfilelist-iso iso_filename=ploplinux.iso

ftp-iso.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the ‘ # ‘ in the line with ‘ #include pxelinux.cfg/ftp-iso.conf ‘ to enable the loading of ftp-iso.conf .

6. HTTP

6.1. Boot with HTTP

Requirements are the DHCP and TFTP Server (Setup) and a WEB Server.

The Virtual Host root directory is in this example ‘ /tftpboot/ ‘.

Create the file ‘ /tftpboot/ploplinux-netboot/filelist ‘ for HTTP boot that lists all Plop Linux files.

cd /tftpboot/ploplinux-netboot
find > webfilelist

Example: url=http://www.ploplinux.com/ploplinux-netboot|/webfilelist
Example: url=http://myuser:mypass@www.ploplinux.com/ploplinux-netboot|/webfilelist

http.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the ‘ # ‘ in the line with ‘ #include pxelinux.cfg/http.conf ‘ to enable the loading of http.conf .

6.2. Boot ISO over HTTP

You need the ISO ploplinux-21.3-x86_64.iso, the directory structure and files of ploplinux-pxeboot.tar.gz and the ‘ syslinux ‘ directory of ploplinux-21.3-x86_64.tar.gz. The DHCP and TFTP Server must work. A WEB Server must be available.

The Virtual Host root directory is in this example ‘ /tftpboot/ ‘.

Create the file ‘ /tftpboot/ploplinux-netboot/webfilelist-iso ‘ for HTTP boot with the Plop Linux ISO file name.

cd /tftpboot/ploplinux-netboot
echo ploplinux.iso > webfilelist-iso

Create a symlink ‘ ln -s ploplinux-21.3-x86_64.iso ploplinux.iso ‘.

Parameter: url=http://USER:PASS@WEBSERVER/WEBDIRECTORY|FILELIST iso_filename=ISOFILE

Example: url=http://www.ploplinux.com/ploplinux-netboot|/webfilelist-iso iso_filename=ploplinux.iso
Example: url=http://myuser:mypass@www.ploplinux.com/ploplinux-netboot|/webfilelist-iso iso_filename=ploplinux.iso

http-iso.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the ‘ # ‘ in the line with ‘ #include pxelinux.cfg/http-iso.conf ‘ to enable the loading of http-iso.conf .

7. Boot problems

Maybe there is somewhere a wrong path. When you are in the boot menu, then press at the entry that you want to boot the tabulator key. Then add at the end of the line ‘ debug ‘. You will see more info’s during booting.

>
PXE Boot from network (DHCP, TFTP, Network share, FTP, HTTP) — Windows server

Источник

Читайте также:  Windows 10 удаляет файлы без подтверждения как отключить
Оцените статью