Operating System - Linux
1748246 Members
3009 Online
108760 Solutions
New Discussion юеВ

Re: "sar -d" devices - how to map to /dev/sdNNN devices?

 
SOLVED
Go to solution
Alzhy
Honored Contributor

"sar -d" devices - how to map to /dev/sdNNN devices?

"sar -d" gives out stats like:

[alzhy@envy10 home]$ sar -d|awk '$7>10'|more
12:00:01 AM DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz awai
t svctm %util
12:05:01 AM dev8-0 65.98 2.27 1025.24 15.57 0.02 0.2
3 0.12 0.79
12:05:01 AM dev8-2 65.98 2.27 1025.24 15.57 0.02 0.2
3 0.12 0.79
12:05:01 AM dev8-240 0.54 0.00 10.73 19.73 0.00 7.4
4 2.41 0.13

How do I translate devices like "dev8-240" to the usual nomenclature of /dev/sdNNN ?

TIA!
Hakuna Matata.
6 REPLIES 6
Matti_Kurkela
Honored Contributor
Solution

Re: "sar -d" devices - how to map to /dev/sdNNN devices?

Most likely "dev8-240" means a device with major number 8 and minor number 240.

Run "ls -l /dev/sd*" and look at the device numbers between the group and the timestamp (regular files would have a file size in that position).

Or look into Linux kernel documentation. If you install the "kernel-doc" package, the documentation files are typically at /usr/share/doc/kernel-doc. You'll want the file named "devices.txt".

The documentation as it exist in the latest released Linux kernel version is available on the Web here:
http://www.mjmwired.net/kernel/Documentation/devices.txt

Because your command was "sar -d", we know these are block devices. Major number 8 contains the first 16 /dev/sd* disk devices (/dev/sda ... /dev/sdp). The minor number of "whole disk" devices is always divisible by 16.

So:
dev8-0 = /dev/sda
dev8-2 = /dev/sda2
dev8-240 = /dev/sdp

You could also use "sar -dp" instead of "sar -d" to make sar translate the names of most disk devices automatically. Unfortunately it may not translate device-mapper devices (LVM, disk encryption, software RAID, dm-multipath) so you'll still have to figure them out by the major/minor numbers. The output of "dmsetup ls --tree" may be helpful there.

MK
MK
Alzhy
Honored Contributor

Re: "sar -d" devices - how to map to /dev/sdNNN devices?

Luv ya Matti.
Hakuna Matata.
Alzhy
Honored Contributor

Re: "sar -d" devices - how to map to /dev/sdNNN devices?

Matti, any idea what those "nodev" devices are?

01:00:01 sddw1 13.89 2788.04 279.07 220.83 0.65 46.62 18.98 26.36
01:00:01 sddx 14.60 3269.15 315.73 245.51 0.77 52.54 20.08 29.31
01:00:01 sddx1 14.60 3269.15 315.73 245.51 0.77 52.54 20.08 29.31
01:00:01 nodev 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
01:00:01 nodev 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

Hakuna Matata.
Matti_Kurkela
Honored Contributor

Re: "sar -d" devices - how to map to /dev/sdNNN devices?

I don't really know. "nodev" would suggest that they don't really have a device as such.

They probably aren't loop-mounted disk images; as I understand, they would have entries like loop0 ... loop7, if the kernel supports statistics like this for them at all.

They don't seem to be NFS mounts either, based on a quick bit of testing. (That wouldn't have made sense anyway, because NFS client/server interface is not really like a block device at all.)

Perhaps they are statistics slots for LUNs/disks that once existed, but have since then been unpresented/hot-unplugged? The fact that the I/O statistics seem to be all zeroes for them would sort of tentatively agree with this guess.

You might want to take a peek in /proc/diskstats (which is where sar -d gets its information) and /etc/sysstat/sysstat.ioconf (which is used by sar -d to translate the device names) for more clues.

MK
MK
Brendan Murphy_5
Frequent Advisor

Re: "sar -d" devices - how to map to /dev/sdNNN devices?

Hi Alzhy,
I suspect that if you're using SAN disks, that the nodev devices may be Storage controller devices.
Brendan
RomanKunz
New Member

Re: "sar -d" devices - how to map to /dev/sdNNN devices?

sar -p -d

 

-p (pretty print)