beofdisk

Name

beofdisk – Query and modify hard drive partitions on compute nodes.

Synopsis

beofdisk [-h, –help] [-v, –version] [-q, –query] [-w, –write] [-d, –default] [-M, –mbr] [-n num, –node num]

Description

This script allows you to partition the hard drives on compute 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.

Options

-h, --help

Display a help message and exit.

-v, --version

Display version information and exit.

-q, --query

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

-w, --write

Matches the files in /etc/beowulf/fdisk/ with the hard drives and changes the partition tables on the compute nodes to match what is in the files. If no -n num node is specified, then all nodes are written.

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

-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 /.

-M, --MBR

Write a simple Master Boot Record to the hard drive that directs the BIOS to “boot next device” after each failure to boot. Typically, this ultimately results in a PXE boot. If no -n num node is specified, then all nodes are written with this new MBR.

-n num, --node num

By default, the apply the specified operation to all nodes. Optionally, apply the operation only to node num.

Examples

Creating default partition schemes:

[root@cluster ~] # 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 ~] #  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 ~] # beofdisk -q

The following 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 ~] # 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