Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

mount shows mount devices like:

/dev/mapper/VolGroup01-LogVol00 on /var type ext3 (rw)

or

/dev/mapper/VolGrp_backups-backups on /mnt/backups type ext3 (rw)

but

iostat uses dm- notation. like dm-0, dm-1 and so on.

Where can I find a way to know which is which?

share|improve this question
    
Somehow, I thought there was a way to tell iostat to 'just do that', but there isn't one (that I can find). +1 for a great question that got an answer that helped me too. –  Tim Post May 17 '11 at 17:16

4 Answers 4

up vote 14 down vote accepted

ls -l /dev/mapper/*, the device minor number (field 6 of what ls -l outputs) corresponds to the number in dm-\d+.

share|improve this answer

Depending on the version of iostat you have the -N option will do this for you:

-N Display the registered device mapper names for any device mapper devices. Useful for viewing LVM2 statistics.

Edit: versions >= 7.1.4 of systat (which includes iostat) have that option.

2007/04/29: Version 7.1.4 - Sebastien Godard (sysstat wanadoo.fr) * Option -N added to iostat. This option enables the user to query any device-mapper devices for their registered device name [bugzilla #177540].

share|improve this answer

you can try lsblk command which shows the Logical Volume used by respective dev-mapper.

# lsblk
NAME                       MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                          8:0    0    8G  0 disk
├─sda1                       8:1    0  500M  0 part /boot
└─sda2                       8:2    0  7.5G  0 part
  ├─vg_root-lv_root (dm-0) 253:0    0  5.6G  0 lvm  /
  └─vg_root-lv_swap (dm-1) 253:1    0    2G  0 lvm  [SWAP]
sdb                          8:16   0  200M  0 disk
sdc                          8:32   0  1.5G  0 disk
sdd                          8:48   0  512M  0 disk
sde                          8:64   0    4G  0 disk
└─vg_root-lv_data (dm-2)   253:2    0  3.5G  0 lvm  /data1
share|improve this answer

Please try this command in version of iostat where there is no -N option to list the LV's

lvdisplay | awk '/LV Name/{blockdev=$3} /Block device/{bdid=$3; sub("[0-9]*:","dm-",bdid); print bdid,blockdev;}'

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.