Difference between revisions of "Fstab/ru"

Updating to match new version of source page
(Created page with "Для получения UUID всех Ваших устройств - выполните команду {{ic|blkid}} с правами root:")
(Updating to match new version of source page)
Line 38: Line 38:
Для получения UUID всех Ваших устройств - выполните команду {{ic|blkid}} с правами root:
Для получения UUID всех Ваших устройств - выполните команду {{ic|blkid}} с правами root:


  sudo blkid
  <div lang="en" dir="ltr" class="mw-content-ltr">
{{UserCmd|command=sudo blkid}}
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
and you'll get someting like this:
and you'll get someting like this:
</div>


  /dev/sda1: LABEL_FATBOOT="ESP" LABEL="ESP" UUID="2462-755F" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="b86c0cae-3055-4d9e-9e12-1fa1e2cd32d2"
  <div lang="en" dir="ltr" class="mw-content-ltr">
/dev/sda1: LABEL_FATBOOT="ESP" LABEL="ESP" UUID="2462-755F" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="b86c0cae-3055-4d9e-9e12-1fa1e2cd32d2"
  /dev/sda2: PARTLABEL="Microsoft reserved partition" PARTUUID="b0679b89-007c-441b-88a3-74a39f1f8b2b"
  /dev/sda2: PARTLABEL="Microsoft reserved partition" PARTUUID="b0679b89-007c-441b-88a3-74a39f1f8b2b"
  /dev/sda3: LABEL="WINSYS" BLOCK_SIZE="512" UUID="029873F49873E497" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="f8d444b9-ec60-4ac8-b12a-52448119fad1"
  /dev/sda3: LABEL="WINSYS" BLOCK_SIZE="512" UUID="029873F49873E497" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="f8d444b9-ec60-4ac8-b12a-52448119fad1"
Line 52: Line 57:
  /dev/sdb3: UUID="c9dd0f4c-5793-446e-90bb-d10e27bf4922" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="d02838bd-371c-4673-96ed-8aad73bb6d91"
  /dev/sdb3: UUID="c9dd0f4c-5793-446e-90bb-d10e27bf4922" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="d02838bd-371c-4673-96ed-8aad73bb6d91"
  /dev/sdc1: LABEL="Win-Data" BLOCK_SIZE="512" UUID="634E43D367B0A4B1" TYPE="ntfs" PARTUUID="ca8d0663-6a6e-4b09-a0d7-05b59d109ab1"
  /dev/sdc1: LABEL="Win-Data" BLOCK_SIZE="512" UUID="634E43D367B0A4B1" TYPE="ntfs" PARTUUID="ca8d0663-6a6e-4b09-a0d7-05b59d109ab1"
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Any one of the output of {{ic|blkid}} can be used as the first field in the fstab file.
Any one of the output of {{ic|blkid}} can be used as the first field in the fstab file.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
E.G. '''all''' of the following lines are valid entries ''for the first line'' of the output of the above example:
E.G. '''all''' of the following lines are valid entries ''for the first line'' of the output of the above example:
  # <file system>                          <mount point>  <type>  <options>                    <dump>  <pass>
  # <file system>                          <mount point>  <type>  <options>                    <dump>  <pass>
Line 61: Line 70:
  LABEL=EFI\040system\040partition          /boot/efi      vfat    umask=0077                        0      2
  LABEL=EFI\040system\040partition          /boot/efi      vfat    umask=0077                        0      2
  UUID=b86c0cae-3055-4d9e-9e12-1fa1e2cd32d2 /boot/efi      vfat    umask=0077                        0      2
  UUID=b86c0cae-3055-4d9e-9e12-1fa1e2cd32d2 /boot/efi      vfat    umask=0077                        0      2
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
I.E. only one of the above lines should be present in your fstab file to mount the ESP partition, but any of them will work!
I.E. only one of the above lines should be present in your fstab file to mount the ESP partition, but any of them will work!
''However'' it is strongly recommended to use the UUID as that is '''globally unique!'''.  This means that if your move a disk to another machine, it will keep its UUID and there is no opportunity for surprises like the computer you've moved the existing disk to suddenly:
''However'' it is strongly recommended to use the UUID as that is '''globally unique!'''.  This means that if your move a disk to another machine, it will keep its UUID and there is no opportunity for surprises like the computer you've moved the existing disk to suddenly:
Line 68: Line 79:
* failing to mount a disk because the disk you just inserted into M2 slot #1 gets named /dev/sda and the one in slot #2 which used to be called /dev/sda now suddenly becomes /dev/sdb.
* failing to mount a disk because the disk you just inserted into M2 slot #1 gets named /dev/sda and the one in slot #2 which used to be called /dev/sda now suddenly becomes /dev/sdb.
* etc, etc.
* etc, etc.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
== Mount Point ==
== Mount Point ==
This field describes the mount point (target) inside your filesystem. For swap partitions, this field should be specified as `none'. If the name of the mount point contains spaces or tabs these can be escaped as `\040' and '\011' respectively.
This field describes the mount point (target) inside your filesystem. For swap partitions, this field should be specified as `none'. If the name of the mount point contains spaces or tabs these can be escaped as `\040' and '\011' respectively.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
For more information on the Linux Filesystem Hierarchy standard refer to the [[#See Also]] section, but in a nutshell you should specify an existing directory on your filesystem where you want to mount a partition.
For more information on the Linux Filesystem Hierarchy standard refer to the [[#See Also]] section, but in a nutshell you should specify an existing directory on your filesystem where you want to mount a partition.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
In the example {{ic|fstab}} file above, the following line in it's {{ic|blkid}} output:
In the example {{ic|fstab}} file above, the following line in it's {{ic|blkid}} output:
  /dev/sdc1: LABEL="Win-Data" BLOCK_SIZE="512" UUID="634E43D367B0A4B1" TYPE="ntfs" PARTUUID="ca8d0663-6a6e-4b09-a0d7-05b59d109ab1"
  /dev/sdc1: LABEL="Win-Data" BLOCK_SIZE="512" UUID="634E43D367B0A4B1" TYPE="ntfs" PARTUUID="ca8d0663-6a6e-4b09-a0d7-05b59d109ab1"
Line 81: Line 98:
* contains the NTFS File System
* contains the NTFS File System
* has a partition UUID of "ca8d0663-6a6e-4b09-a0d7-05b59d109ab1"
* has a partition UUID of "ca8d0663-6a6e-4b09-a0d7-05b59d109ab1"
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
and gets mounted on the {{ic|/media/Data}} according to this line:
and gets mounted on the {{ic|/media/Data}} according to this line:
  UUID=634E43D367B0A4B1                    /media/Data    ntfs-3g noauto,x-systemd.automount,x-systemd.device-timeout=10,rw,inherit,permissions,streams_interface=windows,windows_names,compression,norecover,hide_dot_files,hide_hid_files,big_writes 0 2
  UUID=634E43D367B0A4B1                    /media/Data    ntfs-3g noauto,x-systemd.automount,x-systemd.device-timeout=10,rw,inherit,permissions,streams_interface=windows,windows_names,compression,norecover,hide_dot_files,hide_hid_files,big_writes 0 2
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
== Filesystem Type ==
== Filesystem Type ==
This field describes the type of the filesystem. Linux supports many filesystem types: ext4, xfs, btrfs, f2fs, vfat, ntfs-3g (for Windows compatibility), hfsplus (for Mac Compatibility), tmpfs, sysfs, proc, iso9660 (to allow you to mount CD/DVD ISO files as Read-Only directories), udf, squashfs, nfs, cifs, and many more.  
This field describes the type of the filesystem. Linux supports many filesystem types: ext4, xfs, btrfs, f2fs, vfat, ntfs-3g (for Windows compatibility), hfsplus (for Mac Compatibility), tmpfs, sysfs, proc, iso9660 (to allow you to mount CD/DVD ISO files as Read-Only directories), udf, squashfs, nfs, cifs, and many more.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
An entry swap denotes a file or partition to be used for swapping.
An entry swap denotes a file or partition to be used for swapping.
An entry none is useful for bind or move mounts.
An entry none is useful for bind or move mounts.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
More than one type may be specified in a comma-separated list.
More than one type may be specified in a comma-separated list.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Using the same example {{ic|fstab}} file and "Win-Data" line as above, {{ic|ntfs-3g}} is the file system we're mounting this one under although the {{ic|blkid}} shows {{ic|ntfs}}.  This is simply because the {{ic|ntfs}} driver is a read-only driver (allowing you to see your Windows files, but not modify them, whereas the {{ic|ntfs-3g}} (for 3rd generation) allows most NTFS options (except encryption) thus also read-write capabilities:
Using the same example {{ic|fstab}} file and "Win-Data" line as above, {{ic|ntfs-3g}} is the file system we're mounting this one under although the {{ic|blkid}} shows {{ic|ntfs}}.  This is simply because the {{ic|ntfs}} driver is a read-only driver (allowing you to see your Windows files, but not modify them, whereas the {{ic|ntfs-3g}} (for 3rd generation) allows most NTFS options (except encryption) thus also read-write capabilities:
</div>


  UUID=634E43D367B0A4B1                    /media/Data    ntfs-3g noauto,x-systemd.automount,x-systemd.device-timeout=10,rw,inherit,permissions,streams_interface=windows,windows_names,compression,norecover,hide_dot_files,hide_hid_files,big_writes 0 2
  <div lang="en" dir="ltr" class="mw-content-ltr">
UUID=634E43D367B0A4B1                    /media/Data    ntfs-3g noauto,x-systemd.automount,x-systemd.device-timeout=10,rw,inherit,permissions,streams_interface=windows,windows_names,compression,norecover,hide_dot_files,hide_hid_files,big_writes 0 2
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
== Mount options ==
== Mount options ==
This field describes the mount options associated with the filesystem.
This field describes the mount options associated with the filesystem.
</div>


It is formatted as a comma-separated list of options. It contains at least the type of mount (ro or rw), plus any additional options appropriate to the filesystem type (including performance-tuning options).  
<div lang="en" dir="ltr" class="mw-content-ltr">
It is formatted as a comma-separated list of options. It contains at least the type of mount (ro or rw), plus any additional options appropriate to the filesystem type (including performance-tuning options).
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Basic filesystem-independent options are:
Basic filesystem-independent options are:
* defaults: use default options: rw, suid, dev, exec, auto, nouser, and async.
* defaults: use default options: rw, suid, dev, exec, auto, nouser, and async.
Line 109: Line 144:
* comment: or x-<name> for use by fstab-maintaining programs
* comment: or x-<name> for use by fstab-maintaining programs
* nofail: do not report errors for this device if it does not exist.
* nofail: do not report errors for this device if it does not exist.
</div>


=== Параметры монтирования FAT ===
=== Параметры монтирования FAT ===
Line 122: Line 158:
Это поле должно быть равно 1 или 0 и используется {{ic|dump}} для определения того, какие файловые системы должны быть сброшены в случае coredump (=crash). По умолчанию оно равно нулю (не сбрасывать), если отсутствует.
Это поле должно быть равно 1 или 0 и используется {{ic|dump}} для определения того, какие файловые системы должны быть сброшены в случае coredump (=crash). По умолчанию оно равно нулю (не сбрасывать), если отсутствует.


<div lang="en" dir="ltr" class="mw-content-ltr">
== Pass number ==
== Pass number ==
This field is used by fsck(8) to determine the order in which filesystem checks are done at boot time. The root filesystem ''should be'' specified with a fs_passno of 1. Other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware.
This field is used by fsck(8) to determine the order in which filesystem checks are done at boot time. The root filesystem ''should be'' specified with a fs_passno of 1. Other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Defaults to zero (don’t check the filesystem) if not present.
Defaults to zero (don’t check the filesystem) if not present.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
= Tips and tricks =
= Tips and tricks =
The default setup will automatically `fsck` and `mount` filesystems before starting services that need them to be mounted. For example, systemd automatically makes sure that remote filesystem mounts like NFS or Samba are only started after the network has been set up. Therefore, local and remote filesystem mounts specified in `/etc/fstab` should work out of the box. See {{UserCmd|command=man 5 systemd.mount}} for details.
The default setup will automatically `fsck` and `mount` filesystems before starting services that need them to be mounted. For example, systemd automatically makes sure that remote filesystem mounts like NFS or Samba are only started after the network has been set up. Therefore, local and remote filesystem mounts specified in `/etc/fstab` should work out of the box. See {{UserCmd|command=man 5 systemd.mount}} for details.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
=See Also=
=See Also=
https://refspecs.linuxfoundation.org/FHS_3.0/index.html
https://refspecs.linuxfoundation.org/FHS_3.0/index.html
</div>


[[Category:Contents Page{{#translation:}}]]
[[Category:Contents Page{{#translation:}}]]
8,146

edits