Soluciona problemas de inicio de VM de Linux debido a errores fstab
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Fstab (tabla de sistema de archivos) es un archivo de configuración que se usa para definir cómo persisten las activaciones de archivos compartidos, sistemas de archivos y discos en la VM de Linux después de los reinicios del sistema.
En este documento, se describen varias condiciones en las que una configuración fstab incorrecta puede dar como resultado un problema de inicio y se ofrecen consejos para solucionar el problema.
A continuación, se enumeran algunos de los problemas habituales con la configuración incorrecta de fstab:
Se produjo un error de sintaxis en el archivo de configuración fstab
Un UUID incorrecto
Existe una entrada para un dispositivo no conectado o no disponible
Opciones de activación obsoletas, como nobarrier para el tipo de sistema de archivos xfs en imágenes de SUSE o RHEL.
Antes de comenzar
Si deseas registrar la salida del puerto en serie en Cloud Logging, familiarízate con Cloud Logging.
Si aún no lo hiciste, configura la autenticación.
La autenticación verifica tu identidad para acceder a los Google Cloud servicios y las APIs. Para ejecutar código o muestras desde un entorno de desarrollo local, puedes autenticarte en Compute Engine seleccionando una de las siguientes opciones:
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
Instala Google Cloud CLI.
Después de la instalación,
inicializa Google Cloud CLI ejecutando el siguiente comando:
Para obtener más información, consulta
Autentícate para usar REST
en la documentación de autenticación de Google Cloud .
Identifica problemas de fstab
Para problemas de inicio, Google recomienda que verifiques los registros de inicio en la consola en serie de la VM de Linux. La VM entra en modo de emergencia con un mensaje de error que sugiere que el problema tiene relación con 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)
Según el mensaje de error, hay una falla de dependencia del sistema de archivos /distribution. La falla de dependencia para un punto de activación del sistema de archivos variará en función de los nombres de los sistemas de archivos que se usen.
Solución
Usa las siguientes opciones para resolver el error fstab en las VMs de Linux alojadas en Google Cloud. Puedes resolver el problema con mayor rapidez mediante la consola en serie que con el método manual.
Opción 1: Usa la consola en serie para acceder a la VM en modo de emergencia
Accede a la consola en serie de la VM desde la consola de Google Cloud .
En el modo de emergencia actual, ingresa la contraseña raíz para acceder a tu VM.
Usa tu editor de texto preferido para abrir el archivo fstab. Realiza los cambios necesarios y guarda los cambios en el archivo fstab. En el siguiente ejemplo, se usa el editor vi.
vi /etc/fstab
En el ejemplo anterior, el dispositivo para /distribution está desconectado de la VM. Comenta la línea que hace referencia al sistema de archivos o quita la entrada fstab del punto de activación /distribution.
Usa man fstab para obtener más detalles sobre la configuración y la sintaxis de fstab.
Guarda el archivo y sal del editor. Si usas el editor vi, usa ESC + :wq! para guardar y salir del editor.
Para reanudar el proceso de inicio, ingresa reboot cuando se te solicite.
Después de solucionar correctamente el problema, el proceso de inicio de la VM debe completarse, y aparecerá la solicitud de acceso en la consola en serie.
Verifica que puedas volver a acceder a la VM con SSH.
Opción 2: Usa el modo de usuario único en la consola en serie
Esta opción se puede usar si no se establece la contraseña raíz.
Requisito previo: El parámetro GRUB_TIMEOUT en el archivo de configuración de grub debe establecerse en un valor distinto de cero. Por lo general, este archivo está en /etc/default/grub, pero, en algunas distribuciones anteriores, podría estar ubicado en un directorio no estándar.
Accede a la consola en serie de la máquina virtual desde la consola deGoogle Cloud .
Haz clic en RESTABLECER para la máquina virtual desde la consola de Google Cloud.
En la ventana de la consola en serie, haz clic en la tecla de flecha para pausar el proceso de inicio en el menú o la pantalla de grub.
En la lista de kernels en la pantalla del cargador de inicio de grub, elige el kernel y presiona e en el teclado.
Agrega el parámetro rd.break al final de la línea del kernel y presiona ctrl+x. Esto ayuda a iniciar la VM en el modo de usuario único.
Activa el sistema de archivos raíz en modo de escritura de lectura.
Analiza, haz los cambios necesarios y guarda el archivo fstab. Usa man fstab para obtener más detalles sobre la configuración y la sintaxis. Usa tu editor de texto favorito para abrir el archivo fstab. En el siguiente ejemplo, se usa el editor vi.
vi /etc/fstab
En este ejemplo, el dispositivo para /distribution está separado de la VM, por lo que debes comentar la línea o quitar la entrada de fstab del punto de activación /distribution.
Guarda el archivo y sal del editor. Si usas el editor vi, usa ESC + :wq! para guardar y salir de fstab.
Para reanudar el proceso de inicio, ingresa reboot cuando se te solicite.
Después de solucionar correctamente el problema, el proceso de inicio de la VM debería completarse y deberías ver el mensaje de acceso en la consola en serie.
Verifica que puedas acceder a la VM mediante SSH.
Opción 3: Recupera la VM
Esta opción se puede usar si no se establece la contraseña raíz o si no puedes usar el modo de usuario único.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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)."]]