Linux command
lvmpersist 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Example
lvmpersist start --ourkey [0x1234abcd] --vg [vg_name]
Example
lvmpersist start --ourkey [0x1234abcd] --access sh --vg [vg_name]
Stop PR
lvmpersist stop --ourkey [0x1234abcd] --vg [vg_name]
Take over
lvmpersist start --ourkey [0xmy_key] --removekey [0xother_key] --vg [vg_name]
Remove another host's key
lvmpersist remove --ourkey [0xmy_key] --removekey [0xother_key] --vg [vg_name]
Show registered keys
lvmpersist read --vg [vg_name]
Example
lvmpersist start --ourkey [0x1234abcd] --device [/dev/sdX] --device [/dev/mapper/mpathY]
说明
lvmpersist manages SCSI persistent reservations (PR) on block devices used as LVM physical volumes. Persistent reservations prevent multiple hosts from simultaneously accessing shared storage, protecting against data corruption in clustered or failover configurations. The tool can establish exclusive reservations (one host owns access) or shared reservations (multiple hosts coordinate access). Keys identify each host, and reservations can be preempted if a host fails or needs to be forcibly removed. Common use cases include SAN-based clusters, high-availability failover pairs, and shared storage environments where fencing is required.
参数
- start
- Register a key and create a persistent reservation
- stop
- Release reservation and unregister the key
- remove
- Remove another host's key from devices
- read
- Display registered keys and current reservations
- --ourkey _key_
- The local host's reservation key (hexadecimal)
- --removekey _key_
- Another host's key to preempt or remove
- --vg _vg_name_
- Operate on all physical volumes in the specified volume group
- --device _device_
- Operate on a specific device (can be repeated)
- --access _type_
- Reservation type: ex (exclusive) or sh (shared)
FAQ
What is the lvmpersist command used for?
lvmpersist manages SCSI persistent reservations (PR) on block devices used as LVM physical volumes. Persistent reservations prevent multiple hosts from simultaneously accessing shared storage, protecting against data corruption in clustered or failover configurations. The tool can establish exclusive reservations (one host owns access) or shared reservations (multiple hosts coordinate access). Keys identify each host, and reservations can be preempted if a host fails or needs to be forcibly removed. Common use cases include SAN-based clusters, high-availability failover pairs, and shared storage environments where fencing is required.
How do I run a basic lvmpersist example?
Run `lvmpersist start --ourkey [0x1234abcd] --vg [vg_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does start do in lvmpersist?
Register a key and create a persistent reservation