Preventing excessive kernel parameters during installation

Red Hat Enterprise Linux 9.2 LPAR mode z/VM guest

The Red Hat® Enterprise Linux® installation program automatically generates one rd.zfcp boot parameter for each FC-attached SCSI disk that is a dependency required to mount the root file system that it finds. This automation can lead to the kernel command-line parameters exceeding the limit of 4096 characters.

About this task

For your Linux installation, you use kernel parameters in a kernel parameter file. For more details, see Kernel parameters. The combined parameter string must not exceed 4096 characters.

The same limit applies to the parameters that are generated for the installed system. These parameters include some parameters inherited from the parameter file used during installation. However, it also includes parameters generated during installation, such as rd.zfcp.

If your SAN is set up for extensive path redundancy to dependencies required to mount the root file system, or if the block device dependencies of your root file system require multiple volumes, for example, if you are using LVM, many rd.zfcp parameters might be generated.

The parameters for the installed system might then exceed the limit. During installation, the writing of the boot record with zipl, and thus the installation, would then fail and could not be booted.

To reduce the number of discoverable paths, only specify a small number of paths and temporarily add the zfcp module parameter zfcp.allow_lun_scan=0 to the parameter file used during installation. After installation, remove the workaround from the installed system.

Procedure

  1. Ascertain the need for the workaround.
    Each fully qualified rd.zfcp parameter consists of 55 bytes including a separating space.

    Assuming there might be 73 redundant paths to the dependencies of the root file system discoverable in your SAN. If so, you would need to multiply the number of paths with 55, here 73*55=4015. The resulting boot configuration might contain well over 4100 bytes and thus be over the limit of 4096 bytes.

    Likewise, if your system configuration and installer choices cause the installer to generate other large parameters, plus the generated rd.zfcp parameters, the parameters generated for the installed system (see the example parameters in Step 3) might exceed 4096 bytes. If you have enough space within the size limit for at least two redundant paths with rd.zfcp, the workaround can help to keep the parameters generated for the installed system small.

    If your system configuration and installer choices cause the installer to generate boot parameters less than or equal to 4096 bytes, you do not need this workaround. For instance, with four or potentially eight paths for the root file system dependencies you might be below the size limit.

  2. Temporarily add the zfcp.allow_lun_scan=0 parameter. You need an extra 22 bytes for the parameter.
    For the installation, specify the smallest number of paths that captures a maximum of path redundancy. To specify paths during installation, use the anaconda GUI, the kickstart parameter zfcp, or the dracut boot parameter rd.zfcp in the kernel parameters for an installation. See also Manually configured FCP LUNs and their SCSI devices.
    The following example kernel parameters for an installation includes the workaround:
    ro ramdisk_size=40000 cio_ignore=all,!condev
    rd.znet=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1
    ip=172.18.182.2::172.18.0.1:15:hostname:enc600:none
    nameserver=172.18.0.1
    inst.repo=http://server.company.com/install/RHEL/DVD
    inst.vnc inst.vncpassword=secret inst.sshd
    zfcp.allow_lun_scan=0
    
    Subsequently, assume that the following four paths are specified during installation:
    0.0.1900,0x5005076009009000,0x4078408800000000
    0.0.1940,0x5005076009049000,0x4078408800000000
    0.0.1980,0x5005076009045000,0x4078408800000000
    0.0.19c0,0x5005076009005000,0x4078408800000000
  3. Install Linux.
    An example kernel parameter line of an installed system could look like this:
    root=/dev/mapper/rhel_hostname-root
    crashkernel=256M
    rd.zfcp=0.0.1900,0x5005076009009000,0x4078408800000000
    rd.zfcp=0.0.1940,0x5005076009049000,0x4078408800000000
    rd.zfcp=0.0.1980,0x5005076009045000,0x4078408800000000
    rd.zfcp=0.0.19c0,0x5005076009005000,0x4078408800000000
    rd.lvm.lv=rhel_hostname/root rd.lvm.lv=rhel_hostname/swap
    cio_ignore=all,!condev
    rd.znet=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1
    The size of the example is 425 bytes. Again, if there were 73 redundant paths to the dependencies of the root file system discoverable in your SAN, these kernel parameters would be 425+73*55=4440 bytes, and over the limit.
  4. Remove the workaround.
    1. Configure the FCP devices persistently. On DPM, this is done automatically for you.
      Add all discoverable paths for the dependencies of the root file system to the persistent device configuration in /etc/zfcp.conf.

      This ensures that all FCP devices for the root file system are set online during boot, not just those defined by the reduced rd.zfcp statements in the boot configuration.

      To activate the paths added to /etc/zfcp.conf run this command:
      # zfcp_cio_free && zfcpconf.sh
    2. Enable zfcp automatic LUN scanning for the current system configuration without having to reboot.
      Issue this command:
      # echo 1 > /sys/module/zfcp/parameters/allow_lun_scan

      For more information about module parameters in general, see Displaying information about module parameters, and about zfcp parameters, see Setting up the zfcp device driver.

    3. Perform an automatic LUN scan once to add all paths defined in the SAN setup to the currently running system without a reboot.
      Issue the following command:
      # for d in /sys/bus/ccw/drivers/zfcp/*/host*/scsi_host/host*/scan; do echo '- - -' > $d; done
      For details about triggering a LUN scan, see Triggering a LUN scan.
    4. Remove zfcp.allow_lun_scan=0 from the files /boot/loader/entries/*.conf with the command:
      # grubby --update-kernel=ALL --remove-args="zfcp.allow_lun_scan=0"

      This configuration is persistent across reboots.

      For information about using the grubby command to make changes to all kernel command-line parameters for all boot entries, see the chapter about "Configuring kernel command-line parameters" in the Red Hat Enterprise Linux 8 System Design Guide.

    5. Re-create the initial ram disk.
      Issue this command:
      # dracut -f
    6. Rewrite the boot record by issuing the command:
      # zipl