Skip to main content
Support
0
Contact us
Nederlands
Deutsch
Español
Dedicated serversFlexible VPSCloud TechnologyColocationChallenges in ITSectorsCareers
Cloud Compute

With Cloud Compute, you have access anytime and anywhere to a portal through which you can configure your entire IT environment from wherever you are in the world.

Cloud Storage

Reliable access to your files, infrastructure, and applications at all times – with no interruptions or delays. At Worldstream, we offer a variety of storage solutions.

Flexible cloud icon
Flexible cloud
Private cloud icon
Private cloud
Bare metal icon
Bare Metal Compute
Hollow cube icon
Object storage
Hollow cube icon
File storage
Block storage icon
Block storage
Backup storage icon
Backup storage
Need support?

With experienced engineers and an average response time track record on 7 minutes, you can expect a solid technical support solution in next to no time.

All Servers

Choose your Dedicated Server now. Custom or Instant Delivery. Powerhouse servers built for your use case.

Use Cases

Whatever your use case, we’re here to help you find the ideal solution.

Deal servers icon
Deals
AMD servers icon
AMD Processors
AI servers icon
Intel Processors
Hollow cube icon
Virtualisation, Containerisation and Orchestration
Hollow cube icon
Websites and Applications
Hollow cube icon
Gaming and Streaming Infrastructure

24/7/365 support with an average response time of just 7 minutes. Thanks to our own data centers, our engineers can go directly to your server for fast, hands-on assistance. Email or call us anytime.

Smart outsourcing

Some IT creates added value, while other types are supportive. Use that as a starting point for outsourcing.

Cost Efficiency

Complete IT packages may seem like the safe option, but when you consider the costs, other choices often make more sense.

IT flexibility & control

Outsourcing doesn’t mean losing control; it actually provides more flexibility and control.

Cloud repatriation

The cloud is not a final destination: You should continuously evaluate and adjust your cloud environment as needs evolve.

Financial services
Logistics & Transportation
Retail & E-commerce
Media & Entertainment
Tech & Software Development
Security
Managed Service Providers
Need support?

With experienced engineers and an average response time track record on 7 minutes, you can expect a solid technical support solution in next to no time.

Chat with usContact us
About WorldstreamAbout the technologyCasesKnowledge base
About usMeet the teamJobsBecome a resellerCertificationsOur data centersOur networkDDoS ProtectionAMD EPYC serversTechnology PartnersOperating SystemsAll casesEasyTerraDutch Drone CompanyPerfGridArticlesFAQNews and BlogsProducts and Services
Contact us

Call +31 (0) 174 – 712 117

Industriestraat 53, Naaldwijk

Nederlands
Deutsch
Español
0
Dedicated serversFlexible VPSCloud TechnologyColocationChallenges in ITSectorsCareersAbout WorldstreamAbout the technologyCasesKnowledge baseMy Worldstream
Contact
Support
NederlandsDeutschEspañ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

Applies to Dedicated Servers, Bare Metal Compute (Linux)Audience Server administratorsLast reviewed September 2026

Quick answer

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.

On this page
  • 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
Was this article helpful?

Solid IT. No Surprises

Sparring partner for IT maturity
Eliminating barriers so you can run
Predictable and transparant costs

Contact

  • Industriestraat 53, Naaldwijk
  • Payment Methods
  • Abuse
  • Developers Resources
  • Network Operations Center
  • About us
  • Meet the team
  • Jobs
  • Become a reseller
  • Certifications
  • Our data centers
  • Our network
  • DDoS Protection
  • AMD EPYC servers
  • Technology Partners
  • Operating Systems
  • Overview
  • FAQ
  • Cases
  • News & Blogs
  • Use Cases
Nederlands
Deutsch
Español
Nederlands
Deutsch
Español
  • Legal
  • Disclosure