• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

genfstab: command not found

by Deepika

genfstab is a command-line tool that is part of the Arch Linux installation process. It’s used to generate an output that is suitable for addition to an fstab file. The fstab file is a system configuration file that contains information about the file systems that should be mounted at boot time.

When you install Arch Linux, you need to create an fstab file that lists the file systems that should be mounted on the system. This is typically done during the installation process by running the command genfstab -U /mnt >> /mnt/etc/fstab. This will generate the fstab file for the installed system, listing all the file systems that are currently mounted under the /mnt directory.

The -U flag is used to include the UUID of the partitions in the fstab file, this is useful as it allows you to mount partitions by UUID rather than by device name. This is useful as it allows you to mount partitions even if the device name changes. The genfstab script can also be used to generate an fstab file after the installation is complete, you can run the command genfstab -U / >> /etc/fstab to generate the fstab file for the currently running system.

It’s important to note that the fstab file should be reviewed before adding it to the system, as it may contain errors or inaccuracies. Also, it’s important to understand the options used in the fstab file, such as the file system type, the options and the dump frequency.

If you encounter the below error while running the command genfstab:

genfstab: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install arch-install-scripts
Ubuntu apt-get install arch-install-scripts
Alpine apk add arch-install-scripts
Arch Linux pacman -S arch-install-scripts
Kali Linux apt-get install arch-install-scripts
Fedora dnf install arch-install-scripts

genfstab Command Examples

1. Display an fstab compatible output based on a volume label:

# genfstab -L path/to/mount_point

2. Display an fstab compatible output based on a volume UUID:

# genfstab -U path/to/mount_point

3. A usual way to generate an fstab file, requires root permissions:

# genfstab -U /mnt >> /mnt/etc/fstab

4. Append a volume into an fstab file to mount it automatically:

# genfstab -U path/to/mount_point | sudo tee -a /etc/fstab

Summary

In summary, genfstab is a command-line tool that is used to generate an output suitable for addition to an fstab file. It’s used during the Arch Linux installation process to create an fstab file that lists the file systems that should be mounted on the system at boot time. It’s also useful after the installation process to generate the fstab file for the currently running system.

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to use compress, zip, gzip commands under Linux
  2. modprobe Command Options
  3. How to Verify the Syntax of the file /etc/ssh/sshd_config
  4. apt Command Examples in Linux
  5. asciiart Command Examples in Linux
  6. How to Configure Automatic Package Updates on the Server in CentOS/RHEL 8
  7. How to monitor the Mounting/Umounting of Mount Points Using Auditd on CentOS/RHEL 6,7
  8. UNIX / Linux : What is the correct permission of /tmp and /var/tmp directories
  9. keyctl: command not found
  10. Understanding the /etc/rsyslog.conf file for configuring System Logging

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright