beofdisk -- Query and modify hard drive partitions on slave nodes.


/usr/sbin/beofdisk [-h, --help] [-v, --verison] [-q, --query] [-w, --write] [-n node, --node node] [-d, --default]


This script allows you to partition the hard drives on slave nodes.

When you query, it will create files in /etc/beowulf/fdisk/, one for each device/drive geometry it finds. These files can then be modified by hand, or with the defaults options, then written back to the hard drives.


-h, --help

Display a help message and exit.

-v, --version

Display version information and exit.

-q, --query

Queries the hard drives on the specified nodes and writes their current partition tables into files in /etc/beowulf/fdisk/. If no node is specified, then all nodes are queried.

-w, --write

Matches the files in /etc/beowulf/fdisk/ with the hard drives on the specified machines and changes the partition tables on the slave nodes to match what is in the files.

WARNING: This option is potentially dangerous. It modifies partition tables and incorrect partition tables can cause problems.

-n node, --node node

node should be changed to the number of the node you wish to use. If you do not use this option, it will default to using all nodes.

-d, --default

This will cause beofdisk to go through the files in /etc/beowulf/fdisk/ and set them all to contain default partitioning schemes that include a beoboot partition, a swap partition, and the rest as /.


Creating default partition schemes:

[root@cluster /root]#  beofdisk -d
Creating a default partition table for hda:2495:255:63
Creating a default partition table for hda:1222:255:63

Writing the defaults to node 0's hard drive:

[root@cluster /root]#  beofdisk -w -n 0

Disk /dev/hda: 2495 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls   #blocks   Id  System
/dev/hda1   *      0+      0       1-     8001   89  Unknown
/dev/hda2          1      32      32    257040   82  Linux swap
/dev/hda3         33    2494    2462  19776015   83  Linux
/dev/hda4          0       -       0         0    0  Empty
New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End  #sectors  Id  System
/dev/hda1   *        63     16064     16002  89  Unknown
/dev/hda2         16065    546209    530145  82  Linux swap
/dev/hda3        546210  40082174  39535965  83  Linux
/dev/hda4             0         -         0   0  Empty
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
Node partition tables have been modified.
You must reboot each affected node for changes to take effect.

Query the disks on the compute nodes to determine how they are partitioned:

[root@cluster /root]#  beofdisk -q

This creates a partition file in /etc/beowulf/fdisk, with a name similar to sda:512:128:32 and containing lines similar to the following:

[root@cluster /root]# cat sda:512:128:32
/dev/sda1  :  start=    32,  size=  8160,   id=89,  bootable
/dev/sda2  :  start=    8192,   size=    1048576,  Id=82
/dev/sda3  :  start=    1056768,    size=    1040384,  Id=83
/dev/sda4  :  start=    0, size=  0,  Id=0