Résoudre les problèmes de démarrage des VM Linux en raison d'erreurs fstab
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Fstab (table de système de fichiers) est un fichier de configuration permettant de définir la façon dont les installations de partition de disque, de système de fichiers et de partage de fichiers de votre VM Linux persistent après les redémarrages du système.
Ce document décrit plusieurs conditions dans lesquelles une configuration fstab incorrecte peut entraîner des problèmes de démarrage et propose des conseils de dépannage pour les résoudre.
Voici quelques problèmes courants liés à la mauvaise configuration fstab :
Erreur de syntaxe dans le fichier de configuration fstab
UUID incorrect
Une entrée existe pour un appareil non associé/non disponible
Options d'installation obsolètes telles que nobarrier pour le type de système de fichiers xfs dans les images SUSE ou RHEL.
Avant de commencer
Si vous souhaitez journaliser la sortie du port série sur Cloud Logging, familiarisez-vous avec Cloud Logging.
Si ce n'est pas déjà fait, configurez l'authentification.
L'authentification valide votre identité pour accéder aux services et aux API Google Cloud . Pour exécuter du code ou des exemples depuis un environnement de développement local, vous pouvez vous authentifier auprès de Compute Engine en sélectionnant l'une des options suivantes :
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and
APIs, you don't need to set up authentication.
gcloud
Installez la Google Cloud CLI.
Une fois que la Google Cloud CLI est installée, initialisez-la en exécutant la commande suivante :
Pour utiliser les exemples API REST de cette page dans un environnement de développement local, vous devez utiliser les identifiants que vous fournissez à la gcloud CLI.
Installez la Google Cloud CLI.
Une fois que la Google Cloud CLI est installée, initialisez-la en exécutant la commande suivante :
Pour en savoir plus, consultez la section S'authentifier pour utiliser REST dans la documentation sur l'authentification Google Cloud .
Identifier les problèmes liés à fstab
Pour les problèmes de démarrage, Google vous recommande vivement de vérifier les journaux de démarrage dans la console série de la VM Linux. La VM passe en mode d'urgence et un message d'erreur indique que le problème concerne fstab.
[K[[1;31m TIME [0m] Timed out waiting for device dev-incorrect.device.
[[1;33mDEPEND[0m] Dependency failed for /distribution.
[[1;33mDEPEND[0m] Dependency failed for Local File Systems.
...
Welcome to emergency mode! After logging in, type "journalctl -xb" to viewsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again to boot into default mode.
Give root password for maintenance
(or type Control-D to continue)
Conformément au message d'erreur, il y a une défaillance de dépendance pour le système de fichiers /distribution. La défaillance de dépendance pour un point d'installation du système de fichiers va varier en fonction des noms de systèmes de fichiers utilisés.
Solution
Utilisez les options suivantes pour résoudre l'erreur fstab dans les VM Linux hébergées dans Google Cloud. Vous pouvez résoudre le problème plus rapidement à l'aide de la console série qu'avec la méthode manuelle.
Option 1 : Se connecter à la VM en mode d'urgence à l'aide de la console série
Connectez-vous à la console série de la VM depuis la console Google Cloud .
En mode d'urgence actuel, saisissez le mot de passe racine pour accéder à votre VM.
Utilisez l'éditeur de texte de votre choix pour ouvrir le fichier fstab. Apportez les modifications nécessaires et enregistrez-les dans le fichier fstab. Dans l'exemple suivant, l'éditeur vi est utilisé.
vi /etc/fstab
Dans l'exemple précédent, l'appareil de /distribution est dissocié de la VM. Commentez la ligne faisant référence au système de fichiers ou supprimez l'entrée fstab pour le point d'installation /distribution.
Utilisez man fstab pour obtenir plus de détails sur la configuration et la syntaxe de fstab.
Enregistrez le fichier et quittez l'éditeur. Si vous utilisez l'éditeur vi, appuyez sur ESC + :wq! pour enregistrer et quitter l'éditeur.
Relancez le processus de démarrage en saisissant reboot lorsque vous y êtes invité.
Une fois le problème résolu, le processus de démarrage de la VM doit être terminé et l'invite de connexion apparaît dans la console série.
Vérifiez que vous pouvez vous reconnecter à la VM à l'aide de SSH.
Option 2 : Utiliser le mode mono-utilisateur dans la console série
Cette option peut être utilisée si le mot de passe racine n'est pas défini.
Prérequis : Le paramètre GRUB_TIMEOUT du fichier de configuration grub doit être défini sur une valeur non nulle. Généralement, ce fichier se situe sous /etc/default/grub, mais dans certaines distributions plus anciennes, il peut se trouver dans un autre répertoire.
Connectez-vous à la console série de la machine virtuelle depuis la consoleGoogle Cloud .
Cliquez sur Reinitialiser pour la machine virtuelle depuis la console Google Cloud.
Dans la fenêtre de la console série, interrompez le processus de démarrage en cliquant sur la touche fléchée pour mettre en pause l'écran ou le menu grub.
Dans la liste des kernels sur l'écran du chargeur de démarrage grub, sélectionnez le kernels et appuyez sur la touche e du clavier.
Ajoutez le paramètre rd.break à la fin de la ligne du kernels, puis appuyez sur ctrl+x. Cela permet de démarrer la VM en mode "Un seul utilisateur".
Installez le système de fichiers racine en mode lecture-écriture.
Analysez le fichier fstab, apportez les modifications nécessaires et enregistrez-le. Pour plus d'informations sur la configuration et la syntaxe, utilisez man fstab. Utilisez l'éditeur de texte de votre choix pour ouvrir le fichier fstab. Dans l'exemple ci-dessous, l'éditeur vi est utilisé.
vi /etc/fstab
Dans cet exemple, l'appareil pour /distribution est dissocié de la VM. Vous devez donc commenter la ligne ou supprimer l'entrée fstab pour le point d'installation /distribution.
Enregistrez le fichier et quittez l'éditeur. Si vous utilisez l'éditeur vi, utilisez ESC+:wq! pour enregistrer et quitter fstab.
Relancez le processus de démarrage en saisissant reboot lorsque vous y êtes invité.
Une fois le problème résolu, le processus de démarrage de la VM doit être terminé et l'invite de connexion doit s'afficher dans la console série.
Vérifiez que vous pouvez vous connecter à la VM à l'aide de SSH.
Option 3 : Sauver la VM
Cette option peut être utilisée si le mot de passe racine n'est pas défini ou si vous ne pouvez pas utiliser le mode "Un seul utilisateur".
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eFstab is a configuration file in Linux VMs that defines how disk partitions, file systems, and file shares persist across reboots, and misconfigurations can lead to boot problems.\u003c/p\u003e\n"],["\u003cp\u003eCommon fstab issues include syntax errors, incorrect UUIDs, entries for unavailable devices, and deprecated mount options, which can cause the VM to enter emergency mode.\u003c/p\u003e\n"],["\u003cp\u003eTroubleshooting fstab errors can be achieved through the serial console by logging into the VM in emergency mode with the root password or by using single-user mode if the root password is not set.\u003c/p\u003e\n"],["\u003cp\u003eThe preferred method for resolving fstab issues is typically using the serial console to edit and correct the /etc/fstab file directly, as this is often faster than manual methods.\u003c/p\u003e\n"],["\u003cp\u003eIn cases where neither emergency mode nor single-user mode are viable, rescuing the VM as a last resort is an option to recover from fstab related issues.\u003c/p\u003e\n"]]],[],null,["# Troubleshoot Linux VM boot issues due to fstab errors\n\n*** ** * ** ***\n\nFstab (file system table) is a configuration file that is used to define how\ndisk partition, file system, and file share mounts in your Linux VM persist\nacross system reboots.\n\nThis document outlines multiple conditions where an incorrect fstab\nconfiguration may result in a boot problem and offers troubleshooting\nadvice to fix the issue.\n\nA few of the common issues with fstab misconfiguration are listed below:\n\n- Syntax error in `fstab` configuration file\n- An incorrect UUID\n- An entry exists for an unattached/unavailable device\n- Deprecated mount options like `nobarrier` for the xfs file system type in [SUSE](https://www.suse.com/c/xfs-nobarrier-option-is-now-more-than-deprecated) or [RHEL](https://access.redhat.com/solutions/5315771) images.\n\nBefore you begin\n----------------\n\n- If you want to log serial port output in Cloud Logging, familiarize yourself with [Cloud Logging](/logging).\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n ### Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n ### gcloud\n\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n ### REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\nIdentify fstab issues\n---------------------\n\nFor boot issues, Google highly recommendeds that you check the boot logs\nin the Serial Console of the Linux VM. The VM goes into emergency mode\nwith an error message hinting that the issue is with fstab.\n\n\u003cbr /\u003e\n\n```\n [K[[1;31m TIME [0m] Timed out waiting for device dev-incorrect.device.\n [[1;33mDEPEND[0m] Dependency failed for /distribution.\n [[1;33mDEPEND[0m] Dependency failed for Local File Systems.\n ...\n Welcome to emergency mode! After logging in, type \"journalctl -xb\" to viewsystem logs, \"systemctl reboot\" to reboot, \"systemctl default\" to try again to boot into default mode.\n Give root password for maintenance\n (or type Control-D to continue)\n \n```\n\n\u003cbr /\u003e\n\nAs per the error message, there is dependency failure for the `/distribution`\nfile system. The dependency failure for a file system mount point will differ\nbased on the file system names used.\n\nResolution\n----------\n\nUse the following options to solve the `fstab` error in Linux VMs hosted\nin Google Cloud. You can resolve the issue faster using the serial console\nthan using the manual method.\n| **Note:** To fix the issue from emergency mode, you must have the root password. By default, a root password is not set on Google provided Linux images. If you didn't set a root password, use [Option 2](#option2) instead.\n\nTo use the following methods to resolve the fstab issue, you must\n[enable serial port access for your VM](/compute/docs/troubleshooting/troubleshooting-using-serial-console#enable_instance_access).\n\n### Option 1: Use the serial console to log into the VM in emergency mode\n\n1. Log into the serial console of the VM from Google Cloud console.\n\n2. In the current emergency mode, enter the root password to access your VM.\n\n3. Use your favorite text editor to open the `fstab` file. Make the\n necessary changes and save the changes to the `fstab` file. In the\n following example, the `vi` editor is used.\n\n ```\n vi /etc/fstab\n ```\n\n In the previous example, the device for `/distribution` is detached from\n the VM. Comment the line that references the file system or remove the\n fstab entry for `/distribution` mount point.\n\n Use `man fstab` for more\n details about the fstab configuration and syntax.\n4. Save the file and exit the editor. If you are using the `vi` editor, use\n `ESC` + `:wq!` to save and exit the editor.\n\n5. Resume the boot process by entering **reboot** at the prompt.\n\n6. After successfully fixing the issue, the VM boot process should complete\n and the login prompt appears in the serial console.\n\n7. Verify you can log in to the VM again using SSH.\n\n### Option 2 - Using Single User mode in Serial Console\n\nThis option can be used if the root password is not set.\n\nPrerequisite: The `GRUB_TIMEOUT` parameter in the grub configuration file\nmust be set to a non-zero value. Usually this file is at\n`/etc/default/grub`, but on some earlier distributions, it might be located\nin a non-standard directory.\n\n1. Go to the VM instances page in the Google Cloud console.\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n\n2. Log into the serial console of the Virtual Machine from the\n Google Cloud console.\n\n3. Click **RESET** for virtual machine from Google Cloud Console.\n\n4. In the serial console window, interrupt the boot process by clicking the\n arrow key to pause in the grub screen or menu.\n\n5. In the list of kernels in the grub boot loader screen, choose the kernel\n and press `e` on the keyboard.\n\n6. Add the `rd.break` parameter at the end of the kernel line and press\n `ctrl`+`x`. This helps in booting the VM into single user mode.\n\n | **Note:** The `rd.break` parameter works for RHEL, CENTOS, Oracle Linux, SUSE Operating Systems. This parameter isn't a persistent entry so no changes are required after boot. For Ubuntu 18.04, 20.04 and 22.04 LTS, you can add `systemd.unit=rescue.target` to boot into rescue mode which is similar to single user mode.\n7. Mount the root file system in read write mode.\n\n8. Analyze, make necessary change and save `fstab` file. Use `man fstab` for more\n details about configuration and syntax. Use your favorite text editor to\n open the `fstab` file. In the below example, the vi editor is used.\n\n ```\n vi /etc/fstab\n ```\n\n In this example, the device for `/distribution` is detached from the VM,\n so comment the line or remove the fstab entry for the `/distribution`\n mount point.\n9. Save the file and exit from the editor. If you are using the vi editor, then use\n `ESC` + `:wq!` to save and exit from fstab.\n\n10. Resume the boot process by entering `reboot` at the prompt.\n\n11. After successfully fixing the issue, the VM boot process should complete and\n you should see the login prompt in the serial console.\n\n12. Verify you can log in to the VM using SSH.\n\n### Option 3 - Rescue the VM\n\nThis option can be used if the root password is not set or if you can't use\nsingle user mode.\n\nFor more information, see\n[Rescue an inaccessible VM](/compute/docs/troubleshooting/rescue-vm)."]]