Fstab is valid for any Linux OS: Debian, Mandrake, Mandriva and Suse and more. The function contains data about fstab mount options in file systems, where and with what options to combine them. For NFS, it contains the server name and directory exported to that server, the local directory that is the build point, and other NFS-specific options that control the quality of the process.
FSTAB knowledge and capabilities
To work with the function, first of all, determine the device on which the partition is located. For a SATA drive, the first is called sda, the second is sdb, and so on. The partitions for the first disk are named sda1 and sda2. For an IDE disk, the nomenclature will be hda, hdb, and partitions hda1, hda2. The descriptors for all devices and their respective partitions are located in the /dev directory. To determine which partitions to mount, use the fdisk tool as a probing argument. To view partitions, for example, from an sda disk, write:
fdisk /dev/sda.
Using fdisk, you canhandle partitions in a flexible and safe way. By entering p, a list of partitions will appear. For example.

After identification, use the fstab mount option. The structure of this file uses a special syntax. The lines consist of six separated fields with their own value: space, tab or combination.

The path to the descriptor will be /dev/sda3, the first field will be the route, the second will be the directory where you want to mount the partition, for example, in /media/DATOS. The filesystem of this partition is ntfs fstab-mount and will be listed in the third field. The fourth field lists mounting options. The fifth and sixth fields leave 0.
Man pages option

If you specify the Auto option, the partition will be mounted at system startup, but there is also the opposite option noauto. Exec is added if one is interested in executing binaries on a partition. They need to be programmed and executed, the opposite option is noexec.
When mounting a Rw partition, if you want the partition to be readable, use the corresponding ro parameter. The uid option of the fstab mount specifies how OS users have access to file staging. You can check which number corresponds to each user by examining the file /etc/passwd.
Similarly to the previous parameter, Gid refers to a group of users. You can see the gid group in /etc/groups. Fmask is the umask for the partition you wantmount. This way you can specify the permissions they will have. Because the data partition is owned by the user, it is given the same permissions as home by default, readable and writable by the owner specified in the uid to be readable by users of the same group specified in the file's git.
Dmask is the same as the previous fstab mount option, but in this case it refers to directories. To open a directory, the user will need execute permissions similar to files.
Mount order

In order to run the function, use the mount order, in which you will need to pass the argument a and build what is in fstab when mounting disks. To do this, write:
$ sudo umount –a.
To parse a device that is in use, check which process is doing it with the fuse instruction and the partition descriptor as follows:
$ sudo fuse -m /dev/sda3.
The instruction will show the PID of the processes that occupy the partition. It can be destroyed, disassembled and reassembled with:
$ sudo kill -9 7418$ sudo umount -a$ sudo mount -a.
Go to the section and check if the permissions are correct with a ls. This process will mount files with the same permission as Home in order for them to be integrated.
Automatic fstab function

The /etc/fstab file is used forsetting the cifs fstab mount scheme and integrating partitions, various block devices or remote files into the system, described on a separate line. These definitions are converted by systemd into dynamic built modules at startup and after configuration is reloaded by the system administrator.
The file is read by the mount command, it is enough to find any of the directories or devices specified in the file to complete the value of the next parameter. This applies the mounting options listed in fstab.
After that, you can see the structure, and then understand the parameters of each element.
- Device.
- Fstab folder mount point.
- File system.
- Settings.
- Dump.
- Revision.
Device Since everything is a file in Linux, fstab is no exception. This is a file that points to the physical device to be mounted and is located in the /dev directory, can be hd, sd, fd or others.
Assembly point and system
Assembly point is a directory that allows you to see and manage what the physical device contains.

File system, interpretation algorithm to be used to read data:
- EXT4 is the current Linux system with high performance and security.
- EXT3 is a Linux system that allows registration.
- EXT2 is an old Linux system that has no records and is hardly used anymore.
- NTFS - systemWindows used from NT to current 7.
- VFAT - Windows system used from 95, known as FAT32, also used in USB and useful for PC communication if both systems are installed.
- NFS is the system used by SUN or Solaris.
- ISO9660 is the system used on CDs and DVDs.
- JFS is an IBM file system that uses records.
- SWAP is the Exchange memory system used in Linux.
- XFS is the system used by Silicon Graphics.
- UFS is the system used by BSD.
Mount Options

Options are the options that will be used to mount the specified device.
Types of options:
- Async - asynchronous data writing.
- Sync - synchronous recording.
- Auto - will be installed automatically.
- Exec - has executable programs.
- Gid - specifies the group ID.
- Noauto - not mounted automatically, used on removable media.
- Nouser - mounts only root.
- Ro - read only.
- Rw - reading and writing.
- Suid - Allows the use of setuid bits, which are poorly managed and can compromise system security.
- Uid - sets filesystem user ID.
- Umask - allows you to place a mask so that other users cannot access the mounted system.
- Dump - the command that is used to create backups, can only be 0or 1 if it is zero, it does not backup, and if it is one, it is done using the dump command.
- Revision - a bit that allows you to determine whether this device will be revised or not during the creation of fsck; as in the previous option, 0 - does nothing, 1 - does.
Section identification
The advantage of using labels and UUIDs is that they are independent of the order in which devices are physically connected to the machine. This is useful if the user changes the BIOS storage order or connection scheme. There are three ways to identify a section:
- by descriptive kernel name;
- by label;
- by UUID.
Sometimes it also happens that the BIOS changes the order of storage devices.
To show basic information about partitions, run the code:
$ lsblk –f.
Kernel name, Run lsblk -f, displays a list of partitions and sets the display name. Execute lsblk -f to display a list of partitions and place the display label.
Execute a command to display a list of partitions and put the display block ID number preceded by the UUID=prefix. If you only need to know the UUID of a specific partition, enter:
$ lsblk -no UUID /dev/sda2.

Building Systemd modules
Building on systems like RedHat relies on manipulating the /etc/fstab file. Version 7 of systemd shares the responsibility of build administration. To the user if he wants to manage buildswithout a threat to integrity, it is recommended to view the official documentation. The first thing to study is the systemd manual, as it refers to points more commonly known as mount units.
Mount point configured using single files and designated in /etc/fstab; there will be a dynamic conversion to points at system startup or dynamically when the system manager is loaded.
Installation blocks:
- What=(what) - absolute path to the device, file or other resource to mount.
- Where=(where) - absolute path to mount device, file or resource. It cannot be a symbolic link. If the assemblage point does not exist prior to the assembly, it is created at that point. It is important to know that this mount name must match the filename.
- Type=(type) - this option is not required, it just specifies the type of filesystem to be mounted.
There are other options that are worth exploring carefully if you need to manage precise mount points.
To see the unit files, use the find command and define location paths. Routes in systemd matter, in this case, it's the transformation. In other words, it generates files in the /run/systemd/generator path for configurations that are not native to systemd.
In order to understand the procedure, it is recommended to read the manual on the terminal:
man systemd-fstab-generatorman systemd.generator
Syntax for nfs
To collectNFS, on the server write /usr/local/pub/pub nfs rsize=8190, wsize=83000, timeo=16, intr
There are fstab mount options:
- Resize=n, the number of bytes used to read files on NFS. The default value is kernel dependent, currently the default is 1024 bytes. Performance increases significantly if you request rsize=8192.
- Wsize=n, the number of bytes used to write files. The default value depends on the kernel, currently it is 1024 bytes, performance is greatly improved by setting wsize=8192.
- Acregmin=n, the minimum time in seconds that the system will wait before updating the attributes of a regular file from the server. The default is 3 seconds.
- Acregmax=n, the maximum time in seconds the system can wait for a normal file's attributes to be updated from the server. The default value is 60 seconds.
- Acdirmin=n, the minimum time in seconds that the system will wait for the directory attributes to be updated from the server. The value is 30 seconds.
- Retry=n, tells how many times to retry NFS mount operation, default value is 10000 times.
- Nam n=n, option used when NFS server does not support version 2.
- RPC assembly protocol. This option can be used to specify a maximum length for filenames greater than the remote filesystem. It is used to support POSIX pathconf functions, the default value isis 255 characters.
- Port=n, the port number to use to connect to the NFS server if port is 0 by default. The system asks what port the remote machine's portmapper is using if the NFS machine is not registered with the portmapper.
- Mount port=n, numerical value of mountd port.
- Mount host=name, name of the machine running mountd.
- Mountprog=n, uses alternate RPC program number.
Tips & Tricks

If the user decides they no longer want to use the fstab configuration, they can perform a restore. To do this, open a terminal window and enter the following commands:
cd/etc/sudo rm fstabsudo cp/etc/backup/fstab/etc /.
Running these commands will remove the modified fstab file and put a copy of the backup file in its place. After that just restart the machine.
Before editing system files, make a backup copy. Nano will back up and automatically mount fstab.
To edit a file in Ubuntu run:
gksu gedit /etc/fstab.
To edit a file in Kubuntu run:
kdesu kate / etc / fstab.
To edit a file directly in the terminal run:
sudo nano -W /etc/fstab.
To view the contents of /etc/fstab, execute the following terminal command:
sudo -e /etc/fstab.
To get a list of all UUIDs, use one of the followingtwo teams:
sudo blkidls -l /dev/disk/by-uuid.
To list the drives and corresponding partitions that are connected to the system, run:
sudo fdisk -l.
To mount all filesystems in /etc/fstab run:
sudo mount -a.
Remember that the mount point must already exist, otherwise the entry will not be mounted on the file system. To create a new point, use root privileges to create the point, for example:
sudo mkdir /path/to/mountpointsudo mkdir /media/disk2.
One of the most common questions from GNU/Linux users is about automatic fstab cifs mounting, partition assembly and partition permissions. Assembly orders and their options are stored in /etc/fstab.
Normally when installing distributions such as Ubuntu, partition assembly lines are generated automatically in a general way. Fstab is not only Linux, the function works on different platforms.