Score:0

Map dev notation to logical volume name

pn flag
VGS

I need to figure out what dm-2 or dm-0, etc. is (this notation is found in dmesg notices, sysstat reports, etc.) and lsblk is not installed I find lvdisplay output a little bit confusing.

Can someone please help with simple script to identify which dm device maps to which LVM ?

Score:2
nr flag

A simple one liner for this purpose:

lvdisplay|awk '/LV Name/{n=$3} /Block device/{d=$3; sub(".*:","dm-",d); print d,n;}'

The output of above command should be like:

# lvdisplay|awk '/LV Name/{n=$3} /Block device/{d=$3; sub(".*:","dm-",d); print d,n;}'

dm-0 swap00
dm-1 tmp00
dm-2 root00
VGS avatar
pn flag
VGS
Thank you for the quick response. The solution worked like a charm.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.