dm devices

November 28, 2016

With fdisk -l you might see a lot of dm devices as well, besides the
‘regular’ disk notations like sda, sdb:

# fdisk -l | grep Disk
Disk /dev/sdb doesn’t contain a valid partition table
Disk /dev/sda: 161.0 GB, 161061273600 bytes
Disk /dev/sdb: 18.2 GB, 18253611008 bytes
Disk /dev/sdc: 32.2 GB, 32212254720 bytes
Disk /dev/sdd: 214.7 GB, 214748364800 bytes
Disk /dev/dm-0 doesn’t contain a valid partition table
Disk /dev/dm-1 doesn’t contain a valid partition table
Disk /dev/dm-2 doesn’t contain a valid partition table
Disk /dev/dm-3 doesn’t contain a valid partition table
Disk /dev/sde: 21.4 GB, 21474836480 bytes
Disk /dev/sdf: 268.4 GB, 268435456000 bytes
Disk /dev/dm-0: 115.8 GB, 115897008128 bytes
Disk /dev/dm-1: 2080 MB, 2080374784 bytes
Disk /dev/dm-2: 21.3 GB, 21340618752 bytes
Disk /dev/dm-4 doesn’t contain a valid partition table
Disk /dev/dm-5 doesn’t contain a valid partition table
Disk /dev/dm-6 doesn’t contain a valid partition table
Disk /dev/dm-7 doesn’t contain a valid partition table
Disk /dev/dm-8 doesn’t contain a valid partition table
Disk /dev/dm-9 doesn’t contain a valid partition table
Disk /dev/dm-3: 45.0 GB, 45097156608 bytes
Disk /dev/dm-4: 289.9 GB, 289910292480 bytes
Disk /dev/dm-5: 75.1 GB, 75161927680 bytes
Disk /dev/dm-6: 46.1 GB, 46170898432 bytes
Disk /dev/dm-7: 19.3 GB, 19327352832 bytes
Disk /dev/dm-8: 1073 MB, 1073741824 bytes
Disk /dev/dm-9: 31.9 GB, 31943819264 bytes

First look at the mounted filesystems and their logical volumes:

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
105G 52G 48G 52% /
/dev/sda1 99M 38M 57M 40% /boot
tmpfs 2.0G 31M 1.9G 2% /dev/shm
/dev/mapper/backupvg-backuplv
30G 4.8G 24G 18% /backup
/dev/mapper/DataVG-crid1lv
42G 30G 9.9G 75% /crid1
/dev/mapper/DataVG-crid4lv
43G 33G 8.0G 81% /crid4
/dev/mapper/DataVG-crid5lv
18G 17G 717M 96% /crid5
/dev/mapper/DataVG-crid6lv
1008M 334M 624M 35% /crid6
/dev/mapper/DataVG-crid2lv
266G 107G 147G 43% /crid2
/dev/mapper/DataVG-crid3lv
69G 63G 3.4G 95% /crid3
/dev/mapper/ScomVG-scomlv
20G 185M 19G 1% /opt/microsoft

Now these LVM logical volumes can be seen as ‘slices’ in a Volume Group.
Each time you slice of part of the volume group as a logical volume it is
presented as a dm- device. You can map them using

# lvdisplay|awk ‘/LV Name/{n=$3} /Block device/{d=$3;sub(“.*:”,”dm-“,d);
print d,n;}’
dm-2 /dev/ScomVG/scomlv
dm-3 /dev/DataVG/crid1lv
dm-4 /dev/DataVG/crid2lv
dm-5 /dev/DataVG/crid3lv
dm-6 /dev/DataVG/crid4lv
dm-7 /dev/DataVG/crid5lv
dm-8 /dev/DataVG/crid6lv
dm-9 /dev/backupvg/backuplv
dm-0 /dev/VolGroup00/LogVol00
dm-1 /dev/VolGroup00/LogVol01

Those are LVM logical “devices”. It’s part of the device mapper in the
kernel, used by LVM.

You can see the major-minor numbers:

root@phlx7002 ~# dmsetup ls
DataVG-crid1lv (253, 3)
DataVG-crid2lv (253, 4)
backupvg-backuplv (253, 9)
ScomVG-scomlv (253, 2)
DataVG-crid3lv (253, 5)
DataVG-crid4lv (253, 6)
DataVG-crid5lv (253, 7)
DataVG-crid6lv (253, 8)
VolGroup00-LogVol01 (253, 1)
VolGroup00-LogVol00 (253, 0)

Also like this:
# ls -l /dev/dm*
brw-r—– 1 root disk 253, 0 Aug 1 04:43 /dev/dm-0
brw-r—– 1 root disk 253, 1 Aug 1 04:43 /dev/dm-1
brw-r—– 1 root disk 253, 2 Aug 1 04:43 /dev/dm-2
brw-r—– 1 root disk 253, 3 Aug 1 04:43 /dev/dm-3
brw-r—– 1 root disk 253, 4 Aug 1 04:43 /dev/dm-4
brw-r—– 1 root disk 253, 5 Aug 1 04:43 /dev/dm-5
brw-r—– 1 root disk 253, 6 Aug 1 04:43 /dev/dm-6
brw-r—– 1 root disk 253, 7 Aug 1 04:43 /dev/dm-7
brw-r—– 1 root disk 253, 8 Aug 1 04:43 /dev/dm-8
brw-r—– 1 root disk 253, 9 Aug 1 04:43 /dev/dm-9

And even more info with:

# dmsetup info /dev/dm-3
Name: DataVG-crid1lv
State: ACTIVE
Read Ahead: 256
Tables present: LIVE
Open count: 1
Event number: 0
Major, minor: 253, 3
Number of targets: 2
UUID: LVM-Mly1kOLS8MsUtc00eaJpslKenaT2VSWIsUSn157QzYWdGpRl7uPx2gKaOQiS

Comments are closed.

Next Post
»