Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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
add comment

3 Answers

up vote 6 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
add comment

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
add comment

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
add comment

Your Answer

 
discard

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