---
name: "geom_zero"
section: "4"
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/geom_zero"
---

# geom\_zero(4)

GEOM-based zero disk/block device

## NAME

**gzero**, **geom\_zero** – GEOM-based zero disk/block device

## SYNOPSIS

**options GEOM\_ZERO**

In [loader.conf(5)](/loader.conf/5.md) or [sysctl.conf(5)](/sysctl.conf/5.md): **kern.geom.zero.byte** **kern.geom.zero.clear**

## DESCRIPTION

**gzero** is a [GEOM(4)](/GEOM/4.md) device simulating a one-exabyte disk. It throws away any data written to it, and returns the value of *kern.geom.zero.byte* for every byte read from it.

**gzero** differs from [zero(4)](/zero/4.md), which is a regular character device and has an infinite length, while */dev/gzero* is a [GEOM(4)](/GEOM/4.md) provider of large, but limited, size.

Consult [geom(8)](/geom/8.md) for instructions on how to use the supported commands of the [GEOM(4)](/GEOM/4.md) **ZERO** class.

**gzero** is useful for benchmarking performance of GEOM and GEOM classes where compression of the data does not affect the results (blocks from */dev/gzero* compress exceptionally well). Examples of such benchmarks include comparing the speed of two disk encryption algorithms and comparing a hardware versus software implementation of a single encryption algorithm.

## MIB VARIABLES

The following variables are available as both [sysctl(8)](/sysctl/8.md) variables and [loader(8)](/loader/8.md) tunables:

- *kern.geom.zero.byte*

  This variable sets the fill byte of the **gzero** device. Default: ‘0’.

- *kern.geom.zero.clear*

  This variable controls the clearing of the read data buffer. If set to ‘0’, **gzero** will not copy any data into the read data buffers and just return the read data buffers as they are without modifying them. In particular, it will not fill the read buffer with the value of *kern.geom.zero.byte*. This is useful for read benchmarking to reduce the measurement noise caused by extra memory initialization. Default: ‘1’.

## FILES

- */dev/gzero*

  The **gzero** device.

## EXAMPLES

Create the */dev/gzero* device by loading the **geom\_zero** kernel module:

```
# geom zero load
```

Show information about the **gzero** device:

```
# geom zero list
Geom name: gzero
Providers:
1. Name: gzero
   Mediasize: 1152921504606846976 (1.0E)
   Sectorsize: 512
   Mode: r0w0egzero0
```

Set the fill byte of the **gzero** device to 70 (decimal for letter “F” in [ascii(7)](/ascii/7.md)):

```
# sysctl kern.geom.zero.byte=70
kern.geom.zero.byte: 0 -> 70
# head -c 1 /dev/gzero
F
```

Benchmark read and write throughput of [geli(8)](/geli/8.md)'s default encryption algorithm with a 4-KiB sector size:

```
# geom zero load
# geli onetime -s 4096 gzero
# sysctl kern.geom.zero.clear=0
# dd if=/dev/gzero.eli of=/dev/zero bs=4k count=$((1024 * 256))
262144+0 records in
262144+0 records out
1073741824 bytes transferred in 1.258195 secs (853398307 bytes/sec)
# dd if=/dev/zero of=/dev/gzero.eli bs=4k count=$((1024 * 256))
262144+0 records in
262144+0 records out
1073741824 bytes transferred in 1.663118 secs (645619658 bytes/sec)
```

## SEE ALSO

[GEOM(4)](/GEOM/4.md), [zero(4)](/zero/4.md), [geom(8)](/geom/8.md), [sysctl(8)](/sysctl/8.md), [bio(9)](/bio/9.md)

## HISTORY

A **gzero** device first appeared in FreeBSD 6.

## AUTHORS

The **gzero** device was written by Paweł Jakub Dawidek ⟨*pjd@FreeBSD.org*⟩.

The **gzero** manual page was originally written by Greg White ⟨*gkwhite@gmail.com*⟩ and rewritten by Mateusz Piotrowski ⟨*0mp@FreeBSD.org*⟩ before landing in FreeBSD.
