Chapter 25. Configuring an Installed Linux on System z Instance
25.1. Adding DASDs
Note
CP ATTACH EB1C TO *
CP LINK RHEL6X 4B2E 4B2E MR
DASD 4B2E LINKED R/W
25.1.1. Dynamically Setting DASDs Online
Procedure 25.1. Adding DASD Disks on IBM System z Using the VMCP Driver
- Enable the
VMCP
driver:#
modprobe vmcp
- 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
Replace DeviceNumber with the device number of the DASD. For example:#
cio_ignore -r 0102
- Link the disk to the virtual machine:
#
vmcp 'link * DeviceNumber DeviceNumber rw'
Replace DeviceNumber with the device number of the DASD. - Set the device online. Use a command of the following form:
#
# chccwdev -e DeviceNumber
Replace DeviceNumber with the device number of the DASD. - Verify that the disk is ready using the
lsdasd
command:#
lsdasd
Bus-ID Status Name Device Type BlkSz Size Blocks ============================================================================== 0.0.0100 active dasda 94:0 ECKD 4096 2347MB 600840 0.0.0301 active dasdb 94:4 FBA 512 512MB 1048576 0.0.0300 active dasdc 94:8 FBA 512 256MB 524288 0.0.0101 active dasdd 94:12 ECKD 4096 2347MB 600840 0.0.0200 active dasde 94:16 ECKD 4096 781MB 200160 0.0.0102 active dasdf 94:20 ECKD 4096 2347MB 600840In 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
/
) 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
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
- Edit the
/etc/zipl.conf
configuration file. An examplezipl.conf
file will look similar to the following:[defaultboot] default=linux target=/boot/ [linux] image=/boot/vmlinuz-2.6.32-19.el6.s390x ramdisk=/boot/initramfs-2.6.32-19.el6.s390x.img parameters="root=/dev/mapper/vg_devel1-lv_root rd_DASD=0.0.0200,use_diag=0,readonly=0,erplog=0,failfast=0 rd_DASD=0.0.0207,use_diag=0,readonly=0,erplog=0,failfast=0 rd_LVM_LV=vg_devel1/lv_root rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us cio_ignore=all,!0.0.0009"
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`
- Then, rebuild the boot loader configuration using the
zipl
command. You can use the-V
option for more detailed output:#
zipl -V
Using config file '/etc/zipl.conf' Target device information Device..........................: 5e:00 Partition.......................: 5e:01 Device name.....................: dasda DASD device number..............: 0201 Type............................: disk partition Disk layout.....................: ECKD/compatible disk layout Geometry - heads................: 15 Geometry - sectors..............: 12 Geometry - cylinders............: 3308 Geometry - start................: 24 File system block size..........: 4096 Physical block size.............: 4096 Device size in physical blocks..: 595416 Building bootmap in '/boot/' Building menu 'rh-automatic-menu' Adding #1: IPL section 'linux' (default) kernel image......: /boot/vmlinuz-2.6.32-19.el6.s390x kernel parmline...: 'root=/dev/mapper/vg_devel1-lv_root rd_DASD=0.0.0200,use_diag=0,readonly=0,erplog=0,failfast=0 rd_DASD=0.0.0207,use_diag=0,readonly=0,erplog=0,failfast=0 rd_LVM_LV=vg_devel1/lv_root rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us cio_ignore=all,!0.0.0009' initial ramdisk...: /boot/initramfs-2.6.32-19.el6.s390x.img component address: kernel image....: 0x00010000-0x00a70fff parmline........: 0x00001000-0x00001fff initial ramdisk.: 0x02000000-0x022d2fff internal loader.: 0x0000a000-0x0000afff Preparing boot device: dasda (0201). Preparing boot menu Interactive prompt......: enabled Menu timeout............: 15 seconds Default configuration...: 'linux' Syncing disks... Done.
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
/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
/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
For example:echo add > /sys/bus/ccw/devices/0.0.021a/uevent
25.1.4. Preparing a New DASD with Low-level Formatting
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.#
dasdfmt -b 4096 -d cdl -p /dev/disk/by-path/ccw-0.0.DeviceNumber
Drive Geometry: 10017 Cylinders * 15 Heads = 150255 Tracks I am going to format the device /dev/disk/by-path/ccw-0.0.0102 in the following way: Device number of device : 0x4b2e Labelling device : yes Disk label : VOL1 Disk identifier : 0X0102 Extent start (trk no) : 0 Extent end (trk no) : 150254 Compatible Disk Layout : yes Blocksize : 4096 --->> ATTENTION! <<--- All data of that device will be lost. Type "yes" to continue, no will leave the disk untouched: yes cyl 97 of 3338 |#----------------------------------------------| 2%When the progress bar reaches the end and the format is complete,dasdfmt
prints the following output:Rereading the partition table... Exiting...
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.#
fdasd -a /dev/disk/by-path/ccw-DeviceNumber
auto-creating one partition for the whole disk... writing volume label... writing VTOC... checking ! wrote NATIVE! rereading partition table...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
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
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
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:#
pvs
PV VG Fmt Attr PSize PFree /dev/dasda2 vg_local lvm2 a-- 1,29g 0 /dev/dasdd1 vg_local lvm2 a-- 2,29g 0 /dev/dasdf1 lvm2 a-- 2,29g 2,29g /dev/mapper/mpathb vgextnotshared lvm2 a-- 200,00g 1020,00mAs 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
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
For example:#
lvextend -L +2G /dev/mapper/vg_local-lv_root
Extending logical volume lv_root to 2,58 GiB Logical volume lv_root successfully resized
pvs
, vgs
, and lvs
commands as root
to view existing LVM physical volumes, volume groups and logical volumes at any point during the procedure.