---
name: "dev_mkdb"
section: "8"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["openbsd", "macos"]
url: "https://new.carta.tech/dev_mkdb"
---

# dev\_mkdb(8)

create /dev database

## NAME

**dev\_mkdb** – create /dev database

## SYNOPSIS

**dev\_mkdb**

## DESCRIPTION

The **dev\_mkdb** command creates a [hash(3)](/hash/3.md) access method Berkeley database in “*/var/run/dev.db*” which contains the names of all of the character and block special files in the “*/dev*” directory, using the file type and the *st\_rdev* field as the key.

Keys are a structure containing a *mode\_t* followed by a *dev\_t*, with any padding zeroed out. The former is the type of the file (*st\_mode* & S\_IFMT), the latter is the *st\_rdev* field.

## FILES

- */dev*

  device directory

- */var/run/dev.db*

  database file

## SEE ALSO

[ps(1)](/ps/1.md), [stat(2)](/stat/2.md), [dbopen(3)](/dbopen/3.md), [devname(3)](/devname/3.md), [kvm\_nlist(3)](/kvm_nlist/3.md), [ttyname(3)](/ttyname/3.md), [kvm\_mkdb(8)](/kvm_mkdb/8.md)

## HISTORY

The **dev\_mkdb** command appeared in 4.3BSD-Net/2.
