GENFSTAB(8) System Manager's Manual GENFSTAB(8)

genfstab — write an fstab for what is mounted

genfstab [-d] mountpoint

genfstab prints an fstab(5) for the file systems mounted at and below mountpoint, with paths relative to it. Pseudo file systems and loop devices are left out. Every swap partition the running system can see is added, and so are fixed lines for /dev/pts, /dev/shm and the EFI variables.

File systems are named by UUID, so the table keeps working when disks are renamed. /boot/efi is mounted nodev, noexec and /tmp nosuid, nodev; everything is noatime.

Name file systems by device path, such as /dev/nvme0n1p2, instead of UUID.

In the installer:

# genfstab /mnt > /mnt/etc/fstab

On a running system, to copy lines from:

# genfstab / > /etc/fstab.new

fstab(5), installation(7)

Run from a system that has swap of its own, the swap lines include it.

September 27, 2026 setup 1.0