---
name: "dev_mkdb"
section: "8"
platform: "macos"
package: "diskdev_cmds"
version: "757"
release: "macOS 26.5"
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 [db(3)](/db/3.md) hash access method 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 zero'd 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), [db(3)](/db/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.4BSD.
