Zum Hauptinhalt springen
Support
0
Kontaktieren Sie uns
English
Nederlands
Español
Dedicated ServersFlexible VPSCloud-TechnologieColocationHerausforderungen in der ITSektorenCareers
Cloud Compute

Mit Cloud Compute haben Sie jederzeit und überall Zugriff auf ein Portal, über das Sie Ihre gesamte IT-Umgebung konfigurieren können – egal wo auf der Welt Sie sich befinden.

Cloud-Speicher

Zuverlässiger Zugriff auf Ihre Dateien, Infrastruktur und Anwendungen zu jeder Zeit – ganz ohne Unterbrechungen oder Verzögerungen. Bei Worldstream bieten wir eine Vielzahl von Speicherlösungen an.

Flexible cloud icon
Flexible Cloud
Private cloud icon
Private Cloud
Bare metal icon
Bare Metal Compute
Hollow cube icon
Objektspeicher
Hollow cube icon
Dateiablage
Block storage icon
Blockspeicher
Backup storage icon
Sicherungsspeicher
Brauchen Sie Unterstützung?

Mit erfahrenen Technikern und einer durchschnittlichen Reaktionszeit von 7 Minuten erhalten Sie innerhalb kürzester Zeit eine solide technische Supportlösung.

Dedicated Server

Wählen Sie jetzt Ihren Dedicated Server. Individuelle oder Instant Delivery. Leistungsstarke Server, die perfekt zu Ihrem Anwendungsfall passen.

Use Cases

Ganz gleich, welcher Use Case – wir helfen Ihnen, die ideale Lösung zu finden.

Deal servers icon
Deals
AMD servers icon
AMD-Prozessoren
AI servers icon
Intel-Prozessoren
Hollow cube icon
Virtualisierung, Containerisierung & Orchestrierung
Hollow cube icon
Websites & Applications
Hollow cube icon
Gaming & Streaming Infrastruktur
Brauchen Sie Unterstützung?

Mit erfahrenen Technikern und einer durchschnittlichen Reaktionszeit von 7 Minuten erhalten Sie innerhalb kürzester Zeit eine solide technische Supportlösung.

Smartes Outsourcing

Bestimmte IT-Lösungen generieren Mehrwert, andere erfüllen eher eine unterstützende Funktion. Denken Sie beim Outsourcing daran.

Kosteneffizienz

IT-Komplettpakete mögen erstmal wie eine sichere Option erscheinen, doch wenn man sich die Kosten genau anschaut, sind andere Lösungen oft sinnvoller.

IT-Flexibilität und Kontrolle

Outsourcing heißt nicht, dass man die Kontrolle verliert; man bekommt sogar mehr Flexibilität und Kontrolle.

Cloud-Repatriierung

Die Cloud ist kein Endziel: Sie sollten Ihre Cloud-Umgebung kontinuierlich prüfen und an die sich ändernden Anforderungen anpassen.

Finanzdienstleistungen
Logistik und Transport
Einzelhandel und E-commerce
Medien und Unterhaltung
Technik und Softwareentwicklung
Sicherheit
Managed Service Provider
Brauchen Sie Unterstützung?

Mit erfahrenen Technikern und einer durchschnittlichen Reaktionszeit von 7 Minuten erhalten Sie innerhalb kürzester Zeit eine solide technische Supportlösung.

Chatten Sie mit unsKontaktieren Sie uns
Über WorldstreamÜber die TechnologieKundenfälleWissensdatenbank
Über unsLernen Sie unser Team kennenJobsWerden Sie WiederverkäuferZertifizierungenUnsere RechenzentrenUnser NetzwerkDDoS-SchutzAMD EPYC-ServerTechnologiepartnerBetriebssystemeAlle KundenfälleEasyTerraDutch Drone CompanyPerfGridArtikelFAQNachrichten und BlogbeiträgeProdukte und Services
Kontaktieren Sie uns

Rufen Sie an unter +31 (0) 174 – 712 117 Industriestraat 53, Naaldwijk

English
Nederlands
Español
0
Dedicated ServersFlexible VPSCloud-TechnologieColocationHerausforderungen in der ITSektorenCareersÜber WorldstreamÜber die TechnologieKundenfälleWissensdatenbankMy Worldstream
Contact
Support
EnglishNederlandsEspañol
  1. HomeHome
  2. Knowledge Base
  3. Dedicated Servers
  4. Checking and repairing a Linux filesystem with fsck

Checking and repairing a Linux filesystem with fsck

Gilt für Dedicated Servers, Bare Metal Compute (Linux)Zielgruppe Server administratorsZuletzt geprüft September 2026

Kort antwoord

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.

Auf dieser Seite
  • 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
War dieser Artikel hilfreich?

Solide IT. Keine Überraschungen

Sparringspartner für IT-Reife
Wir räumen die Hindernisse aus dem Weg, damit Sie freie Bahn haben
Vorhersehbare und transparente Kosten

Kontakt

  • Industriestraat 53, Naaldwijk
  • Zahlungsmöglichkeiten
  • Missbrauch
  • Ressourcen für Entwickler
  • Network Operations Center
  • Über uns
  • Lernen Sie unser Team kennen
  • Jobs
  • Werden Sie Wiederverkäufer
  • Zertifizierungen
  • Unsere Rechenzentren
  • Unser Netzwerk
  • DDoS-Schutz
  • AMD EPYC-Server
  • Technologiepartner
  • Betriebssysteme
  • Übersicht
  • FAQ
  • Kundenfälle
  • Nachrichten und Blogbeiträge
  • Use Cases
English
Nederlands
Español
English
Nederlands
Español
  • Rechtliches
  • Transparenzhinweis