Adding DASD storage in Hercules+z/OS

So given you've got your nice z/OS copy from a special bay of pirates and you now wanna get cracking.
The only problem is: The storage is way too small.
The Hercules doc does here a good job in emulating not only the IBM mainframe but also the uselessness of IBM documentations.
Here a quick and dirty guide on how to initialize a new DASD device from the UNIX shell, so that you don't have to fight with the base system and so.

First you've got to go to your images folder and create an image.
In my case it's located in the DASD subfolder called GNU.

The following command should give you around 6GB of storage (8000 cylinders)

dasdinit -z LOCAL.CCKD 3390-3 LOCAL 8000

Next we have to add it into our hercules.cnf which should look somehow like that.
Make sure the address (0AB5) doesn't collide with already existing DASD lines.

0AB5    3390 $(DASD)/GNU/LOCAL.CCKD

Next we start up the mainframe (https://blog.the-leviathan.ch/?p=1361) and go into the x3270 command shell (not the one with the ncurses like selection menu)

Here we first bring the DASD offline with

V 0AB5,OFFLINE

Now we go into the telnet session and create a file, let's say script.txt with the following content

//ICKDSF01 JOB  (FB3),'INIT 3390 DASD',CLASS=A,MSGCLASS=H,
//             NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//* 3380/3390 INITIALIZE VOLUME
//*
//*   VARY DEVICE ONLINE/OFFLINE AT LEAST ONCE BEFORE RUNNING
//*       THIS JOB, OR I/O ERROR WILL OCCUR AND NOT INITIALIZE
//*
//*   CHANGE
//*     VVVV - TO CUA ADDRESS OF DASD
//*   NEWNNN - TO NEW DASD VOLID
//*
//*   THEN PLACE A VVDS AT CYL 0 TRK 10-14 WITH JOB IDCDEFVV
//*
//STEP01  EXEC PGM=ICKDSF,REGION=8M
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
 INIT -
      MAP /* MAP DEFECTS */ -
      UNIT(0AB5) /* ADDRESS */ -
      NOCHECK -
      CONTINUE -
      NOVERIFY /* DO NOT CHECK VOLID */ -
      VTOC(0,1,450) /* 8000 CYL VTOC */ -
      INDEX(30,1,90) /* 8000 CYL INDEX */ -
      OWNERID('IBMUSER') -
      VOLID(LOCAL) /*  NEW VOLID  */
//*
//
//*

And now comes they key part no one tells you about:
In your UNIX shell on Telnet you just pipe the content of this textfile to the z/OS command "submit"

IBMUSER:/u/ibmuser: >submit script.txt
JOB JOB02860 submitted from path 'script.txt'

In case you get something like the message below, you can reply by using the REPLY command and the number with the asterisk.

Now we wait for a few minutes and after that we go back into our x3270 shell and bring the DASD back online with (Oh wonder)

V 0AB5,ONLINE

Now we can define an aggregate from this volume with zfsadm and format it.

IBMUSER:/u/ibmuser: >zfsadm define -aggregate PEP.LOCAL -volume LOCAL -cyl 8000
IOEZ00248I VSAM linear dataset PEP.LOCAL successfully created.

IBMUSER:/u/ibmuser: >zfsadm format PEP.LOCAL
IOEZ00552I Multi-file system aggregates are restricted and support will be removed; plan to migrate.
Done.  PEP.LOCAL is now a zFS aggregate.

IBMUSER:/u/ibmuser: >zfsadm attach PEP.LOCAL
IOEZ00552I Multi-file system aggregates are restricted and support will be removed; plan to migrate.
IOEZ00117I Aggregate PEP.LOCAL attached successfully

IBMUSER:/u/ibmuser: >zfsadm create -filesystem PEP.LOCAL -aggregate PEP.LOCAL -size 6291456
IOEZ00099I File system PEP.LOCAL created successfully

For mounting it temporaraly you can execute the following command:

IBMUSER:/u/ibmuser: >/usr/sbin/mount -f PEP.LOCAL -t ZFS -o 'AGGRFULL(90,5)' /usr/local
IBMUSER:/u/ibmuser: >

OR

tso -t "MOUNT FILESYSTEM(PEP.LOCAL) TYPE(ZFS) MOUNTPOINT('/usr/local') MODE(RDWR)"

If you wanna add it to the auto mounted folders you've got to edit the mounting table in TSO. Just follow the white rabbit in the following screenies down the rabbit hole.

Now we add the TSO command from above here in the table at the end of the other mount directives.

In order to get some more newlines you go to the beginning of the number of the empty line and over type the first digit with R (for repeat) and then press enter.

Type "save" in the command field and then the command "end" (you get there by navigating there with the tab key), and as many ends as needed to come back to the top view.

Booting z/OS 1.1 on Hercules

So assuming you got your z/OS 1.1 DASD files from a special bay of pirates (Magnet link) and you now totally wanna try out this "cool software", those bankers are using.
First: Bankers aren't cool. Drugs, especially Cocaine aren't cool and hookers aren't that expensive either, you can afford them with more productive jobs as well.
Second: IBM products aren't cool either.

Now that that's said.
Check out this link for setting up the networking for your virtual main frame under Hercules: http://modernhackers.com/install-ibm-z-os-mainframe-under-gns3

First you might wanna arrange your windows like this with two open x3270 terminal connecting to your Hercules interface like shown in the pic here.

After you have this. You enter "ipl a80" in the Hercules interface and you will see after a moment in one of the two x3270 windows, how the system starts booting.

When it's done booting it will look like that.
The second window now provides you with a management interface.

One of those x3270 windows is a shell the other one is the configuration management tool from z/OS.

You can switch forth and back, using ESC in the Hercules terminal (the very left one) in order to either have a Hercules shell or have an overview of the CPU usage.

Now you can type in the right upper shell:
STOP TCPIP
START TCPIP
STOP OMVS
START OMVS

After that you should be able to connect to your z/OS using telnet on port 1023.

When you wanna shut down your system, as usual with IBM, it's not so simple.

First you go into the x3270 window and type "S SHUTSYS" and press enter.

You wait until it looks like that and then type "Z EOD" and then press enter.

It will write out the logs for a while and then will tell you, that it's done.
At that point where it looks as following you can go to the Hercules terminal and enter quit in order to terminate the emulator.

Here I typed another time "Z EOD", just to make sure it's done writing everything down, because z/OS (like AIX as well) are absolutely pussies, when it comes to corrupted file systems.

They'll tell you "high availability... blah blah". BS.