NAME

build_diskfull - set up a node for diskfull boot.


MODULE

diskfull


SYNOPSIS

build_diskfull [--help] [--db connectstring] [--dryrun] [--dir <path>] [--check_used] [--prep] [--mount] [--update [--image [--delete]]] [--bootloader] [--full]


DESCRIPTION

This tool runs on a node with a disk, setting it up for a diskfull boot. When the node is booted diskless, it can be used to call rsync, kickstart, a multicast image distribution tool, or otherwise initialize the disk image. Regardless of how the node is currently booted, build_diskfull provides the capability to rsync and apply image updates, overlays, and individual config files to customize the disk image.


OPTIONS

--check_used Try to determine if any of the relevant disk devices are in use.

--prep Partition drives and initialize the filesystems.

--mount Mount the partitions (and turn on swap) once they are prepared.

--update Use rsync to apply overlay updates and configuration changes.

--image Also rsync the base image, not just overlays and custom configs. This can significantly increase the --update time, but should be used if you aren't CERTAIN that only overlays have changed.

--delete Delete files from the local disk that do not exist in the image. Overlays will still get applied, potentially replacing some of those files. The net result is a ``clean'' sync. Otherwise, --update will only add or modify files.

--full Rebuild the disk image from scratch. Has no effect if the root filesystem (``/'', rootfs) is mounted on one of the target devices, or if unable to determine the rootfs device.

--dir <path> Restrict the sync (and config file generation) to only files under the given directory path. This is useful for speeding up the --update process if you know only files in a particular directory were changed.

--dryrun Go through as many steps as possible without actually modifying the disk. Commands that would be run are printed to STDOUT.

--db <connectstring> Database type and connection information. For GDBM, ``GDBM:'' followed by the filename of the cluster database to use. For LDAP, the syntax is ``LDAP:host:port:dbname''

--help Print extended usage information

--man Print this manpage.


EXAMPLES

A useful command to clean out temporary space on a node is:

  build_diskfull --update --delete --dir /var/tmp


NOTES

Partitioning and formatting decisions are based on the node's ``disks'' attribute. This attribute is formatted as follows: 'disks' => { 'hda' => [ { 'mountpoint' => '/var/tmp', 'size' => '8G', 'fstype' => 'ext3', 'options' => 'defaults', 'bootable' => 0, }, { 'size' => '2.5*mem', 'fstype' => 'swap', 'options' => 'pri=42' } ], 'sda' => [ ... ] 'md' => [ { 'mountpoint' => '/scratch', 'raid-level' => '1', 'devices' => [ 'sda1', 'sdb1' ] }, ] }

In other words there is a hash of disk devices, each containing an array of partitions, each containing a hash of configuration parameters.

The ``size'' partition attribute is in Gigabytes by default, but the following extensions can be used:

  G     - value is in Gigabytes (default)
  M     - value is in Megabytes
  K     - value is in Kilobytes
  *mem  - use as a multiple of total memory
  %     - use as a percentage of disk space not otherwise allocated

For example, the following commands can be used to set up /var/tmp (local temporary space) and swap on ``tn0'': device_mgr --set --disk hda --part 0 --size 2.5*mem \ --fstype swap --options pri=40 tn0 device_mgr --set --disk hda --part 1 --size 2560M \ --fstype ext3 --mountpoint /var/tmp tn0 rsh tn0 prep_localdisk

Non-percentage-based sizes are alloted space FIRST, and the ``N%'' sizes are then calculated as a percentage of remaining disk space. For example, replacing ``2560M'' above with ``100%'' will use 5G for swap (on a node with 2G RAM) and everything else for /var/tmp. The sum of the percentage sizes should never exceed 100, but may be less if you don't want to use the whole disk.

The keyword ``FULLDISK'' can also be used for the size partition attribute to indicate that the entire disk should be used, and no partitions should be created. (This may result in better performance than size = 100% on some systems.) A ``FULLDISK'' partition should be the first and only one specified for the disk.


FILES

The default paths for location of the cluster configuration database, cloned directories, supporting libraries, and other settings are recorded in the CConf.pm config file. Set the environment variable CLUSTER_CONFIG to the location of CConf.pm, or use the default of /cluster/config


SEE ALSO

build_diskless, cclone