Difference between revisions of "IRIDIA cluster installing the diskless nodes"

From IridiaWiki
Jump to navigationJump to search
(Changed wrong copy command for kernel configuration file)
 
(6 intermediate revisions by one other user not shown)
Line 4: Line 4:
   
 
=== Installing a new diskless image ===
 
=== Installing a new diskless image ===
Install the package called diskless and diskless-image-simple on majorana:
+
Install the package called diskless on majorana:
 
<pre>
 
<pre>
 
apt-get install diskless
 
apt-get install diskless
apt-get install disklass-image-simple
 
 
</pre>
 
</pre>
 
 
This packages contain tools and binaries for a Debian image for the diskless nodes.
 
This packages contain tools and binaries for a Debian image for the diskless nodes.
   
  +
Before you can create the diskless image, you first have to create some basic files (base.tgz):
Create a new image:
 
 
<pre>
 
<pre>
  +
mkdir /tmp/diskless
diskless newimage
 
  +
mkdir /var/lib/diskless
  +
mkdir /var/lib/diskless/default
  +
diskless-createbasetgz /tmp/diskless [release tag, e.g. sarge] [apt-ftp-or-http-mirror] /var/lib/diskless/default/base.tgz
  +
rm -rf /tmp/diskless
 
</pre>
 
</pre>
For more information on creating see http://wiki.debian.net/index.cgi?DiskLess
 
   
  +
You also need to download an NFS root image (download only, trying to install it will fail) and move it to the directory where you created base.tgz:
In order to create the individual directories for each node, run the script:
 
 
<pre>
 
<pre>
 
apt-get install diskless-image-simple -d
/root/bin/update-host-directories
 
  +
cd /var/cache/apt/archives
  +
mv diskless-image-simple*.deb /var/lib/diskless/default
 
</pre>
 
</pre>
   
  +
You should configure the image to not use devfs:
 
  +
Now you are ready to create a new image:
  +
<pre>
 
diskless-newimage
  +
</pre>
  +
 
For more information on creating see http://wiki.debian.net/index.cgi?DiskLess
  +
  +
Remember to configure the package to NOT use devfs. In case you missed it, here is what to do:
 
<pre>
 
<pre>
 
chroot /var/lib/diskless/default/root
 
chroot /var/lib/diskless/default/root
Line 29: Line 40:
 
<answer with the default except for what concerns devfs>
 
<answer with the default except for what concerns devfs>
 
exit
 
exit
  +
</pre>
update-host-directories
 
  +
 
In order to create the individual directories for each node, run the script:
  +
<pre>
 
/root/bin/update-host-directories
  +
</pre>
  +
  +
Make sure that the network configuration is correct in the diskless image (/var/lib/diskless/default/root/etc/network/interfaces):
  +
<pre>
  +
auto lo
  +
iface lo inet loopback
  +
auto eth0
  +
iface eth0 inet dhcp
 
</pre>
 
</pre>
   
Line 39: Line 62:
 
make menuconfig
 
make menuconfig
 
exit
 
exit
copy /root/.config .
+
copy /boot/config-<kernel_version> .config
 
make menuconfig
 
make menuconfig
 
</pre>
 
</pre>
   
At least four options should be changed, don't use modules, compile everything into the kernel:
+
At least four options should be changed, don't use modules for important devices (like network cards), compile everything into the kernel:
 
* Initial ramdisk (initrd) should be disabled in '''device driver -> block devices''')
 
* Initial ramdisk (initrd) should be disabled in '''device driver -> block devices''')
 
* Mount NFS as root:
 
* Mount NFS as root:
Line 78: Line 101:
   
 
Whola! The new kernel should be installed in the diskless image.
 
Whola! The new kernel should be installed in the diskless image.
  +
  +
Remember to update the kernel dependend package in the diskless image if the new kernel is incompatibe with the old one (e.g. 2.6.x vs. 2.4.x). Upgrading the package modules-init-tools is a good idea.

Latest revision as of 11:38, 22 February 2005

This section is on how to install the diskless nodes from scratch. That includes setting the server up so that serves the diskless nodes. If you are simply adding a new node, then many of the steps described on this page are not necessary.

Let's get started.

Installing a new diskless image

Install the package called diskless on majorana:

apt-get install diskless

This packages contain tools and binaries for a Debian image for the diskless nodes.

Before you can create the diskless image, you first have to create some basic files (base.tgz):

mkdir /tmp/diskless
mkdir /var/lib/diskless
mkdir /var/lib/diskless/default
diskless-createbasetgz /tmp/diskless [release tag, e.g. sarge] [apt-ftp-or-http-mirror] /var/lib/diskless/default/base.tgz
rm -rf /tmp/diskless

You also need to download an NFS root image (download only, trying to install it will fail) and move it to the directory where you created base.tgz:

apt-get install diskless-image-simple -d
cd /var/cache/apt/archives
mv diskless-image-simple*.deb /var/lib/diskless/default


Now you are ready to create a new image:

diskless-newimage

For more information on creating see http://wiki.debian.net/index.cgi?DiskLess

Remember to configure the package to NOT use devfs. In case you missed it, here is what to do:

chroot /var/lib/diskless/default/root
dpkg-reconfigure -p low diskless-image-simple
<answer with the default except for what concerns devfs>
exit

In order to create the individual directories for each node, run the script:

/root/bin/update-host-directories

Make sure that the network configuration is correct in the diskless image (/var/lib/diskless/default/root/etc/network/interfaces):

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

Compiling a new kernel for the diskless nodes

On majorana, download the source code of the kernel which you installed. It should end up in /usr/src. Now use the config file of the kernel you installed on majorana (see IRIDIA cluster installing an OS on the servers) found in /root/.config to compile a kernel for the diskless nodes.

cd /usr/source/[kernel-dir]
make menuconfig
exit
copy /boot/config-<kernel_version> .config
make menuconfig

At least four options should be changed, don't use modules for important devices (like network cards), compile everything into the kernel:

  • Initial ramdisk (initrd) should be disabled in device driver -> block devices)
  • Mount NFS as root:
    • Enable File systems -> Network File Systems -> NFS file system support
    • Enable File systems -> Network File Systems -> Root file system on NFS
  • Assign IP address at boot time:
    • Enable Device drivers -> Networking Support -> Networking Options -> IP: kernel level autoconfiguration -> IP: DHCP support
  • Compile GigaBit network driver into the kernel:
    • Set: Device Drivers->Networking support->Ethernet (1000Mbit)-><*> Intel(R) PRO/1000 Gigabit

Furthermore, the kernel needs a slight change in the source code, so that the kernel requests an address via DHCP after during load:

In net/ipv4/ipconfig.c change:

int ic_enable __initdata = 0;
to:
int ic_enable __initdata = 1;

You are know ready to make a .deb package containing the kernel image:

  	  
make-kpkg --append-to-version -dc kernel_image kernel_headers 

Now you are ready to install the new kernel in the diskless image. The following sequence of commands should do the trick:

cd /usr/src
mv *deb /var/lib/diskless/defaut/root/root
chroot /var/lib/diskless/default/root/
cd root
dpkg -i *deb
exit

Whola! The new kernel should be installed in the diskless image.

Remember to update the kernel dependend package in the diskless image if the new kernel is incompatibe with the old one (e.g. 2.6.x vs. 2.4.x). Upgrading the package modules-init-tools is a good idea.