lvs output decrypting

So you run on your server

# lvs

and get some output, and you would like to know exactly what particular bit means

On my test machine I have

# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
lvgfs2 lvtest -wi-a- 484.00M
lvtest lvtest -wi-ao 524.00M
quorumdisk quorum -wi-a- 20.00M

Here we will spend some time on Attr filed

You can see we have there -wi-a- what has 6 bits. Probably some of you now think it is similar with usual file permission attributes rwx — but not completely. Below are lvm flags decoded

From left to right:

Bit #1
* (m)irrored
* (M)irrored without initial sync
* (o)rigin
* (p)vmove
* (s)napshot
* (S)napshot invalid
* (v)irtual
* (i)mage mirror
* (I)mage out-of-sync
* (c)onversion in progress
Bit #2
* (w)riteable
* (r)ead-only
Bit #3
* (c)ontiguous
* (n)ormal
* c(l)ing
* (a)nywhere
* (i)nherited
Bit #4
* (m)inor
Bit #5
* (a)ctive
* (s)uspended
* (I)nvalid snapshot
* (S)uspended snapshot
* (d)evice present without tables
* (i)nactive table on present device
Bit #6
* (o)pen

so in my case it is

-wi-a- = – writable inherit – active –

Advertisements