LVMPERSIST(8) (NAME) lvmpersist - (PR) (SYNOPSIS) lvmpersist [] ... (DESCRIPTION) lvmpersist SCSI (Persistent Reservations) (SAN) . (PR) . SAN . LVM ( VG) PR LVM PR VG PR (PV) VG . ( PV VG PR .) lvmpersist PR . LVM PR LVM : vgchange --setpersist, vgchange --persist lvmpersist LVM . sg_persist mpathpersist nvme PR . LVM ( vgchange) lvmpersist . (Device types) SCSI SCSI ( iSCSI SAS Fibre Channel) dm-multipath NVME . PR SCSI (SPC-3) . (multipath) multipath.conf "reservation_key file" . ( mpathconf --option reservation_key:file multipathd .) (Persistent reservation types) LVM PR "Write Exclusive" ( WE) VG "Write Exclusive - all registrants" ( WEAR) VG . dm-multipath VG WEAR ( .) lvmpersist PR : --access ex|sh ( VG ) "ex" () . ( VG ) "sh" () . lvmpersist PR ( WE "ex" WEAR "sh".) --prtype PRTYPE PRTYPE lvmpersist . PR : WE Write Exclusive ( ) EA Exclusive Access ( ) WERO Write Exclusive - registrants only ( - ) EARO Exclusive Access - registrants only ( - ) WEAR Write Exclusive - all registrants ( - ) EAAR Exclusive Access - all registrants ( - ) ( WERO EARO .) (Persistent reservation keys) PR "0x" . 0x1234abcd 0x000000001234abcd. ( 0x) . PR . PR /etc/lvm/lvmlocal.conf ( .) (USAGE) PR: PR ( PR ): lvmpersist start|stop|remove|clear|read [OPTIONS] DEST PR VG ( VG): vgchange --setpersist y|n VG PR VG ( PR ): vgchange --persist start|stop|remove|clear|read|check VG lvmpersist (lvmpersist commands) lvmpersist start --ourkey KEY DEST "start" . . --access --prtype "ex" . lvmpersist stop --ourkey KEY DEST "stop" . lvmpersist remove --ourkey KEY --removekey REMKEY DEST "remove" . . ( VG .) lvmpersist start --ourkey KEY --removekey REMKEY DEST "start" removekey ( preempt-abort). . ( VG .) lvmpersist clear --ourkey KEY DEST "clear" . lvmpersist devtest|read|read-keys|read-reservation DEST PR PR . lvmpersist check-key --key KEY DEST . (OPTIONS) --ourkey KEY PR 0x123abc --removekey REMKEY PR . --key KEY . --access ex|sh PR (exclusive) (shared) . --prtype PRTYPE ( --access). --ptpl (persist through power loss) (). (DEST) --device PATH ... . --vg VGNAME VG ( PV VG). --vg VGNAME --device PATH ... VG . lvmpersist --device /dev/name VG --vg VGNAME . VG lvmpersist PR PV VG . VG --vg VG . lvmpersist LVM --device VG --vg . VG (VG metadata commands) vgchange --setpersist PR VG . VG . vgchange --setpersist y|n VG PR VG "autostart" "require" PR ( ). vgchange --setpersist autostart|noautostart|require|norequire VG autostart require. "autostart" (vgchange -aay vgchange --lockstart --lockopt auto) PR VG . PR . "require" lvm VG PR . vgs -o persist VG . PR VG (VG PR commands) vgchange --persist PR VG . vgchange --persist start VG PR VG. . vgchange --persist stop VG PR VG. . vgchange --persist remove --removekey remkey VG PR VG . ( VG .) vgchange --persist start --removekey remkey VG PR VG VG . ( VG .) vgchange --persist check VG PR ( ). PR VG . vgchange --persist read VG PR VG. vgchange --persist clear VG PR VG. vgchange --persist autostart VG PR VG autostart . autoactivation auto-lockstart . PR (Supplementary PR start) --persist start PR ( autostart). vgchange -ay --persist start vgchange -aay --persist start vgchange --lockstart --persist start vgchange --setpersist y|require|autostart --persist start vgimport --persist start vgchange --systemid --persist start VG (Local VG usage) VG WE ( ) . PR VG VG . VG (system ID) VG LVM . VG : vgchange --persist start --removekey remkey VG "remkey" PR . VG (Shared VG usage) VG VG vgchange --setpersist PR VG . vgchange --setpersist VG (VG locking) . vgchange --persist // PR . VG PR PR ( lvmpersist). VG VG start WEAR ( - ) . PR (vgchange --persist start vgchange --lockstart vgchange --persist start --lockstart). VG vgchange --persist remove --removekey remkey "remkey" PR . (Local Settings) PR PR VG . /etc/lvm/lvmlocal.conf : local/pr_key . ( ) 0x . pr_key VG . PR host_id pr_key . local/host_id VG sanlock . sanlock_align_size host_id . PR VG sanlock host_id (generation number) sanlock . host_id PR local/pr_key . VG VG dlm host_id : 0x100000000000XXXX XXXX host_id . VG sanlock host_id ( sanlock) : 0x100000YYYYYYXXXX XXXX host_id YYYYYY . sanlock VG . PR lockstart ( lockstart ). vgcreate PR VG : vgcreate --setpersist y VG PVs VG --persist start PR VG . VG --setpersist . PR VG --persist start. PR ( WE) VG . VG . PR PR ( WEAR) VG . (lockspace) . vgextend VG vgextend VG PR ( require autostart ). VG vgextend lvmpersist PR . vgextend . vgremove vgremove PR VG "require" "autostart" vgchange --setpersist . PR setpersist vgremove PR . vgexport/vgimport vgexport --persist stop PR (export) vgimport --persist start PR (import) . VG PR VG PR . vgchange --systemid PR VG PR VG ( lvmsystemid(7) .) vgchange --systemid local_system_id --persist start VG VG (foreign) . PR VG . (: VG extra_system_ids VG .) (preempt-abort) PR VG --removekey remkey remkey PR PR . vgchange --systemid foreign_system_id --persist stop VG VG . VG PR . (Persist Through Power Loss) << >> (Persist Through Power Loss) PR ptpl : vgchange --setpersist ptpl VG PTPL ( PR start) . PV VG PTPL . PTPL "--setpersist y" . PTPL : vgchange --setpersist noptpl VG vgchange --setpersist n VG (EXAMPLES) VG (Local VG usage) host1: $ lvmconfig local/host_id host_id=1 $ vgcreate vg /dev/sda /dev/sdb Physical volume "/dev/sda" successfully created. Physical volume "/dev/sdb" successfully created. Volume group "vg" successfully created $ vgchange --setpersist y vg Volume group "vg" successfully changed. $ vgchange --persist start vg lvmpersist: started vg with key 0x1000000000000001. $ vgchange --persist check vg key for local host is registered: 0x1000000000000001 reservation WE for local host PR is started. $ lvcreate -l1 -n lvol0 vg Logical volume "lvol0" created. $ vgchange -an vg 0 logical volume(s) in volume group "vg" now active $ vgchange --persist stop vg lvmpersist: stopped vg with key 0x1000000000000001. $ vgchange -ay vg persistent reservation is not started. Cannot access VG vg without persistent reservation. $ lvcreate -l1 -n lvol1 vg persistent reservation is not started. Cannot access VG vg without persistent reservation. $ vgchange --persist start vg lvmpersist: started vg with key 0x1000000000000001. $ vgchange -ay vg 1 logical volume(s) in volume group "vg" now active $ lvcreate -l1 -n lvol1 vg Logical volume "lvol1" created. host2 foricibly takes VG from host1: $ lvmconfig local/host_id host_id=2 $ vgchange -ay vg persistent reservation is not started. Cannot access VG vg without persistent reservation. $ vgchange --persist start vg persistent reservation is started by another host $ vgchange --persist check vg key for local host is not registered (host_id 2) key for other host is registered: 0x1000000000000001 reservation WE for other host PR is not started. $ dd if=/dev/zero of=/dev/sda dd: error writing '/dev/sda': Input/output error $ vgchange --persist start --removekey 0x1000000000000001 vg lvmpersist: started vg with key 0x1000000000000002. $ vgchange -ay vg 2 logical volume(s) in volume group "vg" now active $ vgchange --persist check vg key for local host is registered: 0x1000000000000002 reservation WE for local host PR is started. host1 can no longer write: $ dd if=/dev/zero of=/dev/vg/lvol0 dd: error writing '/dev/vg/lvol0': Input/output error $ lvcreate -l1 -n lvol1 vg persistent reservation is not started. Cannot access VG vg without persistent reservation. $ vgchange --persist check vg key for local host is not registered (host_id 1) key for other host is registered: 0x1000000000000002 reservation WE for other host PR is not started. VG (Shared VG usage) host1: $ lvmconfig local/host_id host_id=1 $ vgcreate --shared vg /dev/sda /dev/sdb Enabling sanlock global lock Physical volume "/dev/sda" successfully created. Physical volume "/dev/sdb" successfully created. Logical volume "lvmlock" created. Volume group "vg" successfully created VG vg starting sanlock lockspace Starting locking. Waiting until locks are ready... $ vgchange --setpersist y vg Volume group "vg" successfully changed. $ vgchange --persist start vg lvmpersist: started vg with key 0x1000000000010001. $ vgchange --persist check vg key for local host is registered: 0x1000000000010001 keys for all registered hosts: 0x1000000000010001 reservation WEAR for registered hosts PR is started. $ lvcreate -l1 -n lvol0 vg Logical volume "lvol0" created. host2: $ lvmconfig local/host_id host_id=2 $ vgchange --persist start vg lvmpersist: started vg with key 0x1000000000010002. $ vgchange --lockstart vg VG vg starting sanlock lockspace Starting locking. Waiting for sanlock... $ vgchange --persist check vg key for local host is registered: 0x1000000000010002 keys for all registered hosts: 0x1000000000010001 0x1000000000010002 reservation WEAR for registered hosts PR is started. $ lvcreate -l1 -n lvol1 vg Logical volume "lvol1" created. $ lvchange -ay vg/lvol0 LV locked by other host: vg/lvol0 (host_id 1) Failed to lock logical volume vg/lvol0. $ vgchange -an vg 0 logical volume(s) in volume group "vg" now active $ vgchange --lockstop vg $ vgchange --persist stop vg lvmpersist: stopped ee with key 0x1000000000010002. $ vgchange --persist check vg key for local host is not registered (host_id 2) keys for all registered hosts: 0x1000000000010001 reservation WEAR for registered hosts PR is not started. $ dd if=/dev/zero of=/dev/sda dd: error writing '/dev/sda': Input/output error (SEE ALSO) lvm(8), lvm.conf(5), lvmlocal.conf(5), lvmsystemid(7), vgchange(8), vgcreate(8), vgextend(8), mpathconf(8), multipath.conf(5) lvm2 LVMPERSIST(8)