How to associate /dev/dm- device with the LVM logical volume

root's picture

The devices dm-* from /dev are LVM logical "devices" but sometimes is hard to see which logical volume is associated with the device.
Fortunately the magic of shell can help out.

core:~# lvdisplay|awk  '/LV Name/{n=$3} /Block device/{d=$3; sub(".*:","dm-",d); print d,n;}'
dm-1 /dev/datavg/mylv
dm-2 /dev/datavg/weblv
dm-4 /dev/datavg/ftplv
dm-5 /dev/datavg/blahlv
dm-7 /dev/datavg/backups
dm-8 /dev/rootvg/homelv
dm-0 /dev/rootvg/slashlv
dm-9 /dev/rootvg/tmplv
dm-10 /dev/rootvg/usrlv
dm-11 /dev/rootvg/varlv
dm-12 /dev/rootvg/srclv
dm-14 /dev/rootvg/swap0
dm-15 /dev/rootvg/fileslv

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content