mfschunktool(8)

πŸ“¦
version 4.59.2 Β· 5 versions
, in arch rolling, nixos 26.05, nixpkgs unstable, ubuntu stonking

πŸ’– mfschunktool β€” bestie edition πŸ’–

okay so this is mfschunktool from section 8 of the manual (that's the sysadmin/daemon girlies section, iykyk ✨), and it is literally part of MooseFS. sit down, grab a strawberry drink πŸ“, and let's check some chunk integrity together.


✨ NAME ✨

mfschunktool β€” checks chunk integrity offline πŸ‘‘


🌸 SYNOPSIS 🌸

mfschunktool [-f] [-r] [-n] [-e] [-x] [-m damaged_dir]
chunk_file|mfs_hdd_path ...

πŸ¦‹ DESCRIPTION πŸ¦‹

so mfschunktool does a whole vibe check on your chunks by reading the CRC checksums stored in the chunk's header πŸ’…. and bestie, it can also "repair" a chunk (which is just fixing the stored checksums, ngl). this tool is genuinely so useful when you wanna check the last written chunks after possible data corruption happened (power down, etc. β€” we've all been there πŸ™ˆ).

how it decides what to poke at:

  • if the parameter you pass is a file, it checks that file.
  • if the parameter you pass is a directory, it goes full main character and traverses that directory recursively, trying to check all files that seem to be chunks (basically they're named like chunk files β€” or, if the -n option is on, they also just have headers like chunk files, even when the name is wrong ✨).
⚠️ NOTICE, and this part is serious bestie! This tool should never be used while the chunk server process is active! no. never. If you use it on a chunk disk (aka a path in the mfshdd.cfg file) it will check if the chunk server is working and refuse to operate β€” protective queen behavior honestly 🫢. But if you use it on a single file or subdirectory, that kind of check is not possible, so it's fully on you to make sure you're not using the tool on "working" chunks. because it could lead to data loss. and not the cute kind of loss. πŸ’€

πŸ’… OPTIONS πŸ’…

  • -f β€” turns on fast mode. in this mode only the last block gets tested, which is usually enough to find corrupted chunks. efficiency icon ⭐
  • -r β€” turns on repair mode. if the checksums on the given chunk don't match, they get overwritten by checksums calculated using the actual data. glow-up, but for checksums πŸ’–
  • -n β€” turns on name fixing mode. if the chunk file name is not correct but there's a proper file header, the tool renames the given file using the data stored in the header. name change era πŸŽ€
  • -e β€” turns on empty block crc check for 1.0 version chunks (it forces checking crc values for non existing blocks β€” and heads up, this may fail in case of chunks that were truncated 😭).
  • -x β€” turns on reporting successful check, so it prints an 'OK' message when everything is correct. validation, but make it loud πŸ“£
  • -m damaged_dir β€” move damaged chunks to a specified directory damaged_dir. go read the NOTES, bestie, there's lore down there πŸ‘‡

🌈 NOTES 🌈

the option to move damaged chunks to a specified directory is most useful when whole directories (disks) with chunks are scanned, and it can be employed in different ways depending on what other options you're using at the same time. combination gameplay, fr fr.

  • If the -r option is used together with the -m option, then only chunks that are unrepairable will be moved. This is a fast approach to chunk repairing that repairs and cleans the chunk directory (disk) in one go. one trip, two slays ✨
  • If only the -m option is used, then all damaged chunks will be moved to a specified directory. The user can then use mfschunktool again in this directory, this time with the -r option, to repair all chunks that can be repaired β€” but only introduce the repaired chunks back into the system if there is no other copy available from another chunkserver (a copy that did not need a repair operation in the first place). This is a more time consuming, but safer approach to repairing multiple chunks, e.g. after a power failure. slow and steady wins, periodt πŸ‘‘

πŸ› REPORTING BUGS πŸ›

found a bug? spill the tea at <bugs@moosefs.com> πŸ’Œ


Copyright (C) 2026 Jakub Kruszona-Zawadzki, Saglabs SA

This file is part of MooseFS.

MooseFS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 (only).

MooseFS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, see <https://www.gnu.org/licenses/>.


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page bestie, no cap 🫢 β€” mwah πŸ’‹

MooseFS 4.59.2-1, dated May 2026. go off, queen 🌟
πŸ“¦ where this page comes from