genfstab
/etc/fstab generator from mounted filesystems
TLDR
SYNOPSIS
genfstab [options] root
DESCRIPTION
genfstab generates output suitable for an /etc/fstab file by detecting mounted filesystems under a given root directory. It's primarily used during Arch Linux installation to create the fstab file for a new system.The tool reads mount information from /proc/self/mountinfo and outputs proper fstab entries with the appropriate source identifiers (UUID, LABEL, etc.), mount points adjusted relative to the specified root, filesystem types, and mount options.Using UUIDs (-U) is recommended as they remain stable across hardware changes, unlike device names like /dev/sda1 which can change.
PARAMETERS
-U
Use UUIDs for source identifiers-L
Use filesystem labels for source identifiers-t TAG
Use specified tag: LABEL, UUID, PARTLABEL, or PARTUUID-f FILTER
Restrict output to mountpoints matching the given prefix filter.-p
Exclude pseudofs mounts (default behavior).-P
Include pseudofs mounts.-h
Display usage and options.
INSTALL
CAVEATS
Must be run with appropriate permissions to read mount information. The target filesystems must be mounted before running genfstab. Verify the output before writing to /etc/fstab, as incorrect entries can prevent system boot.
HISTORY
genfstab is part of the arch-install-scripts package, developed for Arch Linux installation. It simplifies fstab creation, which was traditionally done manually or with less reliable methods. The tool has been adopted by other Arch-based distributions.
