How to make a VG/LV readonly?
Issue
- For some reason, the particular VG/LV need to be put into readonly mode.
- When follow the steps below to make a VG/LV readonly , it fails with error below:
# vgchange -an vg1
0 logical volume(s) in volume group "vg1" now active
# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv1 vg1 -wi------- 1.00g
# vgchange -ay --readonly vg1
Operation prohibited while --readonly is set.
Can't get lock for vg1.
Cannot process volume group vg1
Or:
# lvchange -ay --readonly /dev/vg1/lv1
Operation prohibited while --readonly is set.
Can't get lock for vg1.
Cannot process volume group vg1
Environment
- Red Hat Enterprise Linux 8
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.