Preparing disks for use with OCFS2

Prepare the disks for use on the cluster, if this task has not already been done.

Linux® on IBM® System z® is not aware of disk devices until they are brought online, which is when they are assigned a Linux file name. Linux file names are /dev/dasdx, or /dev/scdx for a SCSI device, where x identifies the disk in Linux.

To prepare the disks for use with OCFS2 on SUSE Linux Enterprise Server, complete these steps:
  1. If it is necessary to bring the disks you select for the cluster online, issue the chccwdev command as shown, where 722c is the disk device number from the disk storage unit:
    chccwdev -e 722c
  2. Verify the results of the chccwdev command to see which disks are online, by issuing this command:
    lscss |grep yes
  3. Issue the lsdasd or lscss command to correlate the Linux names with the device numbers.
  4. If the disk has not been prepared with low-level formatting for DASD, issue the dasdfmt command, where x identifies the disk:
    dasdfmt -f /dev/dasdx -b 4096 -p
  5. Partition the disks, by issuing this command:
    fdasd -a /dev/dasdx
  6. Check to see that the disks are partitioned by viewing the file /proc/partitions, with this command:
    cat /proc/partitions
  7. Verify that none of the devices are mounted at this point in the installation, and that the O2CB cluster is online. The ocfs2console should display the disks as online and visible to the server in the cluster that is running the ocfs2console.
  8. Format the disks for OCFS2 on the ocfs2console by clicking Tasks > Format. Select the disks one at a time from a drop-down list of available devices on the ocfs2console.
  9. Specify these values for each disk device:
    Cluster size
    Unit of space, in bytes, that is allocated for a file. Select a value that is larger than the blocksize. Supported values are 4 KB through 1 MB. This study chose the largest unit, 1 MB, for data storage.
    Blocksize
    Smallest unit of space, in bytes, addressable by the file system (managed with the metadata). Supported sizes are 4 KB, 8 KB, 16 KB, 32 KB, 64 KB, 256 KB, and 1 MB. This study chose 4 KB, because it is the Linux block size.
    Number of slots
    Number of nodes that can use the volume concurrently. Values range from 1 to 255. The number of slots can be increased later, but not decreased, by using the task bar on the ocfs2console. This study chose two slots for a two-node system.
Format the disks only on one node, which can be done with a Linux command as shown. This example formats the disk named /dev/dasdg1 with a blocksize of 4 KB and cluster size of 1 MB, and creates two slots for use by a two-node cluster:
mkfs.ocfs2 -b 4k -C 1M -N 2 -L MyLabel /dev/dasdg1

As shown above, the disks accept labels, and the ocfs2console has a drop down task menu to put a label on each disk. This optional feature might help the administrator to keep track of the disks being mounted on multiple nodes. However, if labels are not used for all tasks such as backing up or in the zipl.conf file (described in Too many DASDs accessible to Linux for read), then using labels in some situations will not simplify mapping disks; it creates another name field to map.

See Managing shared disks for strategies to keep track of shared disks on a storage control unit with IBM System z.