Project:Infrastructure/Developer Machines/s390

From Gentoo Wiki
Jump to:navigation Jump to:search

s390 Admin Notes

These are various notes mainly targeted at people administrating Gentoo dev machines, although most things are probably generally useful. These are not general "how do I administrate a Gentoo box" notes.


These are the current systems we have available. See machine specific notes at bottom for more details.

Machine Name IP DNS Hostnames Console Server Console Account
lgentoo03 LGENTOO3
lgentoo04 LGENTOO4

Console Access

Contact vapier@ for the console password.

In order to access the s390 console, install the net-misc/suite3270 terminal emulator. This provides multiple UIs for connecting to a remote system. Use whichever version you prefer. We'll focus on two here:

  • x3270: Graphical X interface
  • c3270: Console ncurses interface
  1. Use the open command to connect to the console server (see hostnames above).
  2. The USERID field should be selected by default -- enter the account name for the host (see hostnames above).
  3. If the USERID is fully filled, the cursor moves automatically to the password, otherwise hit tab to move to the field.
  4. Type in the password. Note: while the cursor will move, nothing will be displayed -- no actual characters or the common * marker.

Note: When you are done, do not use #cp logoff as that kills the VM. Only use #cp disconnect.

Common CP/CMS Commands

See the S390/z/VM tips and tricks page for details.

Kernel Management

s390 systems use the zipl tool from the sys-apps/s390-tools package to manage booting of kernels. Things to remember:

  • Make updates to /etc/zipl.conf.
  • Run zipl whenever zipl.conf is changed or kernels referred to by the config file are updated (failure to do so will break booting).
  • The bootable linux kernel is created at arch/s390/boot/image (e.g. under /usr/src/linux/).
  • The make install shortcut usually does not do the right thing under s390.


You cannot format the "full" device as a filesystem. e.g. mke2fs /dev/dasdb will fail. The s390 VM system requires the header of the device have some metadata so the hypervisor can process things correctly.

Make sure you run dasdfmt on the device before you do anything else. This creates the proper metadata structure.

Do not use fdisk to try and format block devices. Use fdasd instead. You can use standard mkfs tools on the partitions after that.

Linking Disks

Contact vapier@ for the link passwords.

Disks can be linked between VMs. This can be useful when recovering a broken install or rootfs as doing it from a full system can be faster than trying to netboot.

This example will assume lgentoo4's rootfs is corrupted, but lgentoo3 boots fine. Both systems have this disk layout:

 00: DASD 0150 3390 MRC79A R/W       3336 CYL ON DASD  C79A SUBCHANNEL = 0006
 dasda1 /boot
 dasda2 /usr
 00: DASD 0151 3390 MRC79A R/W       3338 CYL ON DASD  C79A SUBCHANNEL = 0007
 dasdb1 /

To start, go into lgentoo3's /etc/zipl.conf settings and add another boot entry to list the new extra disks. Copy an existing working entry and then update the dasd= kernel option to include 152,153 at the end. Run zipl to save. Note: If desired, add another entry to boot lgentoo4 on lgentoo3 by swapping the existing 150,151 with 152,153 in the dasd= setting. This might be a little more convenient in testing than having to detach/relink the disks when testing.

Next, shut off both VMs. lgentoo4 will remain off for the duration of this process. Log in to the lgentoo3 VM via the 3270 console and enter CP/CMS. Then link the disks:

 # Double check the disk layout.
 # Link lgentoo4's 150 DASD as lgentoo3's 152 DASD.  Use W here to get write access.
 LINK lgentoo4 150 152 W PASS=...
 # Then link lgentoo4's 151 as lgentoo3's 153.
 LINK lgentoo4 151 153 W PASS=...

Now boot lgentoo3 using the new boot entry created earlier. It should boot & mount like normal. lgentoo4's disks should now be accessible under /dev.

 # Assuming 152 is dasdf & 153 is dasdg.
 mount /dev/dasdg1 /mnt/tmp
 mount /dev/dasdf2 /mnt/tmp/usr
 mount /dev/dasdf1 /mnt/tmp/boot
 # Now chroot into /mnt/tmp and have access to lgentoo4's setup.

Once lgentoo4 is done recovering, shut down lgentoo3 again, enter CP/CMS, and detach the disks.


Finally boot lgentoo3 & lgentoo4 back up like normal.

Sample Config Files


defaultmenu = menu

    image = /boot/image
    target = /boot/zipl
    parameters = "no_removal_warning dasd=0150,0151,0160,0191,0200 root=/dev/dasdb1 rootfstype=ext4 panic=3 TERM=dumb init=/bin/busybox setarch linux32 /ginit"

    image = /boot/image.ok
    target = /boot/zipl
    parameters = "no_removal_warning dasd=0150,0151,0160,0191,0200 root=/dev/dasdb1 rootfstype=ext4 panic=3 TERM=dumb init=/ginit"

    image = /boot/image.ok
    target = /boot/zipl
    parameters = "no_removal_warning dasd=0150,0151,0160,0191,0200 root=/dev/dasdb1 rootfstype=ext4 panic=3 TERM=dumb init=/bin/bb rw"

    default = 1
    prompt = 1
    target = /boot/zipl
    timeout = 10
    1 = Gentoo
    2 = Gentoo_OK
    3 = Rescue


config_eth0=" 2620:91:0:688:1::31/64"
routes_eth0="default via"
ccwgroup_eth0="0.0.0340 0.0.0341 0.0.0342"
ccwgroup_opts_eth0="layer2=1" #fake_ll=0

Manual Network Bringup

If the network device fails to come up properly, you can online it manually.

  • Load the kernels modules for ethernet.
root #modprobe ccwgroup
root #modprobe qeth
  • Bind the hardware ports to the ethernet driver -- the x.y.zzzz numbers will depend on your system.
root #cd /sys/bus/ccwgroup/drivers/qeth/
root #echo 0.0.0340,0.0.0341,0.0.0342 > group
  • Initialize the ethernet settings.
root #cd /sys/devices/qeth/0.0.0340/
root #echo 0 > layer2
root #echo 0 > fake_ll
root #echo 1 > online
  • Bring up the network directly -- obviously the network settings here depend on your box.
root #ifconfig ${iface} broadcast netmask
root #route add default gw

Machine-specific Notes


  • Contact: &
  • IPv4:; netmask; gateway
  • IPv6: 2620:91:0:688:1::31/64; gateway 2620:91:0:688::1/64
  • Memory: 2G
  • vCPU: 2 IFLs (virtual)
  • Disks:
   vaddr 150 and 151 are approx. 2.3G each, where SLES 11 currently resides (dasda and dasdb)
   vaddr 200 - large approx. 23G volume, dasde.  Can be used for whatever you want.
   vaddr 160 - a virtual disk used by SLES for swap (exists only in z/VM memory).
               Don't use it to store files as it will be recreated every time the server reboots.
   vaddr 190-19F, 8888 - utility disks for z/VM, they are read/only.
                         191 is the exception, that is for SLES to boot from.  Not
                         enough space to use for anything else.


  • IPv4:; netmask; gateway
  • IPv6: 2620:91:0:688:1::32/64; gateway 2620:91:0:688::1/64
  • Memory/CPU/Disk: same as lgentoo3


See Also