Preparing an ECKD type DASD for use

6.10 LPAR mode z/VM guest KVM guest

Before you can use an ECKD type DASD as a disk for Linux® on IBM® Z, you must format it with a suitable disk layout. You must then create a file system or define a swap space.

Before you begin

  • The base component and the ECKD component of the DASD device driver must have been compiled into the kernel or have been loaded as modules.
  • The DASD device driver must have recognized the device as an ECKD type device.
  • You need to know the device bus-ID for your DASD.

About this task

If you format the DASD with the compatible disk layout, you must create one, two, or three partitions. You can then use your partitions as swap areas or to create a Linux file system.

Procedure

Perform these steps to prepare the DASD:

  1. Issue lsdasd to find out if the device is online.
    If necessary, set the device online, see Setting a DASD online or offline.
  2. Format the device with the dasdfmt command. The formatting process can take hours for large DASDs.
    If you want to use the CMS disk layout, and your DASD is already formatted with the CMS disk layout, skip this step.
    Tips:
    • Use the largest possible block size, ideally 4096; the net capacity of an ECKD DASD decreases for smaller block sizes. For example, a DASD formatted with a block size of 512 byte has only half of the net capacity of the same DASD formatted with a block size of 4096 byte.
    • For DASDs that have previously been formatted with the cdl or ldl disk layout, use the dasdfmt quick format mode.
    • Use the -p option to display a progress bar.
    Example: Assuming that /dev/dasdzzz is a valid device node for 0.0.b100:
    # dasdfmt -b 4096 -p /dev/dasdzzz
  3. Proceed according to your chosen disk layout:
    • If you have formatted your DASD with the Linux disk layout or the CMS disk layout, skip this step and continue with step 4. You already have one partition and cannot add further partitions on your DASD.
    • If you have formatted your DASD with the compatible disk layout use the fdasd command to create up to three partitions for details).
      Example: To start the partitioning tool in interactive mode for partitioning a device /dev/dasdzzz issue:
      # fdasd /dev/dasdzzz
      If you create three partitions for a DASD /dev/dasdzzz, the device nodes for the partitions are /dev/dasdzzz1, /dev/dasdzzz2, and /dev/dasdzzz3.
      Result: fdasd creates the partitions and updates the partition table(VTOC).
  4. Depending on the intended use of each partition, create a file system on the partition or define it as a swap space.
    • Either create a file system of your choice, for example, with the Linux mke2fs command (see the man page for details).
      Note: Do not make the block size of the file system smaller than the block size that was used for formatting the disk with the dasdfmt command.
      Tip: Use the same block size for the file system that has been used for formatting.
      Example:
      # mke2fs -j -b 4096 /dev/dasdzzz1
    • Or define the partition as a swap space with the mkswap command (see the man page for details).
  5. Mount each file system to the mount point of your choice in Linux and enable your swap partitions.
    Example: To mount a file system in a partition /dev/dasdzzz1 to a mount point /mnt and to enable a swap partition /dev/dasdzzz2 issue:
    # mount /dev/dasdzzz1 /mnt
    # swapon /dev/dasdzzz2

    If a block device supports barrier requests, journaling file systems like ext3 or reiserfs can use this feature to achieve better performance and data integrity. Barrier requests are supported for the DASD device driver and apply to ECKD, FBA, and the DIAG discipline.

    Write barriers are used by file systems and are enabled as a file-system specific option. For example, barrier support can be enabled for an ext3 file system by mounting it with the option -o barrier=1:

    # mount -o barrier=1 /dev/dasdzzz1 /mnt