Saltar al contenido principal
Soporte
0
Contacta con nosotros
English
Nederlands
Deutsch
Servidores dedicadosFlexible VPSTecnología de nubeUbicación compartidaDesafíos en TISectoresCareers
Cloud Compute

Con Cloud Compute, tendrás acceso a un portal desde el que podrás configurar todo tu entorno informático en cualquier momento y desde cualquier lugar del mundo.

Almacenamiento en la nube

Acceso fiable a tus archivos, infraestructura y aplicaciones en todo momento, sin interrupciones ni retrasos. En Worldstream, ofrecemos una gran variedad de soluciones de almacenamiento.

Flexible cloud icon
Nube flexible
Private cloud icon
Nube privada
Bare metal icon
Bare Metal Compute
Hollow cube icon
Almacenamiento de objetos
Hollow cube icon
Almacenamiento de archivos
Block storage icon
Almacenamiento en bloque
Backup storage icon
Almacenamiento de copias de seguridad
¿Necesitas soporte?

Con ingenieros experimentados y un tiempo medio de respuesta de 7 minutos, puedes esperar una solución de soporte técnico sólida muy rápida.

Soporte
Todos los servidores

Elige tu servidor dedicado ahora. Configuración personalizada o entrega inmediata. Servidores potentes diseñados para tu caso de uso.

Casos de uso

Sea cual sea tu caso de uso, te ayudamos a encontrar la solución adecuada.

Deal servers icon
Ofertas
AMD servers icon
Servidores AMD
AI servers icon
Servidores Intel
Hollow cube icon
Virtualización, Contenerización y Orquestación
Hollow cube icon
Sitios web y aplicaciones
Hollow cube icon
Infraestructura para gaming y streaming

Soporte 24/7/365 con un tiempo medio de respuesta de solo 7 minutos. Gracias a nuestros propios centros de datos, nuestros ingenieros pueden acceder directamente a tu servidor para ofrecer soporte rápido y directo. Contáctanos por correo o teléfono en cualquier momento.

Soporte
Externalización inteligente

Algunos aspectos de la TI crean valor añadido, mientras que otros sirven de apoyo. Aprovéchalo como punto de partida para la externalización.

Rentabilidad

Los paquetes informáticos completos pueden parecer la opción segura, pero al considerar los costes, otras opciones suelen tener más sentido.

Flexibilidad y control informáticos

Externalizar no implica perder el control; en realidad proporciona más flexibilidad y control.

Repatriación desde la nube

La nube no es el destino final: debes evaluar y ajustar tu entorno de nube continuamente a medida que cambian las necesidades.

Servicios financieros
Logística y transporte
Venta minorista y comercio electrónico
Medios de comunicación y entretenimiento
Tecnología y desarrollo de software
Seguridad
Proveedores de servicios gestionados
¿Necesitas soporte?

Con ingenieros experimentados y un tiempo medio de respuesta de 7 minutos, puedes esperar una solución de soporte técnico sólida muy rápida.

Habla con nosotrosContacta con nosotros
Acerca de WorldstreamAcerca de la tecnologíaCasosBase de conocimientos
Quiénes somosConoce al equipoTrabaja con nosotrosHazte distribuidorcertificacionesNuestros centros de datosNuestra redProtección DDoSServidores AMD EPYCPartners tecnológicosAcerca de los servidores dedicadosTodos los casosEasyTerraDutch Drone CompanyPerfGridArtículosPreguntas frecuentesNoticias y blogsProductos y servicios
Contacta con nosotros

Llama al +31 (0) 174 – 712 117 Industriestraat 53, Naaldwijk

Contacta con nosotros
Worldstream Portal
English
Nederlands
Deutsch
0
Servidores dedicadosFlexible VPSTecnología de nubeUbicación compartidaDesafíos en TISectoresCareersAcerca de WorldstreamAcerca de la tecnologíaCasosBase de conocimientosMy Worldstream
Contact
Soporte
EnglishNederlandsDeutsch
  1. InicioInicio
  2. Base de conocimientos
  3. Dedicated Servers
  4. Checking and repairing a Linux filesystem with fsck

Checking and repairing a Linux filesystem with fsck

Se aplica a Dedicated Servers, Bare Metal Compute (Linux)Audiencia Server administratorsÚltima revisión September 2026

Respuesta rápida

fsck checks a filesystem's internal structures for consistency and can repair common problems, such as after an unclean shutdown. Run it against an unmounted filesystem: fsck /dev/sdXN, or add -y to automatically accept repair prompts once you're confident that's what you want. An exit code of 0 means the filesystem is clean, anything else means fsck found or fixed something, worth checking the exact meaning rather than guessing.

En esta página
  • What fsck actually checks
  • Why it needs to run unmounted
  • Basic invocation
  • Reading the exit code
  • Before you run it

What fsck actually checks

A filesystem keeps its own internal bookkeeping: which blocks belong to which file, which blocks are free, directory entries, and various counters and flags that describe the filesystem's own state. Under normal operation that bookkeeping stays consistent. It can fall out of sync after an unclean shutdown (a power loss or a hard reset that interrupts writes mid-flight), after certain kinds of hardware fault, or occasionally after a kernel bug. fsck (filesystem check) walks that bookkeeping, looks for inconsistencies, and, where it's confident about the correct fix, repairs them.

fsck itself is really a front end. It looks at the filesystem type on the target device and hands off to the specific checker for that type, for example e2fsck for ext2/ext3/ext4. You can call e2fsck directly if you want finer control over ext4-specific options than the generic fsck front end exposes, but for routine use fsck is simpler since it works out which checker to run for you.

Why it needs to run unmounted

A mounted, actively used filesystem keeps changing underneath you: files are written, deleted, and metadata updates as normal system activity continues. Running a consistency check against a moving target means fsck can misread structures that are mid-update, and in the worst case its own repair actions can collide with a live write and cause more damage than the original inconsistency. That's why fsck is meant to run against a filesystem that isn't mounted, or that's mounted strictly read-only.

For a server's root filesystem, that's awkward: you can't easily unmount the filesystem the running OS is using. This is exactly the kind of task rescue mode exists for. Booting into a separate, minimal environment means the disk you need to check isn't in use by anything, so fsck can run against it cleanly from outside.

Basic invocation

Point fsck at the partition's device path, not at a mount point:

fsck /dev/sdb1

Run without any flags, fsck checks the filesystem and, when it finds an inconsistency, prompts you interactively before making each repair. That's useful when you want to see exactly what it's proposing to change. When you already know you want every suggested repair applied without being asked each time, add -y to answer yes automatically:

fsck -y /dev/sdb1

Use -y deliberately. On a filesystem with structural damage, auto-accepting every fix can occasionally mean data ends up in lost+found rather than back exactly where it was, generally still better than leaving known corruption in place, but worth knowing before you run it unattended.

Reading the exit code

fsck's exit code is a bitmask, not a simple pass/fail flag, several conditions can be signalled at once by adding their values together. At a high level:

Exit codeGeneral meaning
0No errors, the filesystem is clean
1Filesystem errors were found and corrected
2System should be rebooted (typically after the root filesystem was checked and fixed)
4Filesystem errors were found but left uncorrected
8 and aboveMore serious operational problems, such as a usage error or a shared library issue

Treat this table as a rough guide rather than the final word. The exact bit meanings are documented in fsck's own manual page (man fsck), and it's worth checking that directly rather than guessing when an automated script or monitoring check needs to act on a specific code.

Before you run it

If you suspect the underlying drive itself is failing, rather than just the filesystem sitting on it, check the drive's health first, see How to recognise a bad drive in Linux. Running repeated filesystem repairs against a physically failing drive tends to produce the same errors again on the next check. Once the filesystem passes clean, mount it as usual, see Mounting a disk in Linux.

Related articles

  • What is rescue mode, and when do you need it
  • How to recognise a bad drive in Linux
  • Mounting a disk in Linux
  • LVM basics: managing and recovering logical volumes
¿Te ha resultado útil este artículo?

Informática sólida. Sin sorpresas

Tu socio para la madurez informática
Eliminamos barreras para que puedas correr
Costes previsibles y transparentes

Contacto

  • Industriestraat 53, Naaldwijk
Contacta con nosotros
Worldstream Portal (opens in a new tab)
  • Métodos de pago
  • Abuso
  • Recursos para desarrolladores
  • Centro de operaciones de red
  • Quiénes somos
  • Conoce al equipo
  • Trabaja con nosotros
  • Hazte distribuidor
  • certificaciones
  • Nuestros centros de datos
  • Nuestra red
  • Protección DDoS
  • Servidores AMD EPYC
  • Partners tecnológicos
  • Sistemas operativos
  • Vista general
  • Preguntas frecuentes
  • Casos
  • Noticias y blogs
  • Use Cases
English
Nederlands
Deutsch
English
Nederlands
Deutsch
  • Legal
  • Notificación de vulnerabilidades