---
name: "getdiskbyname"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/getdiskbyname"
---

# getdiskbyname(3)

get generic disk description by its name

## NAME

**getdiskbyname** – get generic disk description by its name

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<sys/disklabel.h\>**

*struct* *disklabel* *\**\

**getdiskbyname**(*const char \*name*);

## DESCRIPTION

The **getdiskbyname**() function takes a disk name (e.g. ‘rm03’) and returns a prototype disk label describing its geometry information and the standard disk partition tables. All information is obtained from the [disktab(5)](/disktab/5.md) file.

## SEE ALSO

[disktab(5)](/disktab/5.md), [disklabel(8)](/disklabel/8.md)

## HISTORY

The **getdiskbyname**() function appeared in 4.3BSD.
