Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to list all the physical volume associated with logical volume.

I know lvdisplay, pvscan, pvdisplay -m could do the job. but I don't want to use these commands. Is there any other way to do it without using lvm2 package commands?

Any thoughts on comparing the major and minor numbers of devices?

share|improve this question
The kernel numbers for a LV are not related to the base device(s). They can even change from one boot to the next. – Hauke Laging Jul 4 '13 at 12:03
up vote 3 down vote accepted

There are two possibilities:

If you accept dmsetup as a non-lvm package command (at openSUSE the is a separate package device-mapper) then you can do this:

dmsetup table "${vg_name}-${lv_name}"

Or you do this:

start cmd: # ls -l /dev/mapper/linux-rootfs 
lrwxrwxrwx 1 root root 7 27. Jun 21:34 /dev/mapper/linux-rootfs -> ../dm-0

start cmd: # ls /sys/block/dm-0/slaves/
share|improve this answer
@captain My /dev/mapper/linux-rootfs has been created with LVM. dmsetup uses just the part after /dev/mapper/. The LV rootfs in the VG linux gets the DM name linux-rootfs. – Hauke Laging Jul 4 '13 at 12:54
@ Hauke Laging Let me correct it I created volume named 'test' using dmsetup and tried command ls /sys/block/dm-0/slaves/.I am not seeing any output. – Dipak Ingole Jul 4 '13 at 13:03
@captain And your test is dm-0? – Hauke Laging Jul 4 '13 at 13:06
@captain Strange. I am not familiar enough with the sysfs details in order to explain that. You could make that a separate question. – Hauke Laging Jul 4 '13 at 13:12
My mistake.ls /sys/block/dm-0/slaves/ worked for me. – Dipak Ingole Jul 12 '13 at 6:18

Folks , If you certainly needs to dive inside it then you can give thoughts on comparing Major and minor number

ubuntu@ubuntu-OptiPlex-3010:~$ sudo dmsetup ls
vgpool-lvstuff  (253, 0)

I created this logical volume using disk sda1

ubuntu@ubuntu-OptiPlex-3010:~$ sudo dmsetup deps vgpool-lvstuff
1 dependencies  : (8, 1)

(8, 1) gives me the (major,minor) number of disk on which lvm is dependent which I will compare using following command.

ubuntu@ubuntu-OptiPlex-3010:~$ sudo cat /proc/partitions
major minor  #blocks  name
8        0  488386584 sda
8        1     305368 sda1
8        2    3150112 sda2
share|improve this answer
@Hauke Laging check this as well – Dipak Ingole Jul 17 '13 at 3:48

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.