Este conteúdo não está disponível no idioma selecionado.
Chapter 17. Configuring a Linux instance on 64-bit IBM Z
This section describes most of the common tasks for installing Red Hat Enterprise Linux on 64-bit IBM Z.
17.1. Adding DASDs to a z/VM system Copiar o linkLink copiado para a área de transferência!
Direct Access Storage Devices (DASDs) are a type of storage commonly used with 64-bit IBM Z. For more information, see Working with DASDs in the IBM Knowledge Center. The following example is how to set a DASD online, format it, and make the change persistent.
Verify that the device is attached or linked to the Linux system if running under z/VM.
CP ATTACH EB1C TO *
CP ATTACH EB1C TO *
To link a mini disk to which you have access, run the following commands:
CP LINK RHEL7X 4B2E 4B2E MR DASD 4B2E LINKED R/W
CP LINK RHEL7X 4B2E 4B2E MR
DASD 4B2E LINKED R/W
17.2. Dynamically setting DASDs online Copiar o linkLink copiado para a área de transferência!
This section contains information about setting a DASD online.
Procedure
Use the
cio_ignoreutility to remove the DASD from the list of ignored devices and make it visible to Linux:cio_ignore -r device_number
# cio_ignore -r device_numberCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace device_number with the device number of the DASD. For example:
cio_ignore -r 4b2e
# cio_ignore -r 4b2eCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set the device online. Use a command of the following form:
chccwdev -e device_number
# chccwdev -e device_numberCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace device_number with the device number of the DASD. For example:
chccwdev -e 4b2e
# chccwdev -e 4b2eCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For instructions on how to set a DASD online persistently, see Persistently setting DASDs online.
17.3. Preparing a new DASD with low-level formatting Copiar o linkLink copiado para a área de transferência!
Once the disk is online, change back to the /root directory and low-level format the device. This is only required once for a DASD during its entire lifetime:
When the progress bar reaches the end and the format is complete, dasdfmt prints the following output:
Rereading the partition table... Exiting...
Rereading the partition table...
Exiting...
Now, use fdasd to partition the DASD. You can create up to three partitions on a DASD. In our example here, we create one partition spanning the whole disk:
After a (low-level formatted) DASD is online, it can be used like any other disk under Linux. For example, you can create file systems, LVM physical volumes, or swap space on its partitions, for example /dev/disk/by-path/ccw-0.0.4b2e-part1. Never use the full DASD device (dev/dasdb) for anything but the commands dasdfmt and fdasd. If you want to use the entire DASD, create one partition spanning the entire drive as in the fdasd example above.
To add additional disks later without breaking existing disk entries in, for example, /etc/fstab, use the persistent device symbolic links under /dev/disk/by-path/.
17.4. Persistently setting DASDs online Copiar o linkLink copiado para a área de transferência!
The above instructions described how to activate DASDs dynamically in a running system. However, such changes are not persistent and do not survive a reboot. Making changes to the DASD configuration persistent in your Linux system depends on whether the DASDs belong to the root file system. Those DASDs required for the root file system need to be activated very early during the boot process by the initramfs to be able to mount the root file system.
The cio_ignore commands are handled transparently for persistent device configurations and you do not need to free devices from the ignore list manually.
17.5. DASDs that are part of the root file system Copiar o linkLink copiado para a área de transferência!
The file you have to modify to add DASDs that are part of the root file system has changed in Red Hat Enterprise Linux 8. Instead of editing the /etc/zipl.conf file, the new file to be edited, and its location, may be found by running the following commands:
machine_id=$(cat /etc/machine-id) kernel_version=$(uname -r) ls /boot/loader/entries/$machine_id-$kernel_version.conf
# machine_id=$(cat /etc/machine-id)
# kernel_version=$(uname -r)
# ls /boot/loader/entries/$machine_id-$kernel_version.conf
There is one boot option to activate DASDs early in the boot process: rd.dasd=. This option takes a Direct Access Storage Device (DASD) adapter device bus identifier. For multiple DASDs, specify the parameter multiple times, or use a comma separated list of bus IDs. To specify a range of DASDs, specify the first and the last bus ID. Below is an example of the /boot/loader/entries/4ab74e52867b4f998e73e06cf23fd761-4.18.0-80.el8.s390x.conf file for a system that uses physical volumes on partitions of two DASDs for an LVM volume group vg_devel1 that contains a logical volume lv_root for the root file system.
To add another physical volume on a partition of a third DASD with device bus ID 0.0.202b. To do this, add rd.dasd=0.0.202b to the parameters line of your boot kernel in /boot/loader/entries/4ab74e52867b4f998e73e06cf23fd761-4.18.0-32.el8.s390x.conf:
Make sure the length of the kernel command line in the configuration file does not exceed 896 bytes. Otherwise, the boot loader cannot be saved, and the installation fails.
Run zipl to apply the changes of the configuration file for the next IPL:
17.6. DASDs that are not part of the root file system Copiar o linkLink copiado para a área de transferência!
Direct Access Storage Devices (DASDs) that are not part of the root file system, that is, data disks, are persistently configured in the /etc/dasd.conf file. This file contains one DASD per line, where each line begins with the DASD’s bus ID.
When adding a DASD to the /etc/dasd.conf file, use key-value pairs to specify the options for each entry. Separate the key and its value with an equal (=) sign. When adding multiple options, use a space or a tab to separate each option.
Example /etc/dasd.conf file
0.0.0207 0.0.0200 use_diag=1 readonly=1
0.0.0207
0.0.0200 use_diag=1 readonly=1
Changes to the /etc/dasd.conf file take effect after a system reboot or after a new DASD is dynamically added by changing the system’s I/O configuration (that is, the DASD is attached under z/VM).
Alternatively, to activate a DASD that you have added to the /etc/dasd.conf file, complete the following steps:
Remove the DASD from the list of ignored devices and make it visible using the
cio_ignoreutility:cio_ignore -r device_number
# cio_ignore -r device_numberCopy to Clipboard Copied! Toggle word wrap Toggle overflow where
device_numberis the DASD device number.For example, if the device number is
021a, run:cio_ignore -r 021a
# cio_ignore -r 021aCopy to Clipboard Copied! Toggle word wrap Toggle overflow Activate the DASD by writing to the device’s
ueventattribute:echo add > /sys/bus/ccw/devices/dasd-bus-ID/uevent
# echo add > /sys/bus/ccw/devices/dasd-bus-ID/ueventCopy to Clipboard Copied! Toggle word wrap Toggle overflow where
dasd-bus-IDis the DASD’s bus ID.For example, if the bus ID is
0.0.021a, run:echo add > /sys/bus/ccw/devices/0.0.021a/uevent
# echo add > /sys/bus/ccw/devices/0.0.021a/ueventCopy to Clipboard Copied! Toggle word wrap Toggle overflow
17.7. FCP LUNs that are part of the root file system Copiar o linkLink copiado para a área de transferência!
The only file you have to modify for adding FCP LUNs that are part of the root file system has changed in Red Hat Enterprise Linux 8. Instead of editing the /etc/zipl.conf file, the new file to be edited, and its location, may be found by running the following commands:
machine_id=$(cat /etc/machine-id) kernel_version=$(uname -r) ls /boot/loader/entries/$machine_id-$kernel_version.conf
# machine_id=$(cat /etc/machine-id)
# kernel_version=$(uname -r)
# ls /boot/loader/entries/$machine_id-$kernel_version.conf
Red Hat Enterprise Linux provides a parameter to activate FCP LUNs early in the boot process: rd.zfcp=. The value is a comma-separated list containing the FCP device bus ID, the target WWPN as 16 digit hexadecimal number prefixed with 0x, and the FCP LUN prefixed with 0x and padded with zeroes to the right to have 16 hexadecimal digits.
The WWPN and FCP LUN values are only necessary if the zFCP device is not configured in NPIV mode, when auto LUN scanning is disabled by the zfcp.allow_lun_scan=0 kernel module parameter or when installing RHEL-8.6 or older releases. Otherwise they can be omitted, for example, rd.zfcp=0.0.4000. Below is an example of the /boot/loader/entries/4ab74e52867b4f998e73e06cf23fd761-4.18.0-80.el8.s390x.conf file for a system that uses physical volumes on partitions of two FCP LUNs for an LVM volume group vg_devel1 that contains a logical volume lv_root for the root file system. For simplicity, the example shows a configuration without multipathing.
-
To add another physical volume on a partition of a third FCP LUN with device bus ID 0.0.fc00, WWPN 0x5105074308c212e9 and FCP LUN 0x401040a300000000, add
rd.zfcp=0.0.fc00,0x5105074308c212e9,0x401040a300000000to the parameters line of your boot kernel in/boot/loader/entries/4ab74e52867b4f998e73e06cf23fd761-4.18.0-32.el8.s390x.conf. For example:
Make sure the length of the kernel command line in the configuration file does not exceed 896 bytes. Otherwise, the boot loader cannot be saved, and the installation fails.
-
Run
dracut -fto update the initial RAM disk of your target kernel. -
Run
ziplto apply the changes of the configuration file for the next IPL:
IBM Z systems use zipl to create a bootmap containing raw block addresses of the kernel and initramfs. If the initramfs is regenerated, its physical layout on disk might change. Because dracut does not automatically update the bootmap, manually run zipl after regenerating the initramfs. Failing to do so may result in a stale bootloader reference and cause the system to fail to boot.
17.8. FCP LUNs that are not part of the root file system Copiar o linkLink copiado para a área de transferência!
FCP LUNs that are not part of the root file system, such as data disks, are persistently configured in the file /etc/zfcp.conf. It contains one FCP LUN per line. Each line contains the device bus ID of the FCP adapter, the target WWPN as 16 digit hexadecimal number prefixed with 0x, and the FCP LUN prefixed with 0x and padded with zeroes to the right to have 16 hexadecimal digits, separated by a space or tab.
The WWPN and FCP LUN values are only necessary if the zFCP device is not configured in NPIV mode, when auto LUN scanning is disabled by the zfcp.allow_lun_scan=0 kernel module parameter or when installing RHEL-8.6 or older releases. Otherwise they can be omitted and only the device bus ID is mandatory.
Entries in /etc/zfcp.conf are activated and configured by udev when an FCP adapter is added to the system. At boot time, all FCP adapters visible to the system are added and trigger udev.
Example content of /etc/zfcp.conf:
Modifications of /etc/zfcp.conf only become effective after a reboot of the system or after the dynamic addition of a new FCP channel by changing the system’s I/O configuration (for example, a channel is attached under z/VM). Alternatively, you can trigger the activation of a new entry in /etc/zfcp.conf for an FCP adapter which was previously not active, by executing the following commands:
Use the
cio_ignoreutility to remove the FCP adapter from the list of ignored devices and make it visible to Linux:cio_ignore -r device_number
# cio_ignore -r device_numberCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace device_number with the device number of the FCP adapter. For example:
cio_ignore -r fcfc
# cio_ignore -r fcfcCopy to Clipboard Copied! Toggle word wrap Toggle overflow To trigger the uevent that activates the change, issue:
echo add > /sys/bus/ccw/devices/device-bus-ID/uevent
# echo add > /sys/bus/ccw/devices/device-bus-ID/ueventCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
echo add > /sys/bus/ccw/devices/0.0.fcfc/uevent
# echo add > /sys/bus/ccw/devices/0.0.fcfc/ueventCopy to Clipboard Copied! Toggle word wrap Toggle overflow
17.9. Adding a qeth device Copiar o linkLink copiado para a área de transferência!
The qeth network device driver supports 64-bit IBM Z OSA-Express features in QDIO mode, HiperSockets, z/VM guest LAN, and z/VM VSWITCH.
For more information about the qeth device driver naming scheme, see Customizing boot parameters.
17.10. Dynamically adding a qeth device Copiar o linkLink copiado para a área de transferência!
This section contains information about how to add a qeth device dynamically.
Procedure
Determine whether the
qethdevice driver modules are loaded. The following example shows loadedqethmodules:Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the output of the
lsmodcommand shows that theqethmodules are not loaded, run themodprobecommand to load them:modprobe qeth
# modprobe qethCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
cio_ignoreutility to remove the network channels from the list of ignored devices and make them visible to Linux:cio_ignore -r read_device_bus_id,write_device_bus_id,data_device_bus_id
# cio_ignore -r read_device_bus_id,write_device_bus_id,data_device_bus_idCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace read_device_bus_id,write_device_bus_id,data_device_bus_id with the three device bus IDs representing a network device. For example, if the read_device_bus_id is
0.0.f500, the write_device_bus_id is0.0.f501, and the data_device_bus_id is0.0.f502:cio_ignore -r 0.0.f500,0.0.f501,0.0.f502
# cio_ignore -r 0.0.f500,0.0.f501,0.0.f502Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the znetconf utility to sense and list candidate configurations for network devices:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Select the configuration you want to work with and use znetconf to apply the configuration and to bring the configured group device online as network device.
znetconf -a f500
# znetconf -a f500 Scanning for network devices... Successfully configured device 0.0.f500 (encf500)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: You can also pass arguments that are configured on the group device before it is set online:
znetconf -a f500 -o portname=myname
# znetconf -a f500 -o portname=myname Scanning for network devices... Successfully configured device 0.0.f500 (encf500)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Now you can continue to configure the
encf500network interface.
Alternatively, you can use sysfs attributes to set the device online as follows:
Create a
qethgroup device:echo read_device_bus_id,write_device_bus_id,data_device_bus_id > /sys/bus/ccwgroup/drivers/qeth/group
# echo read_device_bus_id,write_device_bus_id,data_device_bus_id > /sys/bus/ccwgroup/drivers/qeth/groupCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
echo 0.0.f500,0.0.f501,0.0.f502 > /sys/bus/ccwgroup/drivers/qeth/group
# echo 0.0.f500,0.0.f501,0.0.f502 > /sys/bus/ccwgroup/drivers/qeth/groupCopy to Clipboard Copied! Toggle word wrap Toggle overflow Next, verify that the
qethgroup device was created properly by looking for the read channel:ls /sys/bus/ccwgroup/drivers/qeth/0.0.f500
# ls /sys/bus/ccwgroup/drivers/qeth/0.0.f500Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can optionally set additional parameters and features, depending on the way you are setting up your system and the features you require, such as:
-
portno -
layer2 -
portname
-
Bring the device online by writing
1to the onlinesysfsattribute:echo 1 > /sys/bus/ccwgroup/drivers/qeth/0.0.f500/online
# echo 1 > /sys/bus/ccwgroup/drivers/qeth/0.0.f500/onlineCopy to Clipboard Copied! Toggle word wrap Toggle overflow Then verify the state of the device:
cat /sys/bus/ccwgroup/drivers/qeth/0.0.f500/online 1
# cat /sys/bus/ccwgroup/drivers/qeth/0.0.f500/online 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow A return value of
1indicates that the device is online, while a return value0indicates that the device is offline.Find the interface name that was assigned to the device:
cat /sys/bus/ccwgroup/drivers/qeth/0.0.f500/if_name encf500
# cat /sys/bus/ccwgroup/drivers/qeth/0.0.f500/if_name encf500Copy to Clipboard Copied! Toggle word wrap Toggle overflow Now you can continue to configure the
encf500network interface.The following command from the s390utils package shows the most important settings of your
qethdevice:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
17.11. Persistently adding a qeth device Copiar o linkLink copiado para a área de transferência!
To make your new qeth device persistent, you need to create the configuration file for your new interface. The network interface configuration files are placed in the /etc/sysconfig/network-scripts/ directory.
The network configuration files use the naming convention ifcfg-device, where device is the value found in the if_name file in the qeth group device that was created earlier, for example enc9a0. The cio_ignore commands are handled transparently for persistent device configurations and you do not need to free devices from the ignore list manually.
If a configuration file for another device of the same type already exists, the simplest way to add the config file is to copy it to the new name and then edit it:
cd /etc/sysconfig/network-scripts cp ifcfg-enc9a0 ifcfg-enc600
# cd /etc/sysconfig/network-scripts
# cp ifcfg-enc9a0 ifcfg-enc600
To learn IDs of your network devices, use the lsqeth utility:
lsqeth -p
# lsqeth -p
devices CHPID interface cardtype port chksum prio-q'ing rtr4 rtr6 lay'2 cnt
-------------------------- ----- ---------------- -------------- ---- ------ ---------- ---- ---- ----- -----
0.0.09a0/0.0.09a1/0.0.09a2 x00 enc9a0 Virt.NIC QDIO 0 sw always_q_2 n/a n/a 1 64
0.0.0600/0.0.0601/0.0.0602 x00 enc600 Virt.NIC QDIO 0 sw always_q_2 n/a n/a 1 64
If you do not have a similar device defined, you must create a new file. Use this example of /etc/sysconfig/network-scripts/ifcfg-0.0.09a0 as a template:
Edit the new ifcfg-0.0.0600 file as follows:
-
Modify the
DEVICEstatement to reflect the contents of theif_namefile from yourccwgroup. -
Modify the
IPADDRstatement to reflect the IP address of your new interface. -
Modify the
NETMASKstatement as needed. -
If the new interface is to be activated at boot time, then make sure
ONBOOTis set toyes. -
Make sure the
SUBCHANNELSstatement matches the hardware addresses for your qeth device. -
Modify the
PORTNAMEstatement or leave it out if it is not necessary in your environment. You can add any valid
sysfsattribute and its value to theOPTIONSparameter. The Red Hat Enterprise Linux installation program currently uses this to configure the layer mode (layer2) and the relative port number (portno) ofqethdevices.The
qethdevice driver default for OSA devices is now layer 2 mode. To continue using oldifcfgdefinitions that rely on the previous default of layer 3 mode, addlayer2=0to theOPTIONSparameter.
/etc/sysconfig/network-scripts/ifcfg-0.0.0600
Changes to an ifcfg file only become effective after rebooting the system or after the dynamic addition of new network device channels by changing the system’s I/O configuration (for example, attaching under z/VM). Alternatively, you can trigger the activation of a ifcfg file for network channels which were previously not active yet, by executing the following commands:
Use the
cio_ignoreutility to remove the network channels from the list of ignored devices and make them visible to Linux:cio_ignore -r read_device_bus_id,write_device_bus_id,data_device_bus_id
# cio_ignore -r read_device_bus_id,write_device_bus_id,data_device_bus_idCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace read_device_bus_id,write_device_bus_id,data_device_bus_id with the three device bus IDs representing a network device. For example, if the read_device_bus_id is
0.0.0600, the write_device_bus_id is0.0.0601, and the data_device_bus_id is0.0.0602:cio_ignore -r 0.0.0600,0.0.0601,0.0.0602
# cio_ignore -r 0.0.0600,0.0.0601,0.0.0602Copy to Clipboard Copied! Toggle word wrap Toggle overflow To trigger the uevent that activates the change, issue:
echo add > /sys/bus/ccw/devices/read-channel/uevent
# echo add > /sys/bus/ccw/devices/read-channel/ueventCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
echo add > /sys/bus/ccw/devices/0.0.0600/uevent
# echo add > /sys/bus/ccw/devices/0.0.0600/ueventCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check the status of the network device:
lsqeth
# lsqethCopy to Clipboard Copied! Toggle word wrap Toggle overflow Now start the new interface:
ifup enc600
# ifup enc600Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check the status of the interface:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check the routing for the new interface:
ip route
# ip route default via 10.85.1.245 dev enc600 proto static metric 1024 12.34.4.95/24 dev enp0s25 proto kernel scope link src 12.34.4.201 12.38.4.128 via 12.38.19.254 dev enp0s25 proto dhcp metric 1 192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify your changes by using the
pingutility to ping the gateway or another host on the subnet of the new device:ping -c 1 192.168.70.8
# ping -c 1 192.168.70.8 PING 192.168.70.8 (192.168.70.8) 56(84) bytes of data. 64 bytes from 192.168.70.8: icmp_seq=0 ttl=63 time=8.07 msCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
If the default route information has changed, you must also update
/etc/sysconfig/networkaccordingly.
17.12. Configuring an 64-bit IBM Z network device for network root file system Copiar o linkLink copiado para a área de transferência!
To add a network device that is required to access the root file system, you only have to change the boot options. The boot options can be in a parameter file, however, the /etc/zipl.conf file no longer contains specifications of the boot records. The file that needs to be modified can be located using the following commands:
machine_id=$(cat /etc/machine-id) kernel_version=$(uname -r) ls /boot/loader/entries/$machine_id-$kernel_version.conf
# machine_id=$(cat /etc/machine-id)
# kernel_version=$(uname -r)
# ls /boot/loader/entries/$machine_id-$kernel_version.conf
Dracut, the mkinitrd successor that provides the functionality in the initramfs that in turn replaces initrd, provides a boot parameter to activate network devices on 64-bit IBM Z early in the boot process: rd.znet=.
As input, this parameter takes a comma-separated list of the NETTYPE (qeth, lcs, ctc), two (lcs, ctc) or three (qeth) device bus IDs, and optional additional parameters consisting of key-value pairs corresponding to network device sysfs attributes. This parameter configures and activates the 64-bit IBM Z network hardware. The configuration of IP addresses and other network specifics works the same as for other platforms. See the dracut documentation for more details.
The cio_ignore commands for the network channels are handled transparently on boot.
Example boot options for a root file system accessed over the network through NFS:
root=10.16.105.196:/nfs/nfs_root cio_ignore=all,!condev rd.znet=qeth,0.0.0a00,0.0.0a01,0.0.0a02,layer2=1,portno=0,portname=OSAPORT ip=10.16.105.197:10.16.105.196:10.16.111.254:255.255.248.0:nfs‑server.subdomain.domain:enc9a0:none rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us
root=10.16.105.196:/nfs/nfs_root cio_ignore=all,!condev rd.znet=qeth,0.0.0a00,0.0.0a01,0.0.0a02,layer2=1,portno=0,portname=OSAPORT ip=10.16.105.197:10.16.105.196:10.16.111.254:255.255.248.0:nfs‑server.subdomain.domain:enc9a0:none rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us