November 18, 2013

Raw ECKD access from zLinux

Since a while the Linux DASD driver has been enhanced to access full ECKD tracks. Basically the following steps are needed:
  1. Take the device offline from other System z operating systems
  2. get the device online in zLinux 
  3. switch the device in raw ECKD mode:
    echo 1 > /sys/bus/ccw/devices/<device ID>/raw_track_access
  4. use a program that reads and writes whole tracks (64k) with direct IO like a dd with the respective flags to read or write
More details can be found in the chapter about the DASD driver (search for "raw_track_access") in the "Device Drivers, Features, and Commands" book for the respective distributions, e.g.
This book is really recommended as a reference.