Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

While poking around trying to figure out why a Linux -> Linux file transfer is running slower than I think it should, I stumbled across something I'm not familiar with. /dev/dm-0 seems to be my bottleneck, but I have no idea what it is.

On my destination server, the iostat command shows a device at the bottom, /dev/dm-0, as being 100% utilized. This server has 6 disks in a mdadm raid5 set, with LVM running on top of it. Each of the underlying disks are sitting around 50% util. The transfer is writing to a logical volume located on this raidset.

What is this /dev/dm-0 thing? Once I know what it is, maybe I can find how to increase its speed, or at least understand why its the speed that it is.

share|improve this question
1  
It turns out that the dm-0 device wasn't causing the slowness, I had the partitions aligned wrong. On a 4k sector drive, you need to manually align the partitions when you create them. Dumb, but easy to fix. – Jeff Shattock Apr 16 '10 at 21:15
up vote 65 down vote accepted

It's part of the device mapper in the kernel, used by LVM. Use dmsetup ls to see what is behind it.

share|improve this answer
4  
More specifically sudo dmsetup info /dev/dm-0 – tgharold Dec 30 '15 at 13:13

Those are LVM logical "devices"

You can map them using:

# sudo lvdisplay|awk  '/LV Name/{n=$3} /Block device/{d=$3; sub(".*:","dm-",d); print d,n;}'
dm-0 /dev/SysVolGroup/LogVolRoot
dm-1 /dev/SysVolGroup/xen
dm-2 /dev/SysVolGroup/db1-2
dm-3 /dev/SysVolGroup/db1-2swap
dm-4 /dev/SysVolGroup/python1
dm-5 /dev/SysVolGroup/python1swap
dm-6 /dev/SysVolGroup/db1-2snap

source: http://www.linuxquestions.org/questions/linux-newbie-8/dm0-in-iostat-652771/

share|improve this answer
sudo lvdisplay

showed the mapping of mounted virtual partitions to "volume groups".

When I typed sudo pvs I saw the mapping of a volume group to a "physical volume" that looked like a familiar /dev/sdaN notation. (My looking at the whole disk with fdisk -l /dev/sda showed another partition).

share|improve this answer

pvs displays the physical volumes that underpin the LVM volume group. A number of physical devices can be grouped together to from one volume group. The group is then re-split into logical volumes as required treating the physical disks as a single resource to be chopped up and re-sized at will. Each time you slice of part of the volume group as a logical volume it is presented as a dm- device

share|improve this answer

As usual under a Linux system, there should be many ways to get the same result. If you've been given a non root user, I advise you to use lsblk command (e.g. list block devices) which will build a tree view of disks dependencies:

[oracle@abcdlinux ~]$ lsblk
NAME                               MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sda                                  8:0    0  300G  0 disk
└─RATGORA1DSY_PJSTORE_1 (dm-4)     253:4    0  300G  0 mpath
  └─RATGORA1DSY_PJSTORE_1p1 (dm-5) 253:5    0  300G  0 part  /oradata
sdb                                  8:16   0  100G  0 disk
└─Boot-RATGORA1DSY (dm-0)          253:0    0  100G  0 mpath
  ├─Boot-RATGORA1DSYp1 (dm-1)      253:1    0  100M  0 part  /boot
  ├─Boot-RATGORA1DSYp2 (dm-2)      253:2    0   16G  0 part  [SWAP]
  └─Boot-RATGORA1DSYp3 (dm-3)      253:3    0 83.9G  0 part  /
sdc                                  8:32   0  300G  0 disk
└─RATGORA1DSY_PJSTORE_1 (dm-4)     253:4    0  300G  0 mpath
  └─RATGORA1DSY_PJSTORE_1p1 (dm-5) 253:5    0  300G  0 part  /oradata
sdd                                  8:48   0  100G  0 disk
└─Boot-RATGORA1DSY (dm-0)          253:0    0  100G  0 mpath
  ├─Boot-RATGORA1DSYp1 (dm-1)      253:1    0  100M  0 part  /boot
  ├─Boot-RATGORA1DSYp2 (dm-2)      253:2    0   16G  0 part  [SWAP]
  └─Boot-RATGORA1DSYp3 (dm-3)      253:3    0 83.9G  0 part  /
share|improve this answer

You can use sar

df -h

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-rootvol
                   24G  4.1G   18G  19% /
tmpfs                 7.8G     0  7.8G   0% /dev/shm
/dev/mapper/VolGroup01-appvol
                   39G  411M   37G   2% /app
/dev/sda1             194M   93M   92M  51% /boot
/dev/mapper/VolGroup01-logvol
                   61G   18G   41G  30% /log
/dev/mapper/VolGroup00-tmpvol
                  2.0G  379M  1.5G  21% /tmp
/dev/mapper/VolGroup00-varvol
                   20G  2.1G   17G  12% /var

sar -bdp 1

01:00:20 AM       DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz         await     svctm     %util
01:00:21 AM       sda      0.00      0.00      0.00      0.00      0.00              0.00      0.00      0.00
01:00:21 AM VolGroup00-swapvol      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
01:00:21 AM VolGroup00-rootvol      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
01:00:21 AM VolGroup01-appvol      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
01:00:21 AM VolGroup01-logvol      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
01:00:21 AM VolGroup00-varvol      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
01:00:21 AM VolGroup00-tmpvol      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .