I was just running into this, so I'll document what helped me here.
poise's answer is correct, You can get all of the information you need from dmsetup ls --tree
, if you know how to interpret the output.
cciss is the device name, that's your actual disk. The man page spells it out well, but I'll copy the relevant section here:
Device nodes
The device naming scheme is as follows:
Major numbers:
104 cciss0
105 cciss1
106 cciss2
105 cciss3
108 cciss4
109 cciss5
110 cciss6
111 cciss7
Minor numbers:
b7 b6 b5 b4 b3 b2 b1 b0
|----+----| |----+----|
| |
| +-------- Partition ID (0=wholedev, 1-15 partition)
|
+-------------------- Logical Volume number
The device naming scheme is:
/dev/cciss/c0d0 Controller 0, disk 0, whole device
/dev/cciss/c0d0p1 Controller 0, disk 0, partition 1
/dev/cciss/c0d0p2 Controller 0, disk 0, partition 2
/dev/cciss/c0d0p3 Controller 0, disk 0, partition 3
/dev/cciss/c1d1 Controller 1, disk 1, whole device
/dev/cciss/c1d1p1 Controller 1, disk 1, partition 1
/dev/cciss/c1d1p2 Controller 1, disk 1, partition 2
/dev/cciss/c1d1p3 Controller 1, disk 1, partition 3
The "dm-#" is the device mapper number. The easiest way to map DM numbers is to run lvdisplay
, which shows the logical volume name, the volume group it belongs to, and the block device. In the "Block device" row, the value listed after the colon is the DM number.
root@centos:/dev > lvdisplay /dev/vg0/opt
--- Logical volume ---
LV Name /dev/vg0/opt
VG Name vg0
LV UUID ObffAT-txIn-5Rwy-bW5s-gekn-VLZv-71mDZi
LV Write Access read/write
LV Status available
# open 1
LV Size 1.00 GB
Current LE 32
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:5
Which maps back nicely to the output of dmsetup ls --tree
vg0-opt (253:5)
└─ (104:3)
You can also see the DM number mappings by running ls -lrt /dev/mapper
.
root@centos:/dev > ls -lrt /dev/mapper
total 0
crw------- 1 root root 10, 60 Aug 29 2013 control
brw-rw---- 1 root disk 253, 0 Aug 29 2013 vg0-root
brw-rw---- 1 root disk 253, 1 Aug 29 2013 vg0-usr
brw-rw---- 1 root disk 253, 2 Aug 29 2013 vg0-tmp
brw-rw---- 1 root disk 253, 3 Aug 29 2013 vg0-var
brw-rw---- 1 root disk 253, 4 Aug 29 2013 vg0-home
brw-rw---- 1 root disk 253, 5 Aug 29 2013 vg0-opt
The sixth column lists the DM number. So, for my server, vg0-opt is mounted on /opt, and maps back to DM-5.
/dev/mapper
directory is typically a symlink to the actual device.