Advertisements

Linux LVM: pvs showing dm-XX. How to map and show the friendly name (alias)

When listing the disks used by LVM and it shows only dm, you can make it display the multipath friendly name

root@linux:~ # pvs
PV VG Fmt Attr PSize PFree
/dev/cciss/c0d0p2 rootvg lvm2 a- 135.69G 11.69G
/dev/dm-0 softwarevg lvm2 a- 100.00G 30.00G
/dev/dm-1 softwarevg lvm2 a- 100.00G 0
/dev/dm-2 softwarevg lvm2 a- 100.00G 0
/dev/dm-33 softwarevg lvm2 a- 100.99G 100.99G
/dev/dm-6 bkpcvrdvg lvm2 a- 50.00G 0
/dev/dm-7 softwarevg lvm2 a- 100.00G 0
/dev/dm-8 softwarevg lvm2 a- 50.00G 0

Edit file /etc/lvm/lvm.conf and tell LVM to not use the cache file. Set write_cache_state to 0

root@linux:~ # vi /etc/lvm/lvm.conf
write_cache_state = 0

And delete the cache file

root@linux:~ # rm /etc/lvm/.cache
or
root@linux:~ # rm /etc/lvm/cache/.cache

It should be displaying with the friendly names

root@linux:~ # pvs
PV VG Fmt Attr PSize PFree
/dev/cciss/c0d0p2 rootvg lvm2 a- 135.69G 11.69G
/dev/mapper/bkpdisk01-part1 bkpcvrdvg lvm2 a- 50.00G 0
/dev/mapper/sfwdisk01-part1 softwarevg lvm2 a- 100.00G 0
/dev/mapper/sfwdisk02-part1 softwarevg lvm2 a- 50.00G 0
/dev/mapper/sfwdisk03 softwarevg lvm2 a- 100.00G 0
/dev/mapper/sfwdisk04 softwarevg lvm2 a- 100.00G 30.00G
/dev/mapper/sfwdisk05 softwarevg lvm2 a- 100.00G 0
/dev/mapper/sfwdisk05_NEW1 softwarevg lvm2 a- 100.99G 100.99G

Also check the filter parameter in the file /etc/lvm/lvm.conf

filter = [ “a|cciss/.*|” “a|/dev/mapper/.*|”, “r|/dev/sd.*|”, “r|/dev/dm-.*|” ]

If you need to map, go to /dev/mapper and do a long listing. Search for the number after the 253,. Eg. dm-33 is the sfwdisk05_NEW1

root@linux:/dev/mapper # ls -l total 0
brw——- 1 root root 253, 18 Dec 16 10:56 bkpcvrdvg-apliclv
brw——- 1 root root 253, 19 Dec 16 10:56 bkpcvrdvg-bkpcvrdlv
brw——- 1 root root 253, 3 Dec 16 10:56 bkpdisk01
brw——- 1 root root 253, 6 Dec 16 10:56 bkpdisk01-part1
lrwxrwxrwx 1 root root 16 Dec 16 10:56 control -> ../device-mapper
brw——- 1 root root 253, 28 Mar 13 05:45 mpathe
brw——- 1 root root 253, 29 Mar 13 05:45 mpathf
brw——- 1 root root 253, 30 Mar 13 05:45 mpathg
brw——- 1 root root 253, 31 Mar 13 05:45 mpathh
brw——- 1 root root 253, 32 Mar 13 05:45 mpathi
brw——- 1 root root 253, 9 Dec 16 10:57 rootvg-auditlv
brw——- 1 root root 253, 10 Dec 16 10:57 rootvg-locallv
brw——- 1 root root 253, 11 Dec 16 10:57 rootvg-optlv
brw——- 1 root root 253, 12 Dec 16 10:56 rootvg-rootlv
brw——- 1 root root 253, 13 Dec 16 10:56 rootvg-swaplv
brw——- 1 root root 253, 14 Dec 16 10:57 rootvg-tmplv
brw——- 1 root root 253, 15 Dec 16 10:58 rootvg-userslv
brw——- 1 root root 253, 16 Dec 16 10:58 rootvg-usrlv
brw——- 1 root root 253, 17 Dec 16 10:58 rootvg-varlv
brw——- 1 root root 253, 4 Dec 16 10:56 sfwdisk01
brw——- 1 root root 253, 7 Dec 16 10:56 sfwdisk01-part1
brw——- 1 root root 253, 5 Dec 16 10:56 sfwdisk02
brw——- 1 root root 253, 8 Dec 16 10:56 sfwdisk02-part1
brw——- 1 root root 253, 1 Dec 16 10:56 sfwdisk03
brw——- 1 root root 253, 0 Dec 16 10:56 sfwdisk04
brw——- 1 root root 253, 2 Dec 16 10:56 sfwdisk05
brw——- 1 root root 253, 27 Mar 13 09:24 sfwdisk05_NEW
brw——- 1 root root 253, 33 Mar 13 09:26 sfwdisk05_NEW1
brw——- 1 root root 253, 25 Dec 16 12:25 softwarevg-applv
brw——- 1 root root 253, 26 Dec 16 10:56 softwarevg-arqlv
brw——- 1 root root 253, 21 Dec 16 10:56 softwarevg-deploylv
brw——- 1 root root 253, 22 Dec 16 10:56 softwarevg-logslv
brw——- 1 root root 253, 24 Dec 16 10:56 softwarevg-oraclelv
brw——- 1 root root 253, 20 Dec 16 10:56 softwarevg-softwarelv
brw——- 1 root root 253, 23 Dec 16 10:56 softwarevg-transferlv

Advertisements
%d bloggers like this: