Mark Post writes:
> >>> On 5/17/2016 at 11:51 AM, Scott Rohling <[email protected]> wrote:
> > I'm wondering if something like this would work?:
> >
> > You can add 'count=xx' to only write so many blocks... not sure how many
> > it takes to wipe formatting info - nothing to play with at the moment..
> >
> >
> > dd if=/dev/zero of=/dev/dasdX iflag=nocache oflag=direct bs=4096
>
> It doesn't seem to work. You're still going to be limited by the
> dasd_eckd_mod driver to writing in the formatted space and not the raw device
> itself. I even tried turning on the raw_track_access and that didn't help
> either. Trying to use both that and oflag=direct caused an I/O error and the
> dd aborted.
You do indeed need to enable raw_track_access (must be done while
device is offline to Linux) but you also need to write valid track
images and use 64KB O_DIRECT I/Os.
Linux interprets track images as starting from the R0 (no key,
8 bytes of \0 data) (not starting from the 5-byte HA as done in
AWS format) and having 8 0xff bytes terminate the track data
(followed by padding to 64KB).
So an ad hoc and quick and dirty way to write a couple of tracks
of a lone R0 that'll be treated by Linux as "n/f" is (starting
with DASD device 777 offline):
# chccwdev -a raw_track_access=1 -e 777
# perl -e 'for ($h=0;$h<2;$h++){printf
"\0\0\0%c\0\0\0\x8%s",$h,(("\0"x8).("\xff"x8).("\0"x65512))}' | dd bs=65536
count=2 oflag=direct of=/dev/disk/by-path/ccw-0.0.0777
Then take the device offline and online (in normal mode) again with
# chccwdev -d 777
# chccwdev -a raw_track_access=0 -e 777
Works for me. Note that you need the explicit resetting of
raw_track_access back to zero since the attribute is "sticky" across
varying offline/online.
--Malcolm
--
Malcolm Beattie
Linux and System z Technical Consultant, zChampion
IBM UK Systems and Technology Group
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/