Chapter 25. Configuring an Installed Linux on System z Instance
25.1. Adding DASDs Copy linkLink copied to clipboard!
Note
CP ATTACH EB1C TO *
CP ATTACH EB1C TO *
CP LINK RHEL6X 4B2E 4B2E MR DASD 4B2E LINKED R/W
CP LINK RHEL6X 4B2E 4B2E MR
DASD 4B2E LINKED R/W
25.1.1. Dynamically Setting DASDs Online Copy linkLink copied to clipboard!
Procedure 25.1. Adding DASD Disks on IBM System z Using the VMCP Driver
- Enable the
VMCP
driver:modprobe vmcp
# modprobe vmcp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the
cio_ignore
command to remove the DASD from the list of ignored devices and make it visible to Linux:cio_ignore -r DeviceNumber
# cio_ignore -r DeviceNumbercio_ignore -r DeviceNumber
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace DeviceNumber with the device number of the DASD. For example:cio_ignore -r 0102
# cio_ignore -r 0102
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Link the disk to the virtual machine:
vmcp 'link * DeviceNumber DeviceNumber rw'
# vmcp 'link * DeviceNumber DeviceNumber rw'vmcp 'link * DeviceNumber DeviceNumber rw'vmcp 'link * DeviceNumber DeviceNumber rw'vmcp 'link * DeviceNumber DeviceNumber rw'vmcp 'link * DeviceNumber DeviceNumber rw'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace DeviceNumber with the device number of the DASD. - Set the device online. Use a command of the following form:
# chccwdev -e DeviceNumber
# # chccwdev -e DeviceNumber# chccwdev -e DeviceNumber
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace DeviceNumber with the device number of the DASD. - Verify that the disk is ready using the
lsdasd
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the above example, device 0102 (shown as0.0.0102
in theBus-ID
column) is being accessed as/dev/dasdf
.
25.1.2. Persistently setting DASDs online Copy linkLink copied to clipboard!
/
) file system. Those DASDs required for the root file system need to be activated early during the boot process by the initramfs
to be able to mount the root file system. The DASDs which are not part of the root file system can be activated later, simplifying the configuration process.
cio_ignore
) is handled transparently for persistent device configurations. You do not need to free devices from the ignore list manually.
25.1.2.1. DASDs Which Are Part of the Root File System Copy linkLink copied to clipboard!
initramfs
so that your changes will take effect after the next reboot. The following procedure explains the steps you need to take.
Procedure 25.2. Permanently Attaching DASDs as Root Devices
- Edit the
/etc/dasd.conf
configuration file using a plain text editor such as Vim, and append a line to this file with your DASD's configuration. You can use parts of the file that describe previously configured devices for reference. A valid configuration line will look similar to the following:0.0.0102 use_diag=0 readonly=0 erplog=0 failfast=0
0.0.0102 use_diag=0 readonly=0 erplog=0 failfast=0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the
/etc/zipl.conf
configuration file. An examplezipl.conf
file will look similar to the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note the multiplerd_DASD=
options on theparameters=
line. You must add the new DASD to this line, using the same syntax - therd_DASD=
keyword, followed by the device ID and a comma-separated list of options. See thedasd=
parameter description in the DASD device driver chapter in Linux on System z Device Drivers, Features, and Commands on Red Hat Enterprise Linux 6 for details. - The next step is to rebuild the
initrd
:mkinitrd -f /boot/initramfs-2.6.32-71.el6.s390x.img `uname -r`
# mkinitrd -f /boot/initramfs-2.6.32-71.el6.s390x.img `uname -r`
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Then, rebuild the boot loader configuration using the
zipl
command. You can use the-V
option for more detailed output:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
pvcreate
, vgextend
and lvextend
commands to create a physical volume for LVM, expand the existing volume group and expand the root logical volume, respectively. See Section 25.1.5, “Expanding Existing LVM Volumes to New Storage Devices” for details.
25.1.3. DASDs Which Are Not Part of the Root File System Copy linkLink copied to clipboard!
/etc/dasd.conf
. It contains one DASD per line. Each line begins with the device bus ID of a DASD. Optionally, each line can continue with options separated by space or tab characters. Options consist of key-value-pairs, where the key and value are separated by an equals sign.
sysfs
attribute a DASD may have. The value will be written to the key's sysfs
attribute. Entries in /etc/dasd.conf
are activated and configured by udev when a DASD is added to the system. At boot time, all DASDs visible to the system get added and trigger udev.
/etc/dasd.conf
:
0.0.0207 0.0.0200 use_diag=1 readonly=1
0.0.0207
0.0.0200 use_diag=1 readonly=1
/etc/dasd.conf
only become effective after a reboot of the system or after the dynamic addition of a new DASD by changing the system's I/O configuration (that is, the DASD is attached under z/VM). Alternatively, you can trigger the activation of a new entry in /etc/dasd.conf
for a DASD which was previously not active, by executing the following commands:
Procedure 25.3. Permanently Attaching DASDs as Non-root Devices
- Trigger the activation by writing to the
uevent
attribute of the device:echo add > /sys/bus/ccw/devices/device.bus,ID/uevent
echo add > /sys/bus/ccw/devices/device.bus,ID/ueventecho add > /sys/bus/ccw/devices/device.bus,ID/ueventecho add > /sys/bus/ccw/devices/device.bus,ID/uevent
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:echo add > /sys/bus/ccw/devices/0.0.021a/uevent
echo add > /sys/bus/ccw/devices/0.0.021a/uevent
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
25.1.4. Preparing a New DASD with Low-level Formatting Copy linkLink copied to clipboard!
Warning
Procedure 25.4. Formatting a DASD
- Wipe all existing data on the DASD using the
dasdfmt
command. Replace DeviceNumber with the device number of the DASD. When prompted for confirmation (as shown in the example below), typeyes
to proceed.Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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...
Copy to Clipboard Copied! Toggle word wrap Toggle overflow See thedasdfmt(8)
man page for information about the syntax of thedasdfmt
command. - Use the
fdasd
command to write a new Linux-compatible partition table to the DASD. Replace DeviceNumber with the device number of the DASD.Copy to Clipboard Copied! Toggle word wrap Toggle overflow This example uses the-a
option to create a single partition spanning the entire disk. Other layouts are possible; up to three partitions can be created on a single DASD. For information about the syntax of thefdasd
command and available options, see thefdasd(8)
man page. - Create a new partition with
fdisk
. Replace DeviceName with the device name of the DASD.fdisk /dev/DeviceName
# fdisk /dev/DeviceNamefdisk /dev/DeviceName
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After you executefdisk
, a series of prompts will appear in your terminal. These prompts can be used to manipulate the disk partition table, creating new partitions or editing existing one. For information about usingfdisk
, see thefdisk(8)
man page.
/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.
Note
/etc/fstab
, use the persistent device symbolic links under /dev/disk/by-path/
.
25.1.5. Expanding Existing LVM Volumes to New Storage Devices Copy linkLink copied to clipboard!
Procedure 25.5. Expanding Existing Logical Volume to Use a New DASD
- Create a new physical volume for LVM on the DASD using the
pvcreate
command:pvcreate /dev/DeviceName
# pvcreate /dev/DeviceNamepvcreate /dev/DeviceName
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Important
The device name must be specified as a partition - for example,/dev/dasdf1
. Do not specify the entire block device. - List existing physical volumes using the
pvs
command to verify that the physical volume has been created:Copy to Clipboard Copied! Toggle word wrap Toggle overflow As you can see in the above example,/dev/dasdf1
now contains an empty physical volume which is not assigned to any volume group. - Use the
vgextend
command to expand an existing volume group containing the volume you want to use the new DASD for:vgextend VolumeGroup PhysicalVolume
# vgextend VolumeGroup PhysicalVolumevgextend VolumeGroup PhysicalVolumevgextend VolumeGroup PhysicalVolumevgextend VolumeGroup PhysicalVolume
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace VolumeGroup with the name of the volume group you are expanding, and PhysicalVolume with the name of the physical volume (for example,/dev/dasdf1
). - Use the
lvextend
command to expand a logical volume you want to use the new DASD for:lvextend -L +Size /dev/mapper/VolumeGroup-LogicalVolume
# lvextend -L +Size /dev/mapper/VolumeGroup-LogicalVolumelvextend -L +Size /dev/mapper/VolumeGroup-LogicalVolumelvextend -L +Size /dev/mapper/VolumeGroup-LogicalVolumelvextend -L +Size /dev/mapper/VolumeGroup-LogicalVolumelvextend -L +Size /dev/mapper/VolumeGroup-LogicalVolumelvextend -L +Size /dev/mapper/VolumeGroup-LogicalVolume
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:lvextend -L +2G /dev/mapper/vg_local-lv_root
# lvextend -L +2G /dev/mapper/vg_local-lv_root Extending logical volume lv_root to 2,58 GiB Logical volume lv_root successfully resized
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
pvs
, vgs
, and lvs
commands as root
to view existing LVM physical volumes, volume groups and logical volumes at any point during the procedure.