What is diskless booting?

Diskless booting is using a remote system or systems to store the kernel and the filesystem that will be used on other computers.

What’s goodness ?

When you setup your own site servers, what’s needed ?

  1. DNS server(s).
  2. mail server(s).
  3. http server(s).
  4. storage system (nas).
  5. Development Workstations.

How many disk drive do you need ?

The answer is “Only One Drive” for minimum.

Setup Server

# apt install isc-dhcp-server tftpd-hpa syslinux pxelinux nfs-kernel-server initramfs-tools debootstrap

install packages dhcp server, tftp server, nfs server, pxe support files, and nfs boot files.

Make root directory on NFS

1-1 make root file on nfs.

If export NFS is /srv/nas.

# mkdir /srv/nas/pxeroot

root directory name is your choice, pxeroot , hostname and so on.

# cd /srv/nas/pxeroot

# mknfsroot-file

You can wget mknfsroot-file from http://ntools.net/arc/nodisk/.


DHCP is good choice easy to setup tftp sever setting.


Static IP

As described in #175324 ipconfig have problems with DHCP relays. Static IP is configured by parameter:

  1. <client-ip> IP address of the client. If empty, the address will

    1. either be determined by RARP/BOOTP/DHCP. What protocol

      is used de- pends on the <autoconf> parameter. If this parameter is not empty, autoconf will be used.

  2. <server-ip> IP address of the NFS server. If RARP is used to

    1. determine the client address and this parameter is NOT empty only replies from the specified server are accepted. To use different RARP and NFS server, specify your RARP server here (or leave it blank), and specify your NFS server in the `nfsroot’ parameter (see above). If this entry is blank the address of the server is used which answered the RARP/BOOTP/DHCP request.

  3. <gw-ip> IP address of a gateway if the server is on a different

    1. subnet. If this entry is empty no gateway is used and the server is assumed to be on the local network, unless a value has been received by BOOTP/DHCP.

  4. <netmask> Netmask for local network interface. If this is empty,

    1. the netmask is derived from the client IP address assuming classful addressing, unless overridden in BOOTP/DHCP reply.

  5. <hostname> Name of the client. If empty, the client IP address is

    1. used in ASCII notation, or the value received by BOOTP/DHCP.

  6. <device> Name of network device to use. If this is empty, all

    1. devices are used for RARP/BOOTP/DHCP requests, and the first one we receive a reply on is configured. If you have only one device, you can safely leave this blank.

  7. <autoconf> Method to use for autoconfiguration. If this is either

    1. ‘rarp’, ‘bootp’, or ‘dhcp’ the specified protocol is used. If the value is ‘both’, ‘all’ or empty, all protocols are used. ‘off’, ‘static’ or ‘none’ means no autoconfiguration.

Adding a swap file

In case you do need or want to set up a swapfile, here’s what I did to get one working:

sudo apt-get install dphys-swapfile

this package sets up a swap file at /var/swap that is 2x your current ram. however, it still doesn’t setup the swapfile on its own, though it does try. to get the swap file working the rest of the way, do:

sudo vi /etc/dphys-swapfile

Edit ‘/etc/dphys-swapfile’ . If your PC memory capacity is 4G or more, should be fix  ‘CONF_SWAPFACTOR=1’ and ‘CONF_MAXSWAP=xxxx’. xxxx is 8192 (8G), 16384(16G) and so on.

After fix ‘/etc/dphys-swapfile’,

sudo systemctl restart dphys-swapfile.service