dmidecode

title: dmidecode(8)

summary: \s-1DMI\s0 table decoder

text:
# dmidecode(8)

## NAME
dmidecode - DMI table decoder

## SYNOPSIS
dmidecode [OPTIONS]

## DESCRIPTION
dmidecode is a tool for dumping a computer's DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system's hardware components, as well as other useful pieces of information such as serial numbers and firmware revision. Thanks to this table, you can retrieve this information without having to probe for the actual hardware. While this is a good point in terms of report speed and safeness, this also makes the presented information possibly unreliable.

The DMI table doesn't only describe what the system is currently made of, it also can report the possible evolutions (such as the fastest supported CPU or the maximal amount of memory supported).

SMBIOS stands for System Management BIOS, while DMI stands for Desktop Management Interface. Both standards are tightly related and developed by the DMTF (Desktop Management Task Force).

As you run it, dmidecode will try to locate the DMI table. It will first try to read the DMI table from sysfs, and next try reading directly from memory if sysfs access failed. If dmidecode succeeds in locating a valid DMI table, it will then parse this table and display a list of records like this one:

Handle 0x0002, DMI type 2, 8 bytes. Base Board Information

Manufacturer: Intel

Product Name: C440GX+

Version: 727281-001

Serial Number: INCY92700942

Each record has:

- A handle. This is a unique identifier, which allows records to reference each other. For example, processor records usually reference cache memory records using their handles.

- A type. The SMBIOS specification defines different types of elements a computer can be made of. In this example, the type is 2, which means that the record contains "Base Board Information".

- A size. Each record has a 4-byte header (2 for the handle, 1 for the type, 1 for the size), the rest is used by the record data. This value doesn't take text strings into account (these are placed at the end of the record), so the actual length of the record may be (and is often) greater than the displayed value.

- Decoded values. The information presented of course depends on the type of record. Here, we learn about the board's manufacturer, model, version and serial number.

## OPTIONS
-d, --dev-mem FILE

Read memory from device FILE (default: /dev/mem)

-q, --quiet

Be less verbose. Unknown, inactive and OEM-specific entries are not displayed. Meta-data and handle references are hidden.

--no-quirks

Decode everything exactly as it is in the table, without trying to fix up common mistakes or hide irrelevant fields. This mode is primarily aimed at firmware developers.

-s, --string KEYWORD

Only display the value of the DMI string identified by KEYWORD. It must be a keyword from the following list: bios-vendor, bios-version, bios-release-date, bios-revision, firmware-revision, system-manufacturer, system-product-name, system-version, system-serial-number, system-uuid, system-sku-number, system-family, baseboard-manufacturer, baseboard-product-name, baseboard-version, baseboard-serial-number, baseboard-asset-tag, chassis-manufacturer, chassis-type, chassis-version, chassis-serial-number, chassis-asset-tag, processor-family, processor-manufacturer, processor-version, processor-frequency. In this context, for historical reasons, "bios" designates the platform firmware (regardless of it technically implementing the BIOS standard), while "firmware" designates the embedded controller firmware, if applicable. Each keyword corresponds to a given DMI type and a given offset within this entry type. Not all strings may be meaningful or even defined on all systems. Some keywords may return more than one result on some systems (e.g. processor-version on a multi-processor system). If KEYWORD is not provided or not valid, a list of all valid keywords is printed and dmidecode exits with an error. This option cannot be used more than once. Note: on Linux, most of these strings can alternatively be read directly from sysfs, typically from files under /sys/devices/virtual/dmi/id. Most of these files are even readable by regular users.

--list-strings

List available string keywords, which can then be passed to the --string option.

-t, --type TYPE

Only display the entries of type TYPE. It can be either a DMI type number, or a comma-separated list of type numbers, or a keyword from the following list: bios, system, baseboard, chassis, processor, memory, cache, connector, slot. Refer to the DMI TYPES section below for details. In this context, for historical reasons, "bios" designates the platform firmware, regardless of it technically implementing the BIOS standard. If this option is used more than once, the set of displayed entries will be the union of all the given types. If TYPE is not provided or not valid, a list of all valid keywords is printed and dmidecode exits with an error.

--list-types

List available type keywords, which can then be passed to the --type option.

-H, --handle HANDLE

Only display the entry whose handle matches HANDLE. HANDLE is a 16-bit integer.

-u, --dump

Do not decode the entries, dump their contents as hexadecimal instead. Note that this is still a text output, no binary data will be thrown upon you. The strings attached to each entry are displayed as both hexadecimal and ASCII. This option is mainly useful for debugging.

--dump-bin FILE

Do not decode the entries, instead dump the DMI data to a file in binary form. The generated file is suitable to pass to --from-dump later. FILE must not exist.

--from-dump FILE

Read the DMI data from a binary file previously generated using --dump-bin.

--no-sysfs

Do not attempt to read DMI data from sysfs files. This is mainly useful for debugging.

--oem-string N

Only display the value of the OEM string number N. The first OEM string has number 1. With special value count, return the number of OEM strings instead.

-h, --help

Display usage information and exit

-V, --version

Display the version and exit

Options --string, --type, --dump-bin and --oem-string determine the output format and are mutually exclusive.

Please note in case of dmidecode is run on a system with firmware that boasts new SMBIOS specification, which is not supported by the tool yet, it will print out relevant message in addition to requested data on the very top of the output. Thus informs the output data is not reliable.

## DMI TYPES
The SMBIOS specification defines the following DMI types:

Type

Information

0

Platform Firmware

1

System

2

Baseboard

3

Chassis

4

Processor

5

Memory Controller

6

Memory Module

7

Cache

8

Port Connector

9

System Slots

10

On Board Devices

11

OEM Strings

12

System Configuration Options

13

Firmware Language

14

Group Associations

15

System Event Log

16

Physical Memory Array

17

Memory Device

18

32-bit Memory Error

19

Memory Array Mapped Address

20

Memory Device Mapped Address

21

Built-in Pointing Device

22

Portable Battery

23

System Reset

24

Hardware Security

25

System Power Controls

26

Voltage Probe

27

Cooling Device

28

Temperature Probe

29

Electrical Current Probe

30

Out-of-band Remote Access

31

Boot Integrity Services

32

System Boot

33

64-bit Memory Error

34

Management Device

35

Management Device Component

36

Management Device Threshold Data

37

Memory Channel

38

IPMI Device

39

Power Supply

40

Additional Information

41

Onboard Devices Extended Information

42

Management Controller Host Interface

Additionally, type 126 is used for disabled entries and type 127 is an end-of-table marker. Types 128 to 255 are for OEM-specific data. dmidecode will display these entries by default, but it can only decode them when the vendors have contributed documentation or code for them.

Keywords can be used instead of type numbers with --type. Each keyword is equivalent to a list of type numbers:

Keyword

Types

bios

0, 13

system

1, 12, 15, 23, 32

baseboard

2, 10, 41

chassis

3

processor

4

memory

5, 6, 16, 17

cache

7

connector

8

slot

9

Keywords are matched case-insensitively. The following command lines are equivalent:

- dmidecode --type 0 --type 13

- dmidecode --type 0,13

- dmidecode --type bios

- dmidecode --type BIOS

## BINARY DUMP FILE FORMAT
The binary dump files generated by --dump-bin and read using --from-dump are formatted as follows:

- The SMBIOS or DMI entry point is located at offset 0x00. It is crafted to hard-code the table address at offset 0x20.

- The DMI table is located at offset 0x20.

## UUID FORMAT
There is some ambiguity about how to interpret the UUID fields prior to SMBIOS specification version 2.6. There was no mention of byte swapping, and RFC 4122 says that no byte swapping should be applied by default. However, SMBIOS specification version 2.6 (and later) explicitly states that the first 3 fields of the UUID should be read as little-endian numbers (byte-swapped). Furthermore, it implies that the same was already true for older versions of the specification, even though it was not mentioned. In practice, many hardware vendors were not byte-swapping the UUID. So, in order to preserve compatibility, it was decided to interpret the UUID fields according to RFC 4122 (no byte swapping) when the SMBIOS version is older than 2.6, and to interpret the first 3 fields as little-endian (byte-swapped) when the SMBIOS version is 2.6 or later. The Linux kernel follows the same logic.

## FILES
/dev/mem

/sys/firmware/dmi/tables/smbios_entry_point (Linux only)

/sys/firmware/dmi/tables/DMI (Linux only)

## BUGS
More often than not, information contained in the DMI tables is inaccurate, incomplete or simply wrong.

## AUTHORS
Alan Cox, Jean Delvare

## SEE ALSO
biosdecode(8), mem(4), ownership(8), vpddecode(8)


ownership

package: dmidecode

title: ownership(8)

summary: Compaq ownership tag retriever

text:
# ownership(8)

## NAME
ownership - Compaq ownership tag retriever

## SYNOPSIS
ownership [OPTIONS]

## DESCRIPTION
ownership retrieves and prints the "ownership tag" that can be set on Compaq computers. Contrary to all other programs of the dmidecode package, ownership doesn't print any version information, nor labels, but only the raw ownership tag. This should help its integration in scripts.

## OPTIONS
-d, --dev-mem FILE

Read memory from device FILE (default: /dev/mem)

-h, --help

Display usage information and exit

-V, --version

Display the version and exit

## FILES
/dev/mem

## AUTHOR
Jean Delvare

## SEE ALSO
biosdecode(8), dmidecode(8), mem(4), vpddecode(8)

branch: sisyphus


vpddecode

title: vpddecode(8)

summary: \s-1VPD\s0 structure decoder

text:
# vpddecode(8)

## NAME
vpddecode - VPD structure decoder

## SYNOPSIS
vpddecode [OPTIONS]

## DESCRIPTION
vpddecode prints the "vital product data" information that can be found in almost all IBM and Lenovo computers. Available items are:

- BIOS Build ID

- Box Serial Number

- Motherboard Serial Number

- Machine Type/Model

Some systems have these additional items:

- BIOS Release Date

- Default Flash Image File Name

Note that these additional items are not documented by IBM, so this is guess work, and as such should not be blindly trusted. Feedback about the accuracy of these labels is welcome.

## OPTIONS
-d, --dev-mem FILE

Read memory from device FILE (default: /dev/mem)

-s, --string KEYWORD

Only display the value of the VPD string identified by KEYWORD. It must be a keyword from the following list: bios-build-id, box-serial-number, motherboard-serial-number, machine-type-model, bios-release-date. Each keyword corresponds to an offset and a length within the VPD record. Not all strings may be defined on all VPD-enabled systems. If KEYWORD is not provided or not valid, a list of all valid keywords is printed and vpddecode exits with an error. This option cannot be used more than once. Mutually exclusive with --dump.

-u, --dump

Do not decode the VPD records, dump their contents as hexadecimal instead. Note that this is still a text output, no binary data will be thrown upon you. ASCII equivalent is displayed when possible. This option is mainly useful for debugging. Mutually exclusive with --string.

-h, --help

Display usage information and exit

-V, --version

Display the version and exit

## FILES
/dev/mem

## AUTHOR
Jean Delvare

## SEE ALSO
biosdecode(8), dmidecode(8), mem(4), ownership(8)


package: dmraid

title: dmevent_tool(8)

text:
# dmevent_tool(8)

## NAME
dmevent_tool - A utility used to load a DSO into dmeventd and (un)register devices with it for monitoring

## SYNOPSIS
dmevent_tool -[Vhmru] {RAID device name} {DSO Name}

## DESCRIPTION
dmevent_tool is a userspace utility used to register/unregister DSOs with the daemon dmeventd.

If used with the -m command line parameter users can display all of the actively dmeventd monitored devices.

## OPTIONS
-V Show version of dmevent_tool

-{h/?} Show this help information

-m[r|u] List all currently active device mapper devices

and their current status with dmeventd

for registered (-r)/unregistered (-m) devices

Syntax: dmevent_tool -m[u|r]

-a[r|u] Same as -m, but for devices with UUID only!

Syntax: dmevent_tool -a[u|r]

-r Register a device with dmeventd

Syntax: dmevent_tool -r <device name> <path to DSO library>

Example: dmevent_tool -r isw_abcdeh_Volume0 libdmraid-events.so

-u Unregister a device with dmeventd

Syntax: dmevent_tool -u <device name> [<path to DSO library>]

Example: dmevent_tool -u isw_abcdefgh_Volume0

## EXAMPLES
dmevent_tool -m is used to display all of the actively monitored devices

dmevent_tool -m

Device Name: isw_defeaigdde_Volume0_dmraid00

Registered DSO: libdmraid-events.so

UUID: isw_defeaigdde_Volume0_dmraid00

status: Active

major device #: 253

minor device #: 0

read only device: No

number of recorded kernel events: 0

SATA drives in this volume group: /dev/sdb /dev/sdc

dmevent_tool -r is used to register a volume group device with dmeventd

dmevent_tool -r isw_defeaigdde_Volume0_dmraid00 libdmraid-events.so

dmevent_tool -u is used to unregister a volume group from dmeventd

dmevent_tool -u isw_defeaigdde_Volume0_dmraid00

## DIAGNOSTICS
dmevent_tool returns an exit code of 0 for success or 1 for error.

## AUTHOR
Brian Wood <brian.j.wood@intel.com>


dmraid

title: dmraid(8)

text:
# dmraid(8)

## NAME
dmraid - discover, configure and activate software (ATA)RAID

## SYNOPSIS
dmraid

{-a|--activate} {y|n|yes|no}

[-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]

[-f|--format FORMAT[,FORMAT...]]

[{-P|--partchar} CHAR]

[-p|--no_partitions]

[-Z|--rm_partitions]

[--separator SEPARATOR]

[-t|--test]

[-u|--update_defer]

[RAID-set...]

dmraid

{-b|--block_devices}

[-c|--display_columns][FIELD[,FIELD...]]...

[-d|--debug]... [-v|--verbose]...

[--separator SEPARATOR]

[device-path...]

dmraid

{-h|--help}

dmraid

{-l|--list_formats}

[-d|--debug]... [-v|--verbose]...

dmraid

{-n|--native_log}

[-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]

[-f|--format FORMAT[,FORMAT...]]

[--separator SEPARATOR]

[device-path...]

dmraid

{-R| --rebuild}

RAID-set

[device-path]

[-u|--update_defer]

dmraid

{-x| --remove}

[RAID-set]

dmraid

-f FORMAT-handler {-C| --create} set

--type raidlevel

[--size=setsize --strip stridesize]

--disk "device-path, device-path [, device-path ...]"

dmraid [ -f|--format FORMAT-handler] -S|--spare [RAID-set] -M|--media "device-path"

dmraid

{-r|--raid_devices}

[-c|--display_columns][FIELD[,FIELD...]]...

[-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]

[-D|--dump_metadata]

[-f|--format FORMAT[,FORMAT...]]

[--separator SEPARATOR]

[device-path...]

dmraid

{-r|--raid_devices}

[-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]

[-E|--erase_metadata]

[-f|--format FORMAT[,FORMAT...]]

[--separator SEPARATOR]

[device-path...]

dmraid

{-s|--sets}...[a|i|active|inactive]

[-c|--display_columns][FIELD[,FIELD...]]...

[-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]

[-f|--format FORMAT[,FORMAT...]]

[-g|--display_group]

[--separator SEPARATOR]

[RAID-set...]

dmraid

{-V/--version}

## DESCRIPTION
dmraid discovers block and software RAID devices (eg, ATARAID) by using multiple different metadata format handlers which support various formats (eg, Highpoint 37x series). It offers activating RAID sets made up by 2 or more discovered RAID devices, display properties of devices and sets (see option -l for supported metadata formats). Block device access to activated RAID sets occurs via device-mapper nodes /dev/mapper/RaidSetName. RaidSetName starts with the format name (see -l option) which can be used to access all RAID sets of a specific format easily with certain options (eg, -a below).

### OPTIONS
-a, --activate {y|n} [RAID set...]

Activates or deactivates all or particular software RAID set. In case metadata format handlers are chosen with -f , only RAID sets with such format(s) can be activated or deactivated. Useful if devices have multiple metadata signatures. When activating RAID sets, -p disables the activation of partitions on them, and -Z will make dmraid tell the kernel to remove the partitions from the disks underlying the set, ie if sda is part of the set, remove sda1, sda2, etc. This prevents applications from directly accessiong the disks bypassing dmraid. RAID set names given on command line don't need to be fully specified (eg, "dmraid -ay sil" would activate all discovered Silicon Image Medley RAID sets). Option -u defers metadata update in case of rebuild is triggered parallelly with activation. Awoids metadata update to "OK" state if volume is not registered to the event monitoring. Useful if volume is activating at early stage of booting process when registration to the event monitoring is impossible.

{-b|--block_devices} [device-path...]

List all or particular discovered block devices with their properties (size, serial number). Add -c to display block device names only and -cc for CSV column output of block device properties. See description of -c below for FIELD identifiers.

[-d|--debug]...

Enable debugging output. Opion can be given multiple times increasing the debug output level.

[-c|--display_columns][FIELD[,FIELD...]]...

Display properties of block devices, RAID sets and devices in column(s). Optional list specifying which FIELDs to display.

For -b:

d[evpath]|p[ath], sec[tors]|si[ze], ser[ialnumber].

For -r:

de[vpath]|p[ath], f[ormat], r[aidname], t[ype], st[atus], se[ctors]|si[ze], da[taoffset]|o[ffset].

For -s:

f[ormat], r[aidname], t[ype], sta[tus], str[ide], se[ctors]|si[ze], su[bsets], d[evices], sp[ares].

[-f|--format FORMAT[,FORMAT...]]

Use metadata format handler(s) to discover RAID devices. See -l for a list of supported format handler names. This is useful to select particular formats in case multiple metadata signatures are found on a device. A comma seperated list of format names can be specified which may not contain white space.

{-h|--help}

Display help text.

{-i|--ignorelocking}

Don't take out any locks. Useful in early boot where no read/write access to /var is available.

{-l|--list_formats}

List all available metadata format handlers with their names and descriptions. Supported RAID levels are listed in parenthesis: S: Span (concatination)

0: RAID0 (stripe)

1: RAID1 (mirror)

10: RAID10 (mirror on top of stripes)

01: RAID10 (stripe on top of mirrors) Note: Intel OROM displays this as RAID10

{-n|--native_log} [device-path...]

Display metadata in native, vendor-specific format. In case a metadata format handler is chosen with -f only RAID devices with such format will be displayed in native format. If device-path(s) is/are given on the command line, native metadata output is restricted to those listed.

[{-P|--partchar} CHAR]

Use CHAR as the separator between the device name and the partition number.

{-R| --rebuild} RAID-set [device-path]

Rebuild raid array after a drive has failed and a new drive is added. For Intel chipset based systems, there are two methods in which a new drive is added to the system. Option -u defers metadata update in case of rebuild is triggered. Awoids metadata update to "OK" state if volume is not registered to the event monitoring. 1. Using OROM to identify a new drive

During system reboot, enter OROM and mark the new drive as the rebuild drive.

After booting to the OS, use the dmraid command to rebuild.

Example: dmraid -R raid_set

2. Using dmraid to identify a new drive

Boot to the OS and use the dmraid command with the new drive as the second parameter.

Example: dmraid -R raid_set /dev/sdc

3. Using hot spare drive

Mark a drive as hot spare using the "dmraid -f isw -S" command. Then use the dmraid command to start the rebuild.

Example: dmraid -R raid_set

{-x|--remove} [RAID-set]

Delete one or all existing software RAID devices from the metadata.

-f FORMAT-handler {-C|--create} --type raidlevel [--size=setsize --strip stripsize] --disk device-path, device-path [,device-path]

Delete one or all existing Configure a software RAID device and store the configuration data in a group of hard drive devices consisting of this array. This command requires the following options: -f FORMAT-handler

metadata format (see "dmraid -l")

--type digit[digit...]

specify the raid level of the software RAID set.

0: raid0

1: raid1

5: raid5

01: raid01 (isw raid10)

--size: [digits[k|K|m|M|g|G][b|B]]

specify the size of the RAID set.The number is an integer followed by [kKmMgG] and/or [bB].

b: byte (default)

B: block (512 bytes)

K or K: on the base of 1024

m or M: on the base of 1024*1024

g or G: on the base of 1024*1024*1024

If this option is missing, it's set to the default value pre-configured by the vendor. Note that different vendors may apply different constraints on the granularity of the size or the minimal value.

--strip: [digits[k|K|m|M|g|G][b|B]]

specify the strip size of a RAID1, RAID5, and RAID10 RAID set (as above)

--disk: device-path[{,| }device-path...]

specify the array of the hard drives, e.g. /dev/sda.

-f FORMAT-handler -S -M device-path

-S -M device-path This command adds hot spare support for one or more RAID sets.

1. When used with a format handler, which supports hot spare sets (e.g. isw), a hot spare is marked to be used when rebuilding any RAID set of that format. 2. When used when specifying a RAID set, the drive is added to that RAID set and will be used only to rebuild that set. Note: If the specified name does not match an existing RAID-set, a set with the new name will be created.

{-r|--raid_devices} [device-path...]

List all discovered RAID devices with format, RAID level, sectors used and data offset into the device. In case a metadata format handler is chosen with -f , only RAID devices with such format can be discovered. Useful if devices have multiple metadata signatures. If -D is added to -r the RAID metadata gets dumped into a subdirectory named dmraid.format_name (eg. format_name = isw) in files named devicename.dat. The byte offset where the metadata is located on the device is written into files named devicename.offset and the size of the device in sectors into files named devicename.size. If -E is added to -r the RAID metadata on the devices gets conditionally erased. Useful to erase old metadata after new one of different type has been stored on a device in order to avoid discovering both. If you enter -E option -D will be enforced in order to have a fallback in case the wrong metadata got erased. Manual copying back onto the device is needed to recover from erasing the wrong metadata using the dumped files devicename_formatname.dat and devicename_formatname.offset. Eg, to restore all *.dat files in the working directory to the respective devices:

for f in *.dat

do

dd if=$f of=/dev/${f%%.dat} \

seek=`cat ${f%%dat}offset` bs=1

done

If device-path(s) is/are given on the command line, the above actions are restricted to those listed. Add -c to display RAID device names only and -cc for CSV column output of RAID device properties. See description of -c above for FIELD identifiers.

--separator SEPARATOR

Use SEPARATOR as a delimiter for all options taking or displaying lists.

-s... [a|i] [RAID-set...]

Display properties of RAID sets. Multiple RAID set names can be given on the command line which don't need to be fully specified (eg, "dmraid -s hpt" would display all discovered Highpoint RAID sets). Enter -s twice to display RAID subsets too. Add -c to display names of RAID sets only, -cc for CSV column output of RAID set properties and -ccc for inclusion of block devices in the listing. Doesn't imply -s -s to show RAID subsets (implied for group sets, e.g. isw). Add -g to include information about group RAID sets (as with Intel Software RAID) in the listing. See description of -c above for FIELD identifiers. Note: Size is given in sectors (not bytes).

[-v|--verbose]...

Enable verbose runtime information output. Opion can be given multiple times increasing the verbosity level.

## EXAMPLES
"dmraid -l" lists all supported metadata formats with their names along with some descriptive information, eg:

hpt37x : (+) Highpoint HPT37X

hpt45x : (+) Highpoint HPT45X

isw : (+) Intel Software RAID

lsi : (0) LSI Logic MegaRAID

nvidia : (+) NVidia RAID

pdc : (+) Promise FastTrack

sil : (+) Silicon Image(tm) Medley(tm)

via : (+) VIA Software RAID

dos : (+) DOS partitions on SW RAIDs

(0): Discover, (+): Discover+Activate

"dmraid -ay" activates all software RAID sets discovered.

"dmraid -an" deactivates all active software RAID sets which are not open (eg, mounted filesystem on them).

"dmraid -ay -f pdc" (pdc looked up from "dmraid -l") activates all software RAID sets with Promise format discovered and ignores all other supported formats.

"dmraid -r" discovers all software RAID devices supported on your system, eg:

/dev/dm-46: hpt45x, "hpt45x_chidjhaiaa-0", striped, ok, 320172928 sectors, data@ 0

/dev/dm-50: hpt45x, "hpt45x_chidjhaiaa-0", striped, ok, 320172928 sectors, data@ 0

/dev/dm-54: hpt45x, "hpt45x_chidjhaiaa-1", striped, ok, 320172928 sectors, data@ 0

/dev/dm-58: hpt45x, "hpt45x_chidjhaiaa-1", striped, ok, 320172928 sectors, data@ 0

"dmraid -s -s hpt45x_chidjhaiaa" displays properties of set "hpt45x_chidjhaiaa", eg:

*** Superset

name : hpt45x_chidjhaiaa

size : 640345856

stride : 128

type : raid10

status : ok

subsets: 2

dev : 4

spare : 0

---> Subset

name : hpt45x_chidjhaiaa-0

size : 640345856

stride : 128

type : stripe

status : ok

subsets: 0

dev : 2

spare : 0

---> Subset

name : hpt45x_chidjhaiaa-1

size : 640345856

stride : 128

type : stripe

status : ok

subsets: 0

dev : 2

spare : 0

"dmraid -s -ccs hpt45" displays properties in column format of all sets and subsets with hpt45* format, eg:

hpt45x_chidjhaiaa,640345856,128,raid10,ok,4,0

hpt45x_chidjhaiaa-a,640345856,128,stripe,ok,2,0

hpt45x_chidjhaiaa-b,640345856,128,stripe,ok,2,0

"dmraid -r --sep : -cpath:size" display paths and sizes in sectors for RAID devices in column format using ':' as a delimiter, eg:

/dev/dm-8:320173055

/dev/dm-12:320173055

/dev/dm-22:320173055

/dev/dm-26:320173055

/dev/dm-30:586114703

/dev/dm-34:586114703

/dev/dm-38:586114703

/dev/dm-42:586114703

/dev/dm-46:156301487

/dev/dm-50:156301487

/dev/dm-54:390624896

/dev/dm-58:390624896

/dev/dm-62:390624896

/dev/dm-66:390624896

"dmraid -f isw -C Raid0 --type 0 --strip 8k --size 20g --disk "/dev/sdb /dev/sdc"" creates an ISW volume with a name of "Raid0", 20Gig bytes in total, and 8kilo bytes strip size on two disks.

"dmraid -f isw -C Test0 --type 0 --disk "/dev/sdd /dev/sde"" creates an ISW volume with the default size and strip size.

"dmraid -f isw -C Test10 --type 01 --strip 128B --disk "/dev/sda /dev/sdb /dev/sdc /dev/sdd" creates a stacked RAID device, RAID10 (isw format), with a name of "Test10", 128 blocks (512bytes) strip size , and the default volume size on 4 disks.

"dmraid -f isw -S -M /dev/sde" marks the device /dev/sde as a hot spare for rebuild

"dmraid -R isw_djaggchdde_RAID1 /dev/sde" starts rebuild of the RAID volume on device /dev/sde

## DIAGNOSTICS
dmraid returns an exit code of 0 for success or 1 for error.

## AUTHOR
Heinz Mauelshagen <Mauelshagen@RedHat.com>


blkdeactivate

package: dmsetup

title: blkdeactivate(8)

summary: utility to deactivate block devices

text:
# blkdeactivate(8)

## NAME
blkdeactivate — utility to deactivate block devices

## SYNOPSIS
blkdeactivate

[-d|--dmoptions dm_options] [-e|--errors] [-h|--help] [-l|--lvmoptions lvm_options] [-r|--mdraidoptions mdraid_options] [-m|--mpathoptions mpath_options] [-u|--umount] [-o|--vdooptions vdo_options] [-v|--verbose] [device]

## DESCRIPTION
The blkdeactivate utility deactivates block devices. For mounted block devices, it attempts to unmount them automatically before trying to deactivate. The utility currently supports device-mapper devices (DM), including LVM volumes and software RAID MD devices. LVM volumes are handled directly using the lvm(8) command, the rest of device-mapper based devices are handled using the dmsetup(8) command. MD devices are handled using the mdadm(8) command.

## OPTIONS
-d|--dmoptions dm_options

Comma separated list of device-mapper specific options.

Accepted dmsetup(8) options are:

retry

Retry removal several times in case of failure.

force

Force device removal.

-e|--errors

Show errors reported from tools called by blkdeactivate. Without this option, any error messages from these external tools are suppressed and the blkdeactivate itself provides only a summary message to indicate the device was skipped.

-h|--help

Display the help text.

-l|--lvmoptions lvm_options

Comma-separated list of LVM specific options:

retry

Retry removal several times in case of failure.

wholevg

Deactivate the whole LVM Volume Group when processing a Logical Volume. Deactivating the Volume Group as a whole is quicker than deactivating each Logical Volume separately.

-r|--mdraidoptions mdraid_options

Comma-separated list of MD RAID specific options:

wait

Wait for MD device's resync, recovery or reshape action to complete before deactivation.

-m|--mpathoptions mpath_options

Comma-separated list of device-mapper multipath specific options:

disablequeueing

Disable queueing on all multipath devices before deactivation. This avoids a situation where blkdeactivate may end up waiting if all the paths are unavailable for any underlying device-mapper multipath device.

-u|--umount

Unmount a mounted device before trying to deactivate it. Without this option used, a device that is mounted is not deactivated.

-o|--vdooptions vdo_options

Comma-separated list of VDO specific options:

configfile=file

Use specified VDO configuration file.

-v|--verbose

Run in verbose mode. Use -vv for even more verbose mode.

## EXAMPLES
Deactivate all supported block devices found in the system, skipping mounted devices.

blkdeactivate

Deactivate all supported block devices found in the system, unmounting any mounted devices first, if possible.

blkdeactivate -u

Deactivate the device /dev/vg/lvol0 together with all its holders, unmounting any mounted devices first, if possible.

blkdeactivate -u /dev/vg/lvol0

Deactivate all supported block devices found in the system. If the deactivation of a device-mapper device fails, retry it. Deactivate the whole Volume Group at once when processing an LVM Logical Volume.

blkdeactivate -u -d retry -l wholevg

Deactivate all supported block devices found in the system. If the deactivation of a device-mapper device fails, retry it and force removal.

blkdeactivate -d force,retry

## SEE ALSO
lvm(8),

dmsetup(8),

lsblk(8), mdadm(8), multipathd(8), vdo(8), umount(8)


dmsetup

title: dmsetup(8)

summary: low level logical volume management

text:
# dmsetup(8)

## NAME
dmsetup — low level logical volume management

## SYNOPSIS
dmsetup

clear device_name

dmsetup

create device_name [-n|--notable|--table table|table_file] [--readahead [+]sectors|auto|none] [-u|--uuid uuid] [--addnodeoncreate|--addnodeonresume]

dmsetup

create --concise [concise_device_specification]

dmsetup

deps [-o options] [device_name ...]

dmsetup

help [-c|-C|--columns]

dmsetup

info [device_name ...]

dmsetup

info -c|-C|--columns [--count count] [--interval seconds] [--noheadings|--headings none|abbrev|full|0|1|2] [-o fields] [-O|--sort sort_fields] [--nameprefixes] [--separator separator] [device_name]

dmsetup

load device_name [--table table|table_file]

dmsetup

ls [--target target_type] [-o options] [--exec command] [--tree]

dmsetup

mangle [device_name ...]

dmsetup

measure [device_name ...]

dmsetup

message device_name sector message

dmsetup

mknodes [device_name ...]

dmsetup

reload device_name [--table table|table_file]

dmsetup

remove [-f|--force] [--retry] [--deferred] device_name ...

dmsetup

remove_all [-f|--force] [--deferred]

dmsetup

rename device_name new_name

dmsetup

rename device_name --setuuid uuid

dmsetup

resume device_name ... [--addnodeoncreate|--addnodeonresume] [--noflush] [--nolockfs] [--readahead [+]sectors|auto|none]

dmsetup

setgeometry device_name cyl head sect start

dmsetup

splitname device_name [subsystem]

dmsetup

stats command [options]

dmsetup

status [--target target_type] [--noflush] [device_name ...]

dmsetup

suspend device_name ... [--nolockfs] [--noflush]

dmsetup

table [--concise] [--target target_type] [--showkeys] [device_name ...]

dmsetup

targets

dmsetup

udevcomplete cookie

dmsetup

udevcomplete_all [age_in_minutes]

dmsetup

udevcookie

dmsetup

udevcreatecookie

dmsetup

udevflags cookie

dmsetup

udevreleasecookie [cookie]

dmsetup

version

dmsetup

wait device_name [--noflush] [event_nr]

dmsetup

wipe_table device_name ... [-f|--force] [--noflush] [--nolockfs]

devmap_name major minor

devmap_name major:minor

## DESCRIPTION
dmsetup manages logical devices that use the device-mapper driver. Devices are created by loading a table that specifies a target for each sector (512 bytes) in the logical device.

The first argument to dmsetup is a command. The second argument is the logical device name or uuid.

Invoking the dmsetup tool as devmap_name (which is not normally distributed and is supported only for historical reasons) is equivalent to dmsetup info -c --noheadings -j major -m minor.

## OPTIONS
--addnodeoncreate

Ensure /dev/mapper node exists after dmsetup create.

--addnodeonresume

Ensure /dev/mapper node exists after dmsetup resume (default with udev).

--checks

Perform additional checks on the operations requested and report potential problems. Useful when debugging scripts. In some cases these checks may slow down operations noticeably.

-c|-C|--columns

Display output in columns rather than as Field: Value lines.

--count count

Specify the number of times to repeat a report. Set this to zero to continue until interrupted. The default interval is one second.

-f|--force

Try harder to complete operation.

-h|--help

Outputs a summary of the commands available, optionally including the list of report fields (synonym with help command).

--inactive

When returning any table information from the kernel report on the inactive table instead of the live table. Requires kernel driver version 4.16.0 or above.

--interval seconds

Specify the interval in seconds between successive iterations for repeating reports. If --interval is specified but --count is not, reports will continue to repeat until interrupted. The default interval is one second.

--manglename auto|hex|none

Mangle any character not on a whitelist using mangling_mode when processing device-mapper device names and UUIDs. The names and UUIDs are mangled on input and unmangled on output where the mangling mode is one of: auto (only do the mangling if not mangled yet, do nothing if already mangled, error on mixed), hex (always do the mangling) and none (no mangling). Default mode is auto. Character whitelist: 0–9, A–Z, a–z, #+-.:=@_. This whitelist is also supported by udev. Any character not on a whitelist is replaced with its hex value (two digits) prefixed by \x. Mangling mode could be also set through DM_DEFAULT_NAME_MANGLING_MODE environment variable.

-j| --major major

Specify the major number.

-m|--minor minor

Specify the minor number.

-n|--notable

When creating a device, don't load any table.

--nameprefixes

Add a "DM_" prefix plus the field name to the output. Useful with --noheadings to produce a list of field=value pairs that can be used to set environment variables (for example, in udev(7) rules).

--noheadings

Suppress the headings line when using columnar output.

--headings none|abbrev|full|0|1|2

Type of headings line to use for columnar output.

none or 0 – No headings.

abbrev or 1 – Column name abbreviations.

full or 2 – Full column names.

--noflush

Do not flush outstanding I/O when suspending a device, or do not commit thin-pool metadata when obtaining thin-pool status.

--nolockfs

Do not attempt to synchronize filesystem, e.g., when suspending a device.

--noopencount

Tell the kernel not to supply the open reference count for the device.

--noudevrules

Do not allow udev to manage nodes for devices in device-mapper directory.

--noudevsync

Do not synchronize with udev when creating, renaming or removing devices.

-o|--options options

Specify which fields to display.

--readahead [+]sectors|auto|none

Specify read ahead size in units of sectors. The default value is auto which allows the kernel to choose a suitable value automatically. The + prefix lets you specify a minimum value which will not be used if it is smaller than the value chosen by the kernel. The value none is equivalent to specifying zero.

-r|--readonly

Set the table being loaded read-only.

-S|--select selection

Process only items that match selection criteria. If the command is producing report output, adding the "selected" column (-o selected) displays all rows and shows 1 if the row matches the selection and 0 otherwise. The selection criteria are defined by specifying column names and their valid values while making use of supported comparison operators. As a quick help and to see full list of column names that can be used in selection and the set of supported selection operators, check the output of dmsetup info -c -S help command.

--table table

Specify a one-line table directly on the command line. See below for more information on the table format.

--udevcookie cookie

Use cookie for udev synchronization.

Note: Same cookie should be used for same type of operations i.e. creation of multiple different devices. It's not advised to combine different operations on the single device.

-u|--uuid uuid

Specify the uuid.

-y|--yes

Answer yes to all prompts automatically.

-v|--verbose [-v|--verbose]

Produce additional output.

--verifyudev

If udev synchronization is enabled, verify that udev operations get performed correctly and try to fix up the device nodes afterwards if not.

--version

Display the library and kernel driver version.

## COMMANDS
clear device_name

Destroys the table in the inactive table slot for device_name.

create device_name [-n|--notable|--table table|table_file] [--readahead [+]sectors|auto|none] [-u|--uuid uuid] [--addnodeoncreate|--addnodeonresume]

Creates a device with the given name. If table or table_file is supplied, the table is loaded and made live. Otherwise a table is read from standard input unless --notable is used. The optional uuid can be used in place of device_name in subsequent dmsetup commands. If successful the device will appear in table and for the live device the node /dev/mapper/device_name is created. See below for more information on the table format.

create --concise [concise_device_specification]

Creates one or more devices from a concise device specification. Each device is specified by a comma-separated list: name, uuid, minor number, flags, comma-separated table lines. Flags defaults to read-write (rw) or may be read-only (ro). Uuid, minor number and flags are optional so those fields may be empty. A semi-colon separates specifications of different devices. Use a backslash to escape the following character, for example a comma or semi-colon in a name or table. See also CONCISE FORMAT below.

deps [-o options] [device_name ...]

Outputs a list of devices referenced by the live table for the specified device. Device names on output can be customised by the following options: devno (major and minor pair, used by default), blkdevname (block device name), devname (map name for device-mapper devices, equal to blkdevname otherwise).

help [-c|-C|--columns]

Outputs a summary of the commands available, optionally including the list of report fields.

info [device_name ...]

Outputs some brief information about the device in the form:

State: SUSPENDED|ACTIVE, READ-ONLY

Read Ahead: sectors

Tables present: LIVE and/or INACTIVE

Open reference count

Last event sequence number (used by wait)

Major and minor device number

Number of targets in the live table

UUID

info -c|-C|--columns [--count count] [--interval seconds] [--noheadings|--headings none|abbrev|full|0|1|2] [-o fields] [-O|--sort sort_fields] [--nameprefixes] [--separator separator] [device_name]

Output you can customise. Fields are comma-separated and chosen from the following list: name, major, minor, attr, open, segments, events, uuid. Attributes are: (L)ive, (I)nactive, (s)uspended, (r)ead-only, read-(w)rite. Precede the list with '+' to append to the default selection of columns instead of replacing it. Precede any sort field with '-' for a reverse sort on that column.

ls [--target target_type] [-o options] [--exec command] [--tree]

List device names. Optionally only list devices that have at least one target of the specified type. Optionally execute a command for each device. The device name is appended to the supplied command. Device names on output can be customised by the following options: devno (major and minor pair, used by default), blkdevname (block device name), devname (map name for device-mapper devices, equal to blkdevname otherwise). --tree displays dependencies between devices as a tree. It accepts a comma-separated list of options. Some specify the information displayed against each node: device / nodevice; blkdevname; active, open, rw, uuid. Others specify how the tree is displayed: ascii, utf, vt100; compact, inverted, notrunc.

reload device_name [--table table|table_file]

Loads table or table_file into the inactive table slot for device_name. If neither is supplied, reads a table from standard input.

mangle [device_name ...]

Ensure existing device-mapper device_name and UUID is in the correct mangled form containing only whitelisted characters (supported by udev) and do a rename if necessary. Any character not on the whitelist will be mangled based on the --manglename setting. Automatic rename works only for device names and not for device UUIDs because the kernel does not allow changing the UUID of active devices. Any incorrect UUIDs are reported only and they must be manually corrected by deactivating the device first and then reactivating it with proper mangling mode used (see also --manglename).

measure [device_name ...]

Show the data that device_name would report to the IMA subsystem if a measurement was triggered at the current time. This is for debugging and does not actually trigger a measurement.

message device_name sector message

Send message to target. If sector not needed use 0.

mknodes [device_name ...]

Ensure that the node in /dev/mapper for device_name is correct. If no device_name is supplied, ensure that all nodes in /dev/mapper correspond to mapped devices currently loaded by the device-mapper kernel driver, adding, changing or removing nodes as necessary.

remove [-f|--force] [--retry] [--deferred] device_name ...

Removes a device. It will no longer be visible to dmsetup. Open devices cannot be removed, but adding --force will replace the table with one that fails all I/O. --deferred will enable deferred removal of open devices - the device will be removed when the last user closes it. The deferred removal feature is supported since version 4.27.0 of the device-mapper driver available in upstream kernel version 3.13. (Use dmsetup version to check this.) If an attempt to remove a device fails, perhaps because a process run from a quick udev rule temporarily opened the device, the --retry option will cause the operation to be retried for a few seconds before failing. Do NOT combine --force and --udevcookie, as udev may start to process udev rules in the middle of error target replacement and result in nondeterministic result.

remove_all [-f|--force] [--deferred]

Attempts to remove all device definitions i.e. reset the driver. This also runs mknodes afterwards. Use with care! Open devices cannot be removed, but adding --force will replace the table with one that fails all I/O. --deferred will enable deferred removal of open devices - the device will be removed when the last user closes it. The deferred removal feature is supported since version 4.27.0 of the device-mapper driver available in upstream kernel version 3.13.

rename device_name new_name

Renames a device.

rename device_name --setuuid uuid

Sets the uuid of a device that was created without a uuid. After a uuid has been set it cannot be changed.

resume device_name ... [--addnodeoncreate|--addnodeonresume] [--noflush] [--nolockfs] [--readahead [+]sectors|auto|none]

Un-suspends a device. If an inactive table has been loaded, it becomes live. Postponed I/O then gets re-queued for processing.

setgeometry device_name cyl head sect start

Sets the device geometry to C/H/S.

splitname device_name [subsystem]

Splits given device name into subsystem constituents. The default subsystem is LVM. LVM currently generates device names by concatenating the names of the Volume Group, Logical Volume and any internal Layer with a hyphen as separator. Any hyphens within the names are doubled to escape them. The precise encoding might change without notice in any future release, so we recommend you always decode using the current version of this command.

stats command [options]

Manages IO statistics regions for devices. See dmstats(8) for more details.

status [--target target_type] [--noflush] [device_name ...]

Outputs status information for each of the device's targets. With --target, only information relating to the specified target type any is displayed. With --noflush, the thin target (from version 1.3.0) doesn't commit any outstanding changes to disk before reporting its statistics.

suspend device_name ... [--nolockfs] [--noflush]

Suspends a device. Any I/O that has already been mapped by the device but has not yet completed will be flushed. Any further I/O to that device will be postponed for as long as the device is suspended. If there's a filesystem on the device which supports the operation, an attempt will be made to sync it first unless --nolockfs is specified. Some targets such as recent (October 2006) versions of multipath may support the --noflush option. This lets outstanding I/O that has not yet reached the device to remain unflushed.

table [--concise] [--target target_type] [--showkeys] [device_name ...]

Outputs the current table for the device in a format that can be fed back in using the create or load commands. With --target, only information relating to the specified target type is displayed. Real encryption keys are suppressed in the table output for crypt and integrity targets unless the --showkeys parameter is supplied. Kernel key references prefixed with : are not affected by the parameter and get displayed always (crypt target only). With --concise, the output is presented concisely on a single line. Commas then separate the name, uuid, minor device number, flags ('ro' or 'rw') and the table (if present). Semi-colons separate devices. Backslashes escape any commas, semi-colons or backslashes. See CONCISE FORMAT below.

targets

Displays the names and versions of the currently-loaded targets.

udevcomplete cookie

Wake any processes that are waiting for udev to complete processing the specified cookie.

udevcomplete_all [age_in_minutes]

Remove all cookies older than the specified number of minutes. Any process waiting on a cookie will be resumed immediately.

udevcookie

List all existing cookies. Cookies are system-wide semaphores with keys prefixed by two predefined bytes (0x0D4D).

udevcreatecookie

Creates a new cookie to synchronize actions with udev processing. The output is a cookie value. Normally we don't need to create cookies since dmsetup creates and destroys them for each action automatically. However, we can generate one explicitly to group several actions together and use only one cookie instead. We can define a cookie to use for each relevant command by using --udevcookie option. Alternatively, we can export this value into the environment of the dmsetup process as DM_UDEV_COOKIE variable and it will be used automatically with all subsequent commands until it is unset. Invoking this command will create system-wide semaphore that needs to be cleaned up explicitly by calling udevreleasecookie command.

udevflags cookie

Parses given cookie value and extracts any udev control flags encoded. The output is in environment key format that is suitable for use in udev rules. If the flag has its symbolic name assigned then the output is DM_UDEV_FLAG_<flag_name> = '1', DM_UDEV_FLAG<flag_position> = '1' otherwise. Subsystem udev flags don't have symbolic names assigned and these ones are always reported as DM_SUBSYSTEM_UDEV_FLAG<flag_position> = '1'. There are 16 udev flags altogether.

udevreleasecookie [cookie]

Waits for all pending udev processing bound to given cookie value and clean up the cookie with underlying semaphore. If the cookie is not given directly, the command will try to use a value defined by DM_UDEV_COOKIE environment variable.

version

Outputs version information.

wait device_name [--noflush] [event_nr]

Sleeps until the event counter for device_name exceeds event_nr. Use -v to see the event number returned. To wait until the next event is triggered, use info to find the last event number. With --noflush, the thin target (from version 1.3.0) doesn't commit any outstanding changes to disk before reporting its statistics.

wipe_table device_name ... [-f|--force] [--noflush] [--nolockfs]

Wait for any I/O in-flight through the device to complete, then replace the table with a new table that fails any new I/O sent to the device. If successful, this should release any devices held open by the device's table(s).

## TABLE FORMAT
Each line of the table specifies a single target and is of the form:

logical_start_sector num_sectors target_type target_args

Simple target types and target args include:

linear destination_device start_sector

The traditional linear mapping.

striped num_stripes chunk_size [destination start_sector] ...

Creates a striped area.

e.g. striped 2 32 /dev/hda1 0 /dev/hdb1 0 will map the first chunk (16 KiB) as follows:

LV chunk 1 → hda1, chunk 1

LV chunk 2 → hdb1, chunk 1

LV chunk 3 → hda1, chunk 2

LV chunk 4 → hdb1, chunk 2

etc.

error

Errors any I/O that goes to this area. Useful for testing or for creating devices with holes in them.

zero

Returns blocks of zeroes on reads. Any data written is discarded silently. This is a block-device equivalent of the /dev/zero character-device data sink described in null(4).

More complex targets include:

cache

Improves performance of a block device (e.g., a spindle) by dynamically migrating some of its data to a faster smaller device (e.g., an SSD).

crypt

Transparent encryption of block devices using the kernel crypto API.

delay

Delays reads and/or writes to different devices. Useful for testing.

flakey

Creates a similar mapping to the linear target but exhibits unreliable behaviour periodically. Useful for simulating failing devices when testing.

mirror

Mirrors data across two or more devices.

multipath

Mediates access through multiple paths to the same device.

raid

Offers an interface to the kernel's software raid driver, md.

snapshot

Supports snapshots of devices.

thin, thin-pool

Supports thin provisioning of devices and also provides a better snapshot support.

To find out more about the various targets and their table formats and status lines, please read the files in the Documentation/device-mapper directory in the kernel source tree. (Your distribution might include a copy of this information in the documentation directory for the device-mapper package.)

## EXAMPLES

```
# A table to join two disks together
0 1028160 linear /dev/hda 0
1028160 3903762 linear /dev/hdb 0

# A table to stripe across the two disks,
# and add the spare space from
# hdb to the back of the volume
0 2056320 striped 2 32 /dev/hda 0 /dev/hdb 0
2056320 2875602 linear /dev/hdb 1028160
```

## CONCISE FORMAT
A concise representation of one of more devices:

- A comma separates the fields of each device.

- A semi-colon separates devices.

The representation of a device takes the form:

<name>,<uuid>,<minor>,<flags>,<table>[,<table>+][;<name>,<uuid>,<minor>,<flags>,<table>[,<table>+]]

The fields are:

name

The name of the device.

uuid

The UUID of the device (or empty).

minor

The minor number of the device. If empty, the kernel assigns a suitable minor number.

flags

Supported flags are:

ro

Sets the table being loaded for the device read-only

rw

Sets the table being loaded for the device read-write (default)

table

One line of the table. See TABLE FORMAT above.

## EXAMPLES

```
# A simple linear read-only device
test-linear-small,,,ro,\
 0 2097152 linear /dev/loop0 0,\
 2097152 2097152 linear /dev/loop1 0

# Two linear devices
test-linear-small,,,,\
 0 2097152 linear /dev/loop0 0;\
 test-linear-large,,,,\
 0 2097152 linear /dev/loop1 0,\
 2097152 2097152 linear /dev/loop2 0
```

## ENVIRONMENT VARIABLES
DM_DEV_DIR

The device directory name. Defaults to "/dev" and must be an absolute path.

DM_UDEV_COOKIE

A cookie to use for all relevant commands to synchronize with udev processing. It is an alternative to using --udevcookie option.

DM_DEFAULT_NAME_MANGLING_MODE

A default mangling mode. Defaults to "auto" and it is an alternative to using --manglename option.

## AUTHORS
Original version: Joe Thornber

## SEE ALSO
dmstats(8), udev(7), udevadm(8)

LVM2 resource page:

Device-mapper resource page:


dmstats

title: dmstats(8)

summary: device-mapper statistics management

text:
# dmstats(8)

## NAME
dmstats — device-mapper statistics management

## SYNOPSIS
dmsetup

stats command [OPTIONS]

dmstats

command device_name|--major major --minor minor|-u|--uuid uuid [-v|--verbose]

dmstats

clear device_name [--allprograms|--programid id] [--allregions|--regionid id]

dmstats

create device_name ...|file_path ...|--alldevices [--areas nr_areas|--areasize area_size] [--bounds histogram_boundaries] [--filemap] [--follow follow_mode] [--foreground] [--nogroup] [--nomonitor] [--precise] [--start start_sector --length length|--segments] [--userdata user_data] [--programid id]

dmstats

delete device_name|--alldevices [--allprograms|--programid id] [--allregions|--regionid id]

dmstats

group [device_name|--alldevices] [--alias name] [--regions regions]

dmstats

help [-c|-C|--columns]

dmstats

list [device_name] [--allprograms|--programid id] [--area] [--group] [--region] [--histogram] [--nosuffix] [--notimesuffix] [--units units]

dmstats

print [device_name] [--clear] [--allprograms|--programid id] [--allregions|--regionid id]

dmstats

report [device_name] [--interval seconds] [--count count] [--units units] [--allprograms|--programid id] [--allregions|--regionid id] [--area] [--group] [--region] [--histogram] [--nosuffix] [--notimesuffix] [--units units] [-O|--sort sort_fields] [-S|--select selection]

dmstats

ungroup [device_name|--alldevices] [--groupid id]

dmstats

update_filemap file_path [--follow follow_mode] [--foreground] [--groupid id] [--nomonitor]

## DESCRIPTION
The dmstats program manages IO statistics regions for devices that use the device-mapper driver. Statistics regions may be created, deleted, listed and reported on using the tool.

The first argument to dmstats is a command.

The second argument is the device name, uuid or major and minor numbers.

Further options permit the selection of regions, output format control, and reporting behaviour.

When no device argument is given dmstats will by default operate on all device-mapper devices present. The create and delete commands require the use of --alldevices when used in this way.

## OPTIONS
--alias name

Specify an alias name for a group.

--alldevices

If no device arguments are given allow operation on all devices when creating or deleting regions.

--allprograms

Include regions from all program IDs for list and report operations.

--allregions

Include all present regions for commands that normally accept a single region identifier.

--area

When performing a list or report, include objects of type area in the results.

--areas nr_areas

Specify the number of statistics areas to create within a new region.

--areasize area_size[b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E]

Specify the size of areas into which a new region should be divided. An optional suffix selects units of: (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalize to use multiples of 1000 (S.I.) instead of 1024.

--bounds histogram_boundaries[ns|us|ms|s]

Specify the boundaries of a latency histogram to be tracked for the region as a comma separated list of latency values. Latency values are given in nanoseconds. An optional unit suffix of ns, us, ms or s may be given after each value to specify units of nanoseconds, microseconds, milliseconds or seconds respectively.

--clear

When printing statistics counters, also atomically reset them to zero.

--count count

Specify the iteration count for repeating reports. If the count argument is zero reports will continue to repeat until interrupted.

--group

When performing a list or report, include objects of type group in the results.

--filemap

Instead of creating regions on a device as specified by command line options, open the file found at each file_path argument, and create regions corresponding to the locations of the on-disk extents allocated to the file(s).

--follow follow_mode

Specify the dmfilemapd(8) file following mode. The file map monitoring daemon can monitor files in two distinct ways: the mode affects the behaviour of the daemon when a file under monitoring is renamed or unlinked, and the conditions which cause the daemon to terminate.

The follow_mode argument is either "inode", for follow-inode mode, or "path", for follow-path.

If follow-inode mode is used, the daemon will hold the file open, and continue to update regions from the same file descriptor. This means that the mapping will follow rename, move (within the same file system), and unlink operations. This mode is useful if the file is expected to be moved, renamed, or unlinked while it is being monitored.

In follow-inode mode, the daemon will exit once it detects that the file has been unlinked and it is the last holder of a reference to it.

If follow-path is used, the daemon will re-open the provided path on each monitoring iteration. This means that the group will be updated to reflect a new file being moved to the same path as the original file. This mode is useful for files that are expected to be updated via unlink and rename.

In follow-path mode, the daemon will exit if the file is removed and not replaced within a brief tolerance interval.

In either mode, the daemon exits automatically if the monitored group is removed.

--foreground

Specify that the dmfilemapd(8) daemon should run in the foreground. The daemon will not fork into the background, and will replace the dmstats command that started it.

--groupid id

Specify the group to operate on.

--histogram

When used with the report and list commands select default fields that emphasize latency histogram data.

--interval seconds

Specify the interval in seconds between successive iterations for repeating reports. If --interval is specified but --count is not, reports will continue to repeat until interrupted.

--length length[b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E]

Specify the length of a new statistics region in sectors. An optional suffix selects units of: (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalize to use multiples of 1000 (S.I.) instead of 1024.

-j|--major major

Specify the major number.

-m|--minor minor

Specify the minor number.

--nogroup

When creating regions mapping the extents of a file in the file system, do not create a group or set an alias.

--nomonitor

Disable the dmfilemapd(8) daemon when creating new file mapped groups. Normally the device-mapper filemap monitoring daemon dmfilemapd(8), is started for each file mapped group to update the set of regions as the file changes on-disk: use of this option disables this behaviour.

Regions in the group may still be updated with the update_filemap command, or by starting the daemon manually.

--nosuffix

Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output.

--notimesuffix

Suppress the suffix on output time values. Histogram boundary values will be reported in units of nanoseconds.

-o|--options

Specify which report fields to display.

--precise

Attempt to use nanosecond precision counters when creating new statistics regions.

--programid id

Specify a program ID string. When creating new statistics regions this string is stored with the region. Subsequent operations may supply a program ID in order to select only regions with a matching value. The default program ID for dmstats-managed regions is "dmstats".

--region

When performing a list or report, include objects of type region in the results.

--regionid id

Specify the region to operate on.

--regions region_list

Specify a list of regions to group. The group list is a comma-separated list of region identifiers. Continuous sequences of identifiers may be expressed as a hyphen separated range, for example: '1–10'.

--relative

If displaying the histogram report show relative (percentage) values instead of absolute counts.

--segments

When used with create, create a new statistics region for each target contained in the given device(s). This causes a separate region to be allocated for each segment of the device.

The newly created regions are automatically placed into a group unless the --nogroup option is given. When grouping is enabled a group alias may be specified using the --alias option.

-S|--select selection

Display only rows that match selection criteria. All rows with the additional "selected" column (-o selected) showing 1 if the row matches the selection and 0 otherwise. The selection criteria are defined by specifying column names and their valid values while making use of supported comparison operators.

-O|--sort sort_fields

Sort output according to the list of fields given. Precede any sort field with '-' for a reverse sort on that column.

--start start[b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E]

Specify the start offset of a new statistics region in sectors. An optional suffix selects units of: (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalize to use multiples of 1000 (S.I.) instead of 1024.

--units [units][h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E]

Set the display units for report output. All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalize to use multiples of 1000 (S.I.) instead of 1024. Can also specify custom units e.g. --units 3M.

--userdata user_data

Specify user data (a word) to be stored with a new region. The value is added to any internal auxiliary data (for example, group information), and stored with the region in the aux_data field provided by the kernel. Whitespace is not permitted.

-u|--uuid

Specify the uuid.

-v|--verbose [-v|--verbose]

Produce additional output.

## COMMANDS
clear device_name [--allprograms|--programid id] [--allregions|--regionid id]

Instructs the kernel to clear statistics counters for the specified regions (with the exception of in-flight IO counters).

create device_name ...|file_path ...|--alldevices [--areas nr_areas|--areasize area_size] [--bounds histogram_boundaries] [--filemap] [--follow follow_mode] [--foreground] [--nogroup] [--nomonitor] [--precise] [--start start_sector --length length|--segments] [--userdata user_data] [--programid id]

Creates one or more new statistics regions on the specified device(s).

The region will span the entire device unless --start and --length or --segments are given. The --start an --length options allow a region of arbitrary length to be placed at an arbitrary offset into the device. The --segments option causes a new region to be created for each target in the corresponding device-mapper device's table.

If the --precise option is used the command will attempt to create a region using nanosecond precision counters.

If --bounds is given a latency histogram will be tracked for the new region. The boundaries of the histogram bins are given as a comma separated list of latency values. There is an implicit lower bound of zero on the first bin and an implicit upper bound of infinity (or the configured interval duration) on the final bin.

Latencies are given in nanoseconds. An optional unit suffix of ns, us, ms, or s may be given after each value to specify units of nanoseconds, microseconds, milliseconds or seconds respectively, so for example, 10 ms is equivalent to 10,000,000. Latency values with a precision of less than one millisecond can only be used when precise timestamps are enabled: if --precise is not given and values less than one millisecond are used it will be enabled automatically.

An optional program_id or user_data string may be associated with the region. A program_id may then be used to select regions for subsequent list, print, and report operations. The user_data stores an arbitrary string and is not used by dmstats or the device-mapper kernel statistics subsystem.

By default dmstats creates regions with a program_id of "dmstats".

On success the region_id of the newly created region is printed to stdout.

If the --filemap option is given with a regular file, or list of files, as the file_path argument, instead of creating regions with parameters specified on the command line, dmstats will open the files located at file_path and create regions corresponding to the physical extents allocated to the file. This can be used to monitor statistics for individual files in the file system, for example, virtual machine images, swap areas, or large database files.

To work with the --filemap option, files must be located on a local file system, backed by a device-mapper device, that supports physical extent data using the FIEMAP ioctl (e.g. Ext4 and XFS).

By default regions that map a file are placed into a group and the group alias is set to the basename of the file. This behaviour can be overridden with the --alias and --nogroup options.

Creating a group that maps a file automatically starts a daemon, dmfilemapd(8) to monitor the file and update the mapping as the extents allocated to the file change. This behaviour can be disabled using the --nomonitor option.

Use the --group option to only display information for groups when listing and reporting.

delete device_name|--alldevices [--allprograms|--programid id] [--allregions|--regionid id]

Delete the specified statistics region. All counters and resources used by the region are released and the region will not appear in the output of subsequent list, print, or report operations.

All regions registered on a device may be removed using --allregions.

To remove all regions on all devices both --allregions and --alldevices must be used.

If a --groupid is given instead of a --regionid the command will attempt to delete the group and all regions that it contains.

If a deleted region is the first member of a group of regions the group will also be removed.

group [device_name|--alldevices] [--alias name] [--regions regions]

Combine one or more statistics regions on the specified device into a group.

The list of regions to be grouped is specified with --regions and an optional alias may be assigned with --alias. The set of regions is given as a comma-separated list of region identifiers. A continuous range of identifiers spanning from R1 to R2 may be expressed as 'R1-R2'.

Regions that have a histogram configured can be grouped: in this case the number of histogram bins and their bounds must match exactly.

On success the group list and newly created group_id are printed to stdout.

The group metadata is stored with the first (lowest numbered) region_id in the group: deleting this region will also delete the group and other group members will be returned to their prior state.

help [-c|-C|--columns]

Outputs a summary of the commands available, optionally including the list of report fields.

list [device_name] [--allprograms|--programid id] [--area] [--group] [--region] [--histogram] [--nosuffix] [--notimesuffix] [--units units]

List the statistics regions, areas, or groups registered on the device. If the --allprograms switch is given all regions will be listed regardless of region program ID values.

By default only regions and groups are included in list output. If -v or --verbose is given the report will also include a row of information for each configured group and for each area contained in each region displayed.

Regions that contain a single area are by default omitted from the verbose list since their properties are identical to the area that they contain - to view all regions regardless of the number of areas present use --region. To also view the areas contained within regions use --area.

If --histogram is given the report will include the bin count and latency boundary values for any configured histograms.

print [device_name] [--clear] [--allprograms|--programid id] [--allregions|--regionid id]

Print raw statistics counters for the specified region or for all present regions.

report [device_name] [--interval seconds] [--count count] [--units units] [--allprograms|--programid id] [--allregions|--regionid id] [--area] [--group] [--region] [--histogram] [--nosuffix] [--notimesuffix] [--units units] [-O|--sort sort_fields] [-S|--select selection]

Start a report for the specified object or for all present objects. If the count argument is specified, the report will repeat at a fixed interval set by the --interval option. The default interval is one second.

If the --allprograms switch is given, all regions will be listed, regardless of region program ID values.

If the --histogram is given the report will include the histogram values and latency boundaries.

If the --relative is used the default histogram field displays bin values as a percentage of the total number of I/Os.

Object types (areas, regions and groups) to include in the report are selected using the --area, --region, and --group options.

ungroup [device_name|--alldevices] [--groupid id]

Remove an existing group and return all the group's regions to their original state.

The group to be removed is specified using --groupid.

update_filemap file_path [--follow follow_mode] [--foreground] [--groupid id] [--nomonitor]

Update a group of dmstats regions specified by group_id, that were previously created with --filemap, either directly, or by starting the monitoring daemon dmfilemapd(8).

This will add and remove regions to reflect changes in the allocated extents of the file on-disk, since the time that it was created or last updated.

Use of this command is not normally needed since the dmfilemapd(8) daemon will automatically monitor filemap groups and perform these updates when required.

If a filemapped group was created with --nomonitor, or the daemon has been killed, the update_filemap can be used to manually force an update or start a new daemon.

Use --nomonitor to force a direct update and disable starting the monitoring daemon.

## REGIONS, AREAS, AND GROUPS
The device-mapper statistics facility allows separate performance counters to be maintained for arbitrary regions of devices. A region may span any range: from a single sector to the whole device. A region may be further sub-divided into a number of distinct areas (one or more), each with its own counter set. In this case a summary value for the entire region is also available for use in reports.

In addition, one or more regions on one device can be combined into a statistics group. Groups allow several regions to be aggregated and reported as a single entity; counters for all regions and areas are summed and used to report totals for all group members. Groups also permit the assignment of an optional alias, allowing meaningful names to be associated with sets of regions.

The group metadata is stored with the first (lowest numbered) region_id in the group: deleting this region will also delete the group and other group members will be returned to their prior state.

By default new regions span the entire device. The --start and --length options allows a region of any size to be placed at any location on the device.

Using offsets it is possible to create regions that map individual objects within a block device (for example: partitions, files in a file system, or stripes or other structures in a RAID volume). Groups allow several non-contiguous regions to be assembled together for reporting and data aggregation.

A region may be either divided into the specified number of equal-sized areas, or into areas of the given size by specifying one of --areas or --areasize when creating a region with the create command. Depending on the size of the areas and the device region the final area within the region may be smaller than requested.

### Region identifiers
Each region is assigned an identifier when it is created that is used to reference the region in subsequent operations. Region identifiers are unique within a given device (including across different program_id values).

Depending on the sequence of create and delete operations, gaps may exist in the sequence of region_id values for a particular device.

The region_id should be treated as an opaque identifier used to reference the region.

### Group identifiers
Groups are also assigned an integer identifier at creation time; like region identifiers, group identifiers are unique within the containing device.

The group_id should be treated as an opaque identifier used to reference the group.

## FILE MAPPING
Using --filemap, it is possible to create regions that correspond to the extents of a file in the file system. This allows IO statistics to be monitored on a per-file basis, for example to observe large database files, virtual machine images, or other files of interest.

To be able to use file mapping, the file must be backed by a device-mapper device, and in a file system that supports the FIEMAP ioctl (and which returns data describing the physical location of extents). This currently includes xfs(5) and ext4(5).

By default the regions making up a file are placed together in a group, and the group alias is set to the basename(3) of the file. This allows statistics to be reported for the file as a whole, aggregating values for the regions making up the group. To see only the whole file (group) when using the list and report commands, use --group.

Since it is possible for the file to change after the initial group of regions is created, the update_filemap command, and dmfilemapd(8) daemon are provided to update file mapped groups either manually or automatically.

### File follow modes
The file map monitoring daemon can monitor files in two distinct ways: follow-inode mode, and follow-path mode.

The mode affects the behaviour of the daemon when a file under monitoring is renamed or unlinked, and the conditions which cause the daemon to terminate.

If follow-inode mode is used, the daemon will hold the file open, and continue to update regions from the same file descriptor. This means that the mapping will follow rename, move (within the same file system), and unlink operations. This mode is useful if the file is expected to be moved, renamed, or unlinked while it is being monitored.

In follow-inode mode, the daemon will exit once it detects that the file has been unlinked and it is the last holder of a reference to it.

If follow-path is used, the daemon will re-open the provided path on each monitoring iteration. This means that the group will be updated to reflect a new file being moved to the same path as the original file. This mode is useful for files that are expected to be updated via unlink and rename.

In follow-path mode, the daemon will exit if the file is removed and not replaced within a brief tolerance interval (one second).

To stop the daemon, delete the group containing the mapped regions: the daemon will automatically shut down.

The daemon can also be safely killed at any time and the group kept: if the file is still being allocated the mapping will become progressively out-of-date as extents are added and removed (in this case the daemon can be re-started or the group updated manually with the update_filemap command).

See the create command and --filemap, --follow, and --nomonitor options for further information.

### Limitations
The daemon attempts to maintain good synchronization between the file extents and the regions contained in the group, however, since it can only react to new allocations once they have been written, there are inevitably some IO events that cannot be counted when a file is growing, particularly if the file is being extended by a single thread writing beyond end-of-file (for example, the dd(1) program).

There is a further loss of events in that there is currently no way to atomically resize a dmstats region and preserve its current counter values. This affects files when they grow by extending the final extent, rather than allocating a new extent: any events that had accumulated in the region between any prior operation and the resize are lost.

File mapping is currently most effective in cases where the majority of IO does not trigger extent allocation. Future updates may address these limitations when kernel support is available.

## REPORT FIELDS
The dmstats report provides several types of field that may be added to the default field set, or used to create custom reports.

All performance counters and metrics are calculated per-area.

### Derived metrics
A number of metrics fields are included that provide high level performance indicators. These are based on the fields provided by the conventional Linux iostat program and are derived from the basic counter values provided by the kernel for each area.

reads_merged_per_sec

Reads merged per second.

writes_merged_per_sec

Writes merged per second.

reads_per_sec

Reads completed per second.

writes_per_sec

Writes completed per second.

read_size_per_sec

Size of data read per second.

write_size_per_sec

Size of data written per second.

avg_request_size

Average request size.

queue_size

Average queue size.

await

The average wait time for read and write operations.

r_await

The average wait time for read operations.

w_await

The average wait time for write operations.

throughput

The device throughput in operations per second.

service_time

The average service time (in milliseconds) for operations issued to the device.

util

Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100%.

### Group, region and area meta fields
Meta fields provide information about the groups, regions, or areas that the statistics values relate to. This includes the region and area identifier, start, length, and counts, as well as the program ID and user data values.

region_id

Region identifier. This is a non-negative integer returned by the kernel when a statistics region is created.

region_start

The region start location. Display units are selected by the --units option.

region_len

The length of the region. Display units are selected by the --units option.

area_id

Area identifier. Area identifiers are assigned by the device-mapper statistics library and uniquely identify each area within a region. Each ID corresponds to a distinct set of performance counters for that area of the statistics region. Area identifiers are always monotonically increasing within a region so that higher ID values correspond to greater sector addresses within the area and no gaps in the sequence of identifiers exist.

area_start

The area start location. Display units are selected by the --units option.

area_len

The length of the area. Display units are selected by the --units option.

area_count

The number of areas in this region.

program_id

The program ID value associated with this region.

user_data

The user data value associated with this region.

group_id

Group identifier. This is a non-negative integer returned by the dmstats group command when a statistics group is created.

interval_ns

The estimated interval over which the current counter values have accumulated. The value is reported as an integer expressed in units of nanoseconds.

interval

The estimated interval over which the current counter values have accumulated. The value is reported as a real number in units of seconds.

### Basic counters
Basic counters provide access to the raw counter data from the kernel, allowing further processing to be carried out by another program.

The kernel provides thirteen separate counters for each statistics area. The first eleven of these match the counters provided in /proc/diskstats or /sys/block/*/*/stat. The final pair provide separate counters for read and write time.

read_count

Count of reads completed this interval.

reads_merged_count

Count of reads merged this interval.

read_sector_count

Count of 512 byte sectors read this interval.

read_time

Accumulated duration of all read requests (ns).

write_count

Count of writes completed this interval.

writes_merged_count

Count of writes merged this interval.

write_sector_count

Count of 512 byte sectors written this interval.

write_time

Accumulated duration of all write requests (ns).

in_progress_count

Count of requests currently in progress.

io_ticks

Nanoseconds spent servicing requests.

queue_ticks

This field is incremented at each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/Os in progress multiplied by the number of milliseconds spent doing I/O since the last update of this field. This can provide an easy measure of both I/O completion time and the backlog that may be accumulating.

read_ticks

Nanoseconds spent servicing reads.

write_ticks

Nanoseconds spent servicing writes.

### Histogram fields
Histograms measure the frequency distribution of user specified I/O latency intervals. Histogram bin boundaries are specified when a region is created.

A brief representation of the histogram values and latency intervals can be included in the report using these fields.

hist_count

A list of the histogram counts for the current statistics area in order of ascending latency value. Each value represents the number of I/Os with latency times falling into that bin's time range during the sample period.

hist_count_bounds

A list of the histogram counts for the current statistics area in order of ascending latency value including bin boundaries: each count is prefixed by the lower bound of the corresponding histogram bin.

hist_count_ranges

A list of the histogram counts for the current statistics area in order of ascending latency value including bin boundaries: each count is prefixed by both the lower and upper bounds of the corresponding histogram bin.

hist_percent

A list of the relative histogram values for the current statistics area in order of ascending latency value, expressed as a percentage. Each value represents the proportion of I/Os with latency times falling into that bin's time range during the sample period.

hist_percent_bounds

A list of the relative histogram values for the current statistics area in order of ascending latency value, expressed as a percentage and including bin boundaries. Each value represents the proportion of I/Os with latency times falling into that bin's time range during the sample period and is prefixed with the corresponding bin's lower bound.

hist_percent_ranges

A list of the relative histogram values for the current statistics area in order of ascending latency value, expressed as a percentage and including bin boundaries. Each value represents the proportion of I/Os with latency times falling into that bin's time range during the sample period and is prefixed with the corresponding bin's lower and upper bounds.

hist_bounds

A list of the histogram boundary values for the current statistics area in order of ascending latency value. The values are expressed in whole units of seconds, milliseconds, microseconds or nanoseconds with a suffix indicating the unit.

hist_ranges

A list of the histogram bin ranges for the current statistics area in order of ascending latency value. The values are expressed as "LOWER-UPPER" in whole units of seconds, milliseconds, microseconds or nanoseconds with a suffix indicating the unit.

hist_bins

The number of latency histogram bins configured for the area.

## EXAMPLES
Create a whole-device region with one area on vg00/lvol1

\# dmstats create vg00/lvol1

```
vg00/lvol1: Created new region with 1 area(s) as region ID 0
```

Create a 32 MiB region 1 GiB into device d0

\# dmstats create --start 1G --length 32M d0

```
d0: Created new region with 1 area(s) as region ID 0
```

Create a whole-device region with 8 areas on every device

\# dmstats create --areas 8

```
vg00-lvol1: Created new region with 8 area(s) as region ID 0
vg00-lvol2: Created new region with 8 area(s) as region ID 0
vg00-lvol3: Created new region with 8 area(s) as region ID 0
vg01-lvol0: Created new region with 8 area(s) as region ID 2
vg01-lvol1: Created new region with 8 area(s) as region ID 0
vg00-lvol2: Created new region with 8 area(s) as region ID 1
```

Delete all regions on all devices

\# dmstats delete --alldevices --allregions

Create a whole-device region with areas 10 GiB in size on vg00/lvol1 using dmsetup

\# dmsetup stats create --areasize 10G vg00/lvol1

```
vg00-lvol1: Created new region with 5 area(s) as region ID 1
```

Create a 1 GiB region with 16 areas at the start of vg00/lvol1

\# dmstats create --start 0 --len 1G --areas=16 vg00/lvol1

```
vg00-lvol1: Created new region with 16 area(s) as region ID 0
```

List the statistics regions registered on vg00/lvol1

\# dmstats list vg00/lvol1

```
Name         RgID RStart  RSize  #Areas ASize  ProgID
vg00-lvol1    0    0      61.00g  1     61.00g dmstats
vg00-lvol1    1   61.00g  19.20g  1     19.20g dmstats
vg00-lvol1    2   80.20g   2.14g  1      2.14g dmstats
```

Display five statistics reports for vg00/lvol1 at an interval of one second

\# dmstats report --interval 1 --count 5 vg00/lvol1

\# dmstats report

```
Name        RgID ArID AStart ASize  RRqM/s WRqM/s R/s →
vg00-lvol1   0    0    0    61.00g  0.00   0.00  0.00
vg00-lvol1   1    0  61.00g 19.20g  0.00   0.00  0.00
vg00-lvol1   2    0  80.20g  2.14g  0.00   0.00  0.00

→ W/s  RSz/s  WSz/s   AvRqSz  QSize Util% AWait RdAWa WrAWa
218.00 0.00     1.04m   4.50k 2.97  81.70 13.62 0.00  13.62
  5.00 0.00   548.00k 109.50k 0.14  11.00 27.40 0.00  27.40
 14.00 0.00     1.15m  84.00k 0.39  18.70 27.71 0.00  27.71
```

Create one region for reach target contained in device vg00/lvol1

\# dmstats create --segments vg00/lvol1

```
vg00-lvol1: Created new region with 1 area(s) as region ID 0
vg00-lvol1: Created new region with 1 area(s) as region ID 1
vg00-lvol1: Created new region with 1 area(s) as region ID 2
```

Create regions mapping each file in the directory images/ and place them into separate groups, each named after the corresponding file.

\# dmstats create --filemap images/*

```
images/vm1.qcow2: Created new group with 87 region(s) as group ID 0.
images/vm1-1.qcow2: Created new group with 8 region(s) as group ID 87.
images/vm2.qcow2: Created new group with 11 region(s) as group ID 95.
images/vm2-1.qcow2: Created new group with 1454 region(s) as group ID 106.
images/vm3.img: Created new group with 2 region(s) as group ID 1560.
```

Print raw counters for region 4 on device d0

\# dmstats print --regionid 4 d0

```
2097152+65536 0 0 0 0 29 0 264 701 0 41 701 0 41
```

## AUTHORS
Bryn M. Reeves

## SEE ALSO
dmfilemapd(8), dmsetup(8),

ext4(5), xfs(5)

LVM2 resource page:

Device-mapper resource page:

Device-mapper statistics kernel documentation

Documentation/device-mapper/statistics.txt


dnet

package: dnet

title: dnet(8)

summary: dumb networking library test program

text:
# dnet(8)

## NAME
dnet — dumb networking library test program

## SYNOPSIS
dnet command args [...]

## DESCRIPTION
dnet is a simple test program for the dnet(3) library. It can be used to compose and transmit network datagrams as a Unix-style filter (e.g. reading from or writing to files and pipes) or modify the local system network configuration (including the ARP cache, firewall ruleset, network interfaces, and routing table).

### Payload generation commands
addr address [...]

Convert the address (specified as a hostname, IP address, or MAC address) into its binary representation on standard output.

hex string [...]

Convert the C-style escaped string (shellcode, for instance) into its binary representation on standard output.

rand len

Write len random bytes to standard output.

### Packet encapsulation commands
eth [type type] [src mac] [dst mac]

Prepend the data read from standard input with an Ethernet header on standard output. The Ethernet type may be specified as ‘arp’, ‘ip’, or as a hex, octal, or decimal number.

arp [op op] [sha mac] [spa host] [tha mac] [tpa host]

Prepend the data read from standard input with an ARP header on standard output. The ARP op may be specified as ‘req’, ‘rep’, ‘revreq’, ‘revrep’, or as a hex, octal, or decimal number.

ip [tos num] [id num] [off offset] [ttl num] [proto protocol] [src host] [dst dst]

Prepend the data read from standard input with an IP header on standard output. The fragmentation offset may be specified as a decimal number (optionally concatenated with ‘+’ to indicate more fragments) or as a hex number. The protocol may be specified by name, or as a hex, octal, or decimal number.

icmp [type num] [code num]

Prepend the data read from standard input with an ICMP header on standard output.

tcp [sport port] [dport port] [flags flags] [seq num] [ack num] [win num] [urp num]

Prepend the data read from standard input with a TCP header on standard output. A port may be specified by name or hex, octal, or decimal number. The TCP flags may be specified as some combination of the characters in the set ‘SAFRPU’ or as a hex number.

udp [sport port] [dport port]

Prepend the data read from standard input with a UDP header on standard output. A port may be specified by name or hex, octal, or decimal number.

### Packet transmission commands
send [device]

Read a packet from standard input and send it over the network. If no device is specified, the packet is assumed to be an IP datagram and routed to its destination. Otherwise, the packet is assumed to be an Ethernet frame and is transmitted on the specified interface.

### Kernel interface commands
arp show

Display the kernel ARP cache.

arp get host

Display the kernel ARP entry for host.

arp add host mac

Add an ARP entry mapping the mac address for host.

arp delete host

Delete the ARP entry for host.

fw show

Display the kernel firewall ruleset.

fw add|delete action direction device protocol src[:port[-max]] dst[:port[-max]] [type[/code]]

Add a rule to or delete a rule from the active firewall ruleset. The action must be either ‘allow’ or ‘block’. The direction must be either ‘in’ or ‘out’. The device may specify an interface name, or ‘any’. The protocol may be specified by name, or as a decimal number. For TCP and UDP protocols, a port (or range, if specified with a max value) may be specified in decimal and appended to the source and/or destination address. For ICMP, a type (and optional code) may be specified in decimal.

intf show

Display the configuration of all network interfaces.

intf get device

Display the configuration for the interface specified by device.

intf set device [alias host] [dst host] [inet host] [link mac] [up|down] [arp|noarp]

Configure the interface specified by device.

route show

Display the kernel routing table.

route get dst

Display the route for the destination dst, specified as a hostname, IP address, or network prefix in CIDR notation.

route add dst gw

Add a route for the destination dst through the gateway gw.

route delete dst

Delete the route for the destination dst.

## EXAMPLES
Send a UDP datagram containing random shellcode:

```
dnet hex "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89" \
"\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80" \
"\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh" | \
dnet udp sport 555 dport 666 | \
dnet ip proto udp src 1.2.3.4 dst 5.6.7.8 | dnet send
```

Save an ARP request in a file and send it twice:

```
dnet arp op req sha 0:d:e:a:d:0 spa 10.0.0.3 tpa 10.0.0.4 | \
dnet eth type arp src 0:d:e:a:d:0 dst ff:ff:ff:ff:ff:ff > arp.pkt
dnet send fxp0 < arp.pkt
dnet send fxp0 < arp.pkt
```

Send a fragmented ping packet:

```
# Create ping packet with IP header, to set ICMP checksum
echo "monkey monkey monkey monkey" | dnet icmp type 8 code 0 | \
dnet ip proto icmp src 1.2.3.4 dst 5.6.7.8 > ping.pkt

# Chop off IP header
dd if=ping.pkt of=ping.data bs=20 skip=1

# Fragment IP payload
split -b 24 ping.data p.

# Send fragments
dnet ip id 1 off 0+ proto icmp src 1.2.3.4 dst 5.6.7.8 < p.aa | \
dnet send
dnet ip id 1 off 24 proto icmp src 1.2.3.4 dst 5.6.7.8 < p.ab | \
dnet send
```

## SEE ALSO
dnet(3)

## AUTHORS
Dug Song ⟨dugsong@monkey.org⟩

Oliver Falk ⟨oliver@linux-kernel.at⟩