Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

20.2.2. 永久激活 FCP LUN

以上说明描述了如何在运行的系统中动态激活 FCP LUN。但是这种更改不具有持久性,重启后无法保留。您如何在 Linux 系统中永久保留对 FCP 配置的更改取决于 FCP LUN 是否属于根文件系统。需要在 initramfs 启动过程中尽早激活 root 文件系统所需的那些文件系统,才能挂载根文件系统。对于持久性设备配置,会以透明的方式处理 The cio_ignore 命令,您不需要从忽略列表中手动释放设备。

20.2.2.1. FCP LUN 是根文件系统的一部分

要修改以添加作为 root 文件系统一部分的 FCP LUN 的唯一文件是 /etc/zipl.conf,然后运行 zipl 引导装载程序工具。不再需要重新创建 initramfs
Red Hat Enterprise Linuxnbsp;Hat Enterprise Linuxnbsp;Linux 提供了在引导过程早期激活 FCP LUN 的参数: rd.zfcp=。该值是一个用逗号分开的设备总线 ID 列表,前缀为 0x 的 16 位十六进制 WWPN,以及前缀为 0x 的 FCP LUN 16 位十六进制数字(需要时在右面使用 0 填充)。
以下示例 zipl.conf 适用于将两个 FCP LUN 分区中的物理卷用于 LVM 卷组 vg_devel1,其中包含逻辑卷 lv_root 作为 root 文件系统。为方便起见,该示例显示没有多路径的配置。
[defaultboot]
default=linux
target=/boot/

[linux]
image=/boot/vmlinuz-2.6.32-19.el7.s390x
ramdisk=/boot/initramfs-2.6.32-19.el7.s390x.img
parameters="root=/dev/mapper/vg_devel1-lv_root
rd.zfcp=0.0.fc00,0x5105074308c212e9,0x401040a000000000
rd.zfcp=0.0.fc00,0x5105074308c212e9,0x401040a100000000
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,!condev"
要在第三个 FCP LUN 的分区中添加另一个物理卷,使用设备总线 ID 0.0.fc00,WWPN 0x5105074308c212e9 和 FCP LUN 0x401040a300000000,将 rd.zfcp=0.0.fc00,0x5105074308c212e9,0x401040a300000000 添加到 ziplconf 中引导内核的参数行。例如:
[defaultboot]
default=linux
target=/boot/

[linux]
image=/boot/vmlinuz-2.6.32-19.el7.s390x
ramdisk=/boot/initramfs-2.6.32-19.el7.s390x.img
parameters="root=/dev/mapper/vg_devel1-lv_root
rd.zfcp=0.0.fc00,0x5105074308c212e9,0x401040a000000000
rd.zfcp=0.0.fc00,0x5105074308c212e9,0x401040a100000000
rd.zfcp=0.0.fc00,0x5105074308c212e9,0x401040a300000000
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,!condev"
警告
确保 /etc/zipl.conf 中的内核命令行长度不超过 896 个字节。否则引导装载程序无法被保存,安装将失败。
运行 zipl 以对下一个 IPL 应用 /etc/zipl.conf 的更改:
# zipl -V
Using config file '/etc/zipl.conf'
Target device information
Device..........................: 08:00
Partition.......................: 08:01
Device name.....................: sda
Device driver name..............: sd
Type............................: disk partition
Disk layout.....................: SCSI disk layout
Geometry - start................: 2048
File system block size..........: 4096
Physical block size.............: 512
Device size in physical blocks..: 10074112
Building bootmap in '/boot/'
Building menu 'rh-automatic-menu'
Adding #1: IPL section 'linux' (default)
kernel image......: /boot/vmlinuz-2.6.32-19.el7.s390x
kernel parmline...: 'root=/dev/mapper/vg_devel1-lv_root rd.zfcp=0.0.fc00,0x5105074308c212e9,0x401040a000000000 rd.zfcp=0.0.fc00,0x5105074308c212e9,0x401040a100000000 rd.zfcp=0.0.fc00,0x5105074308c212e9,0x401040a300000000 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,!condev'
initial ramdisk...: /boot/initramfs-2.6.32-19.el7.s390x.img
component address:
kernel image....: 0x00010000-0x007a21ff
parmline........: 0x00001000-0x000011ff
initial ramdisk.: 0x02000000-0x028f63ff
internal loader.: 0x0000a000-0x0000a3ff
Preparing boot device: sda.
Detected SCSI PCBIOS disk layout.
Writing SCSI master boot record.
Syncing disks...
Done.