Dynamic management of DASD devices in Linux running on zSeries

Abstract

The dasd device driver for Linux on zSeries uses a /proc filesystem interface to dynamically configure DASD devices. To simplify the interface and save typing keystokes, try this script.

Contents


The dasd script is a wrapper for the /proc file system interface to the DASD device driver. It can help systems administrators dynamically manage DASD devices for Linux running on zSeries. Add the script to a directory in the PATH (for example, /usr/local/bin).

The dasd command syntax is as follows.

To list all attached DASD devices:
dasd list

To add DASD device number devno, or devices in the range start to end:
dasd add devno | start-end

To disable DASD device number devno, or devices in the range start to end:
dasd off devno | start-end

To enable DASD device number devno, or devices in the range start to end:
dasd on devno | start-end

The following code is the dasd script.

#!/bin/sh
# dasd - simple utility for dynamic DASD management

if [ "$1" = "add" -a "$2" != "" ]; then
echo "add range=$2" > /proc/dasd/devices
elif [ "$1" = "on" -a "$2" != "" ]; then
echo "set device range=$2 on" > /proc/dasd/devices
elif [ "$1" = "off" -a "$2" != "" ]; then
echo "set device range=$2 off" > /proc/dasd/devices
elif [ "$1" = "list" ]; then
cat /proc/dasd/devices
else
echo "Usage: dasd add|on|off vdev_or_range" 1>&2
echo " dasd list" 1>&2
exit 2
fi

Special Notices

This material has not been submitted to any formal IBM test and is published AS IS. It has not been the subject of rigorous review. IBM assumes no responsibility for its accuracy or completeness. The use of this information or the implementation of any of these techniques is a client responsibility and depends upon the client's ability to evaluate and integrate them into the client's operational environment.

Profile

Publish Date
30 August 2002


Rating: Not yet rated


Author(s)

IBM Form Number
TIPS0023