Translation(s): English - Français - Italiano - Русский - Español


El fstab (/etc/fstab o tabla de sistemas de archivos) es un archivo de configuración del sistema en sistemas Debian. El archivo fstab normalmente enumera todos los discos y las particiones de disco disponible, e indica la forma en que han de ser inicializado o integrada de otro modo en el sistema de archivos del sistema en general.

Ejemplo

# <file system>        <dir>         <type>    <options>             <dump> <pass>
/dev/sda1              /             ext4      defaults              1      1
/dev/hdxx              /usr          ext4      defaults              1      1
/dev/sda5              swap          swap      defaults              0      0

No es necesario listar /proc y /sys en el fstab a menos que se necesiten algunas opciones especiales. El sistema de arranque siempre los montará.

Definiciones de campos

/etc/fstab contiene los siguientes campos separados por un espacio o tab:

<file system>   <dir>   <type>  <options>       <dump>  <pass>

Definiendo sistemas de archivos

You can define the filesystems in the /etc/fstab configuration in three different ways: by kernel naming descriptors, by UUID, or by labels. The advantage of using UUIDs or labels is that they are not dependent on disk order. This is useful if you change your storage device order in the BIOS, you switch storage device cabling, or because some BIOS's may occasionally change the order of storage devices.

LVM snapshots can result in duplicate UUIDs and labels, so LVM logical volumes should always be identified by logical volume name (/dev/mapper/name).

Nomenclatura del kernel

You can get kernel naming descriptors using fdisk:

# fdisk -l
...
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       19458   156290016+  83  Linux

An example /etc/fstab using the kernel naming:

# <file system>        <dir>         <type>    <options>             <dump> <pass>
/dev/sda1              /             ext4      defaults              1      1

UUIDs

UUIDs are generated by the make-filesystem utilities (mkfs.*) when you create a filesystem. blkid will show you the UUIDs of mounted devices and partitions:

# blkid
/dev/sda1: UUID="6a60524d-061d-454a-bfd1-38989910eccd" TYPE="ext4"

An example /etc/fstab using the UUID identifiers:

# <file system>        <dir>         <type>    <options>             <dump> <pass>
UUID=6a60524d-061d-454a-bfd1-38989910eccd              /             ext4      defaults              1      1

Etiquetas

The device or partition is required to be labeled first. To do this, you can use common applications like gparted to label partitions or you can use e2label to label ext2, ext3, and ext4 partitions. Keep in mind that not all file system have labeling support (e.g. FAT file systems). Labels can be up to 16 characters long. Labels should be unambiguous, meaning that each label should be original to prevent any possible conflicts.

A device or partition must not be mounted before attempting to label them. Initially you will need to boot from a Live(CD/DVD/USB) before you can label with a gparted-like application or for ext partitions you can use e2label:

# e2label /dev/<disk-or-partition> Debian

An example /etc/fstab using the labels:

# <file system>        <dir>         <type>    <options>             <dump> <pass>
LABEL=Debian           /             ext4      defaults              1      1

Ver también