The following are notes on using LVM2:
-
If a logical volume on an HDLM device (LVM2) is used as the boot disk, a SCSI device cannot be used as an LVM2 physical volume.
To use a SCSI device and an HDLM device concurrently as LVM2 physical volumes, edit the /etc/lvm/lvm.conf file so that SCSI devices, which are managed by HDLM, are not recognized by LVM2.
When using an NVMe device, it is not necessary to prevent LVM2 from recognizing it, because it is not a SCSI device.
If you are using Red Hat Enterprise Linux 8 or 9, Oracle Linux 8 or 9, Oracle Unbreakable Enterprise Kernel 8 or SUSE LINUX Enterprise Server 15 SP2 or later, specify global_filter.
If you want to use use_lvmetad=0 for operation in SUSE LINUX Enterprise Server 12, SUSE LINUX Enterprise Server 15 SP1 or earlier, Red Hat Enterprise Linux 7 or Oracle Linux 7, specify filter, not global_filter. Also, for OSs other than SUSE LINUX Enterprise Server 12, SUSE LINUX Enterprise Server 15 SP1 or earlier, Red Hat Enterprise Linux 7, 8, and 9, Oracle Linux 7, 8 and 9, and Oracle Unbreakable Enterprise Kernel 8, if you want to use use_lvmetad=1 for operation in an LVM2 version that can use global_filter, specify global_filter, not filter.
The following shows an example of settings when the SCSI device (/dev/sda) and the HDLM device are used together as the physical volume for LVM2.
-
SUSE LINUX Enterprise Server 15 SP5 or later, Red Hat Enterprise Linux 9, or Oracle Linux 9:
Specify a permanent name, so that the order of the disks that can be viewed from LVM does not change even if the order of the disks recognized by the OS changes.
global_filter = [ "a|sddlm[a-p][a-p].*|","a|/dev/disk/by-id/scsi-3600605b005d7a320196f1f53484dfb20|","r|/dev/sd|" ]Use the udevadm command to check the value to be specified.
# udevadm info -q symlink -n /dev/sda disk/by-id/scsi-3600605b005d7a320196f1f53484dfb20 disk/bypath/information-generated-based-on-the-disk-location disk/by-uuid/information-specific-to-the-disk disk/by-id/wwn-information-specific-to-the-disk
Add /dev/ to the output result, and then specify the value in the format /dev/disk/by-id/scsi-3600605b005d7a320196f1f53484dfb20.
-
SUSE LINUX Enterprise Server 12, SUSE LINUX Enterprise Server 15 to SUSE LINUX Enterprise Server 15 SP3, Red Hat Enterprise Linux 7 or 8, Oracle Linux 7, Oracle Unbreakable Enterprise Kernel 7, Oracle Linux 8 or Oracle Unbreakable Enterprise Kernel 8:
Specify a permanent name, so that the order of the disks that can be viewed from LVM does not change even if the order of the disks recognized by the OS changes.
global_filter = [ "a|sddlm[a-p][a-p].*|","a|scsi-3600605b005d7a320196f1f53484dfb20|","r|/dev/sd|" ]Use the udevadm command to check the value to be specified.
# udevadm info -q symlink -n /dev/sda block/8:0 disk/by-id/scsi-3600605b005d7a320196f1f53484dfb20 disk/by-path/information-generated-based-on-the-disk-location disk/by-uuid/information-specific-to-the-disk disk/by-id/wwn-information-specific-to-the-disk
Output scsi-3600605b005d7a320196f1f53484dfb20 is sda and a supporting by-id name.
-
For OSs other than the above:
The following shows an example of settings when the SCSI device (/dev/sda) and the HDLM device are used together as the physical volume for LVM2.
filter = [ "a|sddlm[a-p][a-p].*|", "a|/dev/sda[1-9].*|", "r|/dev/sd|" ]
In the above filter line, the underlined portion enables LVM2 to recognize SCSI devices.
In this example, the following filter line is used in the /etc/lvm/lvm.conf file so that LVM2 does not recognize SCSI devices:
global_filter = [ "a|sddlm[a-p][a-p].*|", "r|/dev/sd|" ]
-
-
If one of the following OSs is used, in the device section of the /etc/lvm/lvm.conf file, specify 1 for allow_changes_with_duplicate_pvs.
If allow_changes_with_duplicate_pvs is not in the file, add the line allow_changes_with_duplicate_pvs=1.
-
Red Hat Enterprise Linux 7.3 or later
-
Red Hat Enterprise Linux 8 or later
-
Red Hat Enterprise Linux 9 or later
-
Oracle Linux 7.3 (Oracle Unbreakable Enterprise Kernel 7.3) or later
-
Oracle Linux 8 (Oracle Unbreakable Enterprise Kernel 8) or later
-
Oracle Linux 9 or later
-
SUSE LINUX Enterprise Server 12 SP4 (4.12.14-94.41 Kernel) or later
-
SUSE LINUX Enterprise Server 15 or later
If the value is changed to 0, duplicate physical volumes will be detected during the boot processing in a SAN boot configuration, and the volume groups will not be activated. As a result, the startup processing in the SAN boot configuration will fail.
-
-
LVM cache files cannot be used. For an OS other than Red Hat Enterprise Linux 8 or 9, Oracle Linux 8 or 9, Oracle Unbreakable Enterprise Kernel 8 or SUSE LINUX Enterprise Server 15 SP2 or later, disable the LVM cache by performing the operation described below. For Red Hat Enterprise Linux 8 or 9, Oracle Linux 8 or 9, Oracle Unbreakable Enterprise Kernel 8 or SUSE LINUX Enterprise Server 15 SP2 or later, the following operation is unnecessary because neither write_cache_state or the LVM cache files exist.
-
Specify 0 for write_cache_state in the /etc/lvm/lvm.conf file.
-
Execute the VG scan.
After editing the file, execute the following command.
# /sbin/vgscan
-
Delete the LVM cache files.
If the following files exist, delete them:
-
/etc/lvm/.cache
-
/etc/lvm/cache/.cache
-
-
Re-create the initial RAM disk image file.
- If you are using the HDLM device as a boot disk
-
Perform step 9 of SETTINGS_FOR_A_MULTIPATH_BOOT_DISK_ENVIRONMENT=GUID-D1139199-D2D6-4E66-80E8-F96431212132=5=EN=.html.
- If you are not using the HDLM device as a boot disk
-
Create an initial RAM disk image file for HDLM.
The format of the initial RAM disk image file name to be specified in the parameter is shown below. If a file having the same name as the initial RAM disk image file to be created already exists, back up the existing file under a different name.
Table. Names of initial RAM disk image files OS
File name
Red Hat Enterprise Linux 7, 8, 9
Oracle Linux 7, 8, 9
initramfs-{kernel-version#}.img
SUSE LINUX Enterprise Server 12, 15
initrd-{kernel-version#}
-
Restart the host.
# shutdown -r now
-
Execute the following command to check whether LVM cache files exist:
# ls /etc/lvm/.cache # ls /etc/lvm/cache/.cache
If LVM cache files exist, go to step 7. If they do not exist, this is the end of the procedure.
-
Perform the confirmation procedure described in CONFIRMING_THAT_THE_LOGICAL_VOLUME_IS_IN_A_MULTI-PATH_CONFIGURATION=GUID-154677B3-273B-40F8-A0AF-4351382F45F9=2=EN=.html.
-
Deactivate volume groups that include logical volumes that are not in a multi-path configuration.
The following is an example of the command executed when the logical volume to be migrated belongs to volume group vg01:
# vgchange -an vg01
-
Activate the volume group.
The following is an example of the command executed when the logical volume to be migrated belongs to volume group vg01:
# vgchange -ay vg01
-
-
Starting from version lvm2-2.03.14-6.el8.x86_64, the default action of multipath_component_detection in /etc/lvm/lvm.conf has been changed. For this reason, when using version lvm2-2.03.14-6.el8.x86_64 or a later version of LVM, you need to set multipath_component_detection = 0 to disable it. If multipath_component_detection is enabled, multipath devices are excluded by LVM in the boot processing of a SAN boot configuration and will not be recognized, resulting in startup failure. For the following OSs, the default version of LVM is lvm2-2.03.14-6.el8.x86_64 or later, so be sure to set multipath_component_detection = 0.
-
Red Hat Enterprise Linux 8.8 or later
-
Oracle Linux 8.8 or later
-
Red Hat Enterprise Linux 9 or later
-
Oracle Linux 9 or later
-
SUSE LINUX Enterprise Server 15 SP5 or later
However, for SUSE LINUX Enterprise Server 15 SP5, multipath_component_detection might not work.
Meet the condition of applying the package in BOOT_PREPARATIONS_FOR_AN_UPGRADE_INSTALLATION_OR_RE-INSTALLATION_OF_=GUID-0763284A-10CB-4259-A3B5-0F3DCAE0368E=4=EN=.html.
-
-
For Red Hat Enterprise Linux 9.1 or later, set use_devicesfile=0 in /etc/lvm/lvm.conf to disable system.devices. system.devices is specified by using device names, and devices are ultimately determined based on UUID, so you cannot distinguish between HDLM devices and SCSI devices on LVM. For this reason, to continue using HDLM devices with LVM, you need to disable system.devices.