LinuxCommandLibrary

genfstab

Generate output suitable for addition to an fstab file.

TLDR

Display an fstab compatible output based on a volume label

$ genfstab -L [path/to/mount_point]
copy


Display an fstab compatible output based on a volume UUID
$ genfstab -U [path/to/mount_point]
copy


A usual way to generate an fstab file, requires root permissions
$ genfstab -U [/mnt] >> [/mnt/etc/fstab]
copy


Append a volume into an fstab file to mount it automatically
$ genfstab -U [path/to/mount_point] | sudo tee -a /etc/fstab
copy

SYNOPSIS

genfstab [options] root

DESCRIPTION

genfstab helps fill in an fstab file by autodetecting all the current mounts below a given mountpoint and printing them in fstab-compatible format to standard output. It can be used to persist a manually mounted filesystem hierarchy and is often used during the initial install and configuration of an OS.

OPTIONS

-f <filter>

Restrict output to mountpoints matching the prefix filter.

-L

Use labels for source identifiers (shortcut for -t LABEL).

-p

Exclude pseudofs mounts (default behavior).

-P

Include pseudofs mounts.

-t <tag>

Use tag for source identifiers (should be one of: LABEL, UUID, PARTLABEL, PARTUUID).

-U

Use UUIDs for source identifiers (shortcut for -t UUID).

-h

Output syntax and command line options.

BUGS

Bugs can be reported on the bug tracker https://bugs.archlinux.org in the Arch Linux category and title prefixed with [arch-install-scripts] or via arch-projects@archlinux.org.

AUTHORS

Maintainers:

·

Dave Reisner <dreisner@archlinux.org>

·

Eli Schwartz <eschwartz@archlinux.org>

For additional contributors, use git shortlog -s on the arch-install-scripts.git repository.

SEE ALSO

pacman(1)

Copied to clipboard