tech:systemd_autofs
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:systemd_autofs [2025/10/28 15:44] – Jean-Baptiste | tech:systemd_autofs [2026/07/16 11:52] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # SystemD Autofs Automount | ||
| + | |||
| + | Ou comment monter automatiquement un lecteur via SystemD | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | [Unit] | ||
| + | Description=Partage | ||
| + | |||
| + | [Mount] | ||
| + | What=// | ||
| + | Where=/ | ||
| + | Type=cifs | ||
| + | # | ||
| + | Options=noexec, | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | [Unit] | ||
| + | Description=Automount Partage | ||
| + | # | ||
| + | # | ||
| + | |||
| + | [Automount] | ||
| + | Where=/ | ||
| + | TimeoutIdleSec=10 | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | systemctl daemon-reload | ||
| + | |||
| + | systemctl disable mnt-partage.mount | ||
| + | systemctl enable mnt-partage.automount | ||
| + | ~~~ | ||
| + | |||
| + | Remarque : le nom du fichier à son importance. Pour un montage /mnt/plop le fichier doit s' | ||
| + | |||
| + | Vérif | ||
| + | ~~~bash | ||
| + | systemctl status / | ||
| + | journalctl -u / | ||
| + | ~~~ | ||
| + | |||
| + | La partition est vu comme montée en **autofs** par la commande mount | ||
| + | ~~~ | ||
| + | # mount |grep / | ||
| + | systemd-1 on / | ||
| + | ~~~ | ||
| + | |||
| + | En cas de pb pour forcer le démontage. A utiliser si la commande `df` ne rien pas la main. | ||
| + | ~~~bash | ||
| + | sudo umount -a -t cifs -l | ||
| + | sudo umount -a -t autofs -l | ||
| + | ~~~ | ||
| + | |||
| + | ## Diag | ||
| + | |||
| + | Pour retrouver le nom du service KO : | ||
| + | ~~~bash | ||
| + | systemctl list-units --state failed --type mount --type automount --no-pager | ||
| + | ~~~ | ||
| + | |||
| + | Puis copier-coller le nom entre des quotes | ||
| + | ~~~bash | ||
| + | systemctl status ' | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | dmesg | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | Si caractères spéciaux | ||
| + | ~~~bash | ||
| + | $ systemd-escape --suffix mount -p / | ||
| + | mnt-foo\x2dbar.mount | ||
| + | |||
| + | $ systemd-escape -u ' | ||
| + | mnt/ | ||
| + | ~~~ | ||
| + | |||
| + | NOTE : ' | ||
| + | ' | ||
| + | |||
| + | https:// | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | # SPDX-License-Identifier: | ||
| + | # | ||
| + | # This file is part of systemd. | ||
| + | # | ||
| + | # systemd is free software; you can redistribute it and/or modify it | ||
| + | # under the terms of the GNU Lesser General Public License as published by | ||
| + | # the Free Software Foundation; either version 2.1 of the License, or | ||
| + | # (at your option) any later version. | ||
| + | |||
| + | [Unit] | ||
| + | Description=FUSE Control File System | ||
| + | Documentation=https:// | ||
| + | Documentation=https:// | ||
| + | DefaultDependencies=no | ||
| + | ConditionPathExists=/ | ||
| + | ConditionCapability=CAP_SYS_ADMIN | ||
| + | ConditionVirtualization=!private-users | ||
| + | After=systemd-modules-load.service | ||
| + | Before=sysinit.target | ||
| + | |||
| + | [Mount] | ||
| + | What=fusectl | ||
| + | Where=/ | ||
| + | Type=fusectl | ||
| + | Options=nosuid, | ||
| + | ~~~ | ||
| + | |||
| + | ### Si SNMP | ||
| + | |||
| + | Message d' | ||
| + | ~~~ | ||
| + | CIFS VFS: cifs_mount failed w/return code | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Solution | ||
| + | |||
| + | `/ | ||
| + | ~~~ | ||
| + | skipNFSInHostResources 1 | ||
| + | ~~~ | ||
| + | |||
| + | Autres solution | ||
| + | |||
| + | https:// | ||
| + | |||
| + | Ajouter l' | ||
| + | |||
