Maintaining your Diskless Setup

Some hints on how to maintain your diskless clients/packages.

This Wiki page provides some hints for performing normal maintenance on your Diskless Setup for your Linux VME Controllers. It is assumed that you have already setup PXE/tftpboot/NFS as instructed here.

 

Setting up the chroot environment

To have the full capabilities and environment in the chroot that is had in the Linux VME controller, a few commands must be run. As 'root' on your NFS server:


mount -o bind /proc /diskless/CENTOS5/root/proc
mount -o bind /dev /diskless/CENTOS5/root/dev
mount -o bind /dev/pts /diskless/CENTOS5/root/dev/pts
mount -o bind /sys /diskless/CENTOS5/root/sys

If you have any other NFS mounted directories on the VME Controller, you can mount them as well. For example:


mount -o bind /site /diskless/CENTOS5/root/site
mount -o bind /apps /diskless/CENTOS5/root/apps

Or... perhaps better:

mount -o bind /u /diskless/CENTOS5/root/u

Once done, this should not need to be done again... unless your machine hosting the NFS server is rebooted.

Using chroot

On the machine with the actual filesystem (served out through NFS) that is used by the VME controller, use chroot to performing maintenance of the diskless OS on that filesystem. Assuming the root of this diskless filesystem is at

/diskless/Centos5/root/

execute this command

su -c 'chroot /diskless/CENTOS5/root'

and enter the root password. You are now in the 'diskless' OS environment. Any change you make to the filesystem, here, will be propagated to any Linux VME controller using this filesystem.

Installing and Updating Packages

Once your chroot environment is setup, use it to install RPMs or update the OS. "Log In" (from the NFS machine) using

su -c 'chroot /diskless/CENTOS5/root'

Then do something... like:

  • Install packages from an rpm, using rpm:
rpm -ivh /package/location/my_favorite_package-2.0.1-198.rpm
  • Install packages from an rpm, using yum (handles the dependencies):
yum install /package/location/my_favorite_package-2.0.1-198.rpm
  • Install a specific package using yum repo
yum install gcc
  • Update your OS (update currently installed RPMs with their most recent version):
yum update

Sometimes errors arise... and are usually associated with the rpm database.  To get around these problems:

rm /var/lib/rpm/__db.*

Or if you're squeemish about this:

mv /var/lib/rpm/__db.* /root/

Then try installing/updating packages as needed.