this post was submitted on 01 Sep 2023
15 points (100.0% liked)

Linux

7782 readers
20 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 1 year ago
MODERATORS
 

On Windows, we've had the defrag tool and others, that happily works on a drive even while it is in use, even the OS disk.

On Linux, I know of the fsck command but that requires the drive in question to be unmounted. Not great when you want to check a running server. I do not want to stop my server and boot it from USB, just to run a disk check. I can't imagine that's what the data centers are doing, either!

Surely some Linux tool exists that can do some basic checks on a running system?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 1 year ago (1 children)

They almost undoubtedly would. That wasn't the problematic statement.

Let's go over some fundamentals here.

fsck is a utility for checking and repairing filesystem errors. Some filesystems do not support doing so when they are mounted.

Why? At a high level, because:

The utility needs the filesystem to be in a consistent state on disk. If the filesystem is mounted and in-use, that will not be so: The utility might come across data affected by an in-flight operation. In its state at that exact moment, the utility might think there is corruption and might attempt to repair it.

But in doing so, it might actually cause corruption once the in-flight operation is complete. That is because the mounted filesystem also expects the disks to be in a consistent state.

Some filesystems are designed to support online fsck. But for OP's purposes, I assume that the ones they are using are not so (hence the reason for the post).

"I know!" said the other commenter. "RAID uses mirroring! So why not just take the mirror offline and do it there?"

Well, for the exact same reasons as above, and then some additional ones.

Offlining a mirror like that while the filesystem is in use is still going to result in the data on the drive being in an inconsistent state. And then, as a bonus, if you tried to online it again, that puts the mirrors in an inconsistent state from each other too.

Even if you wanted to offline a mirror to check for errors, and even if you were doing a read-only check (thus not actually repairing any errors, thus not actually changing anything on that particular drive), and even if you didn't have to worry about the data on disk being inconsistent... The filesystem is in use. So data on the still-online drive has undoubtedly changed, meaning you can't just online the other one again (since they are now inconsistent from each other).

[–] [email protected] -2 points 1 year ago (1 children)

So they swap the drives like i said? I never mentioned them correcting them online or checking them online or any of that mess. I just said they run 1+0 so they can pull a drive and pop a new one in without shutting down. I have two different statements in my comment. I'll add a paragraph break to make it clearer that they aren't related.

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

Nearly all systems have some sort of background error checking which periodically reads all data and validates it hasn't changed. They also watch for SMART errors and pre-fail disks before they die entirely.

They use all forms of RAID (Netapp is a weird dual stripe RAID 4, for example) and Erasure coding primarily.

[–] [email protected] 0 points 1 year ago (1 children)

How does that invalidate anything I said?

[–] [email protected] 1 points 1 year ago

Dude I think this is a more you ain't smart enough to know that youre not smart... just take the L