This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
linux:linux_lvm [2023/07/04 14:42] manu |
linux:linux_lvm [2025/05/21 11:55] (current) manu [LVM import same VGname] |
||
---|---|---|---|
Line 8: | Line 8: | ||
http://www.voleg.info/linux-mirror-system-disk.html | http://www.voleg.info/linux-mirror-system-disk.html | ||
+ | |||
+ | ===== Disk cloning RHEL9 ===== | ||
+ | |||
+ | For RHEL9 and higher | ||
+ | |||
+ | After booting on a clone, the server will start in single mode user. No pv or vg is visible | ||
+ | |||
+ | You have to update the file /etc/lvm/devices/system.devices to match the disk WWN | ||
+ | <cli prompt='#'> | ||
+ | [root@rhtest ~]# multipath -ll | ||
+ | mpatha (36005076xxxxxxxxxxx000000000017b9) dm-0 IBM,2145 | ||
+ | size=60G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw | ||
+ | </cli> | ||
+ | |||
+ | <cli prompt='#'> | ||
+ | [root@rhtest ~]# cat /etc/lvm/devices/system.devices | ||
+ | # LVM uses devices listed in this file. | ||
+ | # Created by LVM command vgimportdevices pid 65293 at Wed May 21 10:23:35 2025 | ||
+ | HOSTNAME=rhtest | ||
+ | VERSION=1.1.10 | ||
+ | IDTYPE=mpath_uuid IDNAME=part3-mpath-36005076xxxxxxxxxxx00000000001616 DEVNAME=/dev/mapper/mpatha3 PVID=JzZ6Nf4VUZFbBcNle1TX9miPydVISnYT | ||
+ | </cli> | ||
+ | |||
+ | Also update the multipathing binding if you want to change order | ||
+ | <cli prompt='#'> | ||
+ | [root@rhtest ~]# cat /etc/multipath/bindings | ||
+ | # Multipath bindings, Version : 1.0 | ||
+ | # NOTE: this file is automatically maintained by the multipath program. | ||
+ | # You should not need to edit this file in normal circumstances. | ||
+ | # | ||
+ | # Format: | ||
+ | # alias wwid | ||
+ | # | ||
+ | mpatha 36005076xxxxxxxxxxx00000000001616 | ||
+ | mpathb 36005076xxxxxxxxxxx000000000017b9 | ||
+ | </cli> | ||
+ | |||
+ | After updating all files, import VG devices. | ||
+ | * to import all pv, vg (will only add the multipath map): vgimportdevices -a | ||
+ | * If only some of the disks contain PV’s (for each to be used device) to be used by this system run: lvmdevices --adddev [device name] | ||
+ | For example: lvmdevices --adddev /dev/mapper/mpathc | ||
+ | |||
+ | |||
+ | |||
+ | Now reboot. Everything is OK | ||
+ | |||
+ | * By default in a newly installed RHEL9 system LVM2 will use the /etc/lvm/devices/system.devices file to identify which disks are PV’s for this install. The /etc/lvm/lvm.conf filters are ignored. As the imported PV’s are not in this file LVM will not work with them. | ||
+ | |||
+ | * If a RHEL8 system is upgraded to RHEL9 the /etc/lvm/devices/system.devices file does not exists LVM will run as if use_devicesfile = 0 is set and use the /etc/lvm/lvm.conf filters. | ||
+ | |||
+ | * If the /etc/lvm/lvm.conf use_devicesfile parameter is set to 0. The /etc/lvm/devices/system.devices will not be used and the /etc/lvm/lvm.conf filters are used. | ||
+ | |||
===== LVM import same VGname ===== | ===== LVM import same VGname ===== |