NTFSCK(8)

πŸ“¦ version 1.0.0, in nixpkgs unstable

✨ ntfsck β€” check and repair a Linux ntfs filesystem ✨

okay bestie, welcome to the ntfsck(8) page πŸ’– this is the system manager's manual moment, so buckle up.

🌸 NAME 🌸

ntfsck β€” check and repair a Linux ntfs filesystem. that's it, that's the whole job, and she does it.

πŸŽ€ SYNOPSIS πŸŽ€

ntfsck [OPTIONS] device

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so ntfsck is the girl you call to check the ntfs filesystem on linux, and she will repair a corrupted ntfs filesystem too. but listen β€” ntfsck does not support journal replay. read that again. Windows ntfs filesystems and some commercial linux ntfs filesystems use a journal, but there's no open-source ntfs filesystem that supports journaling. so if your storage has journal data on it? bestie, it's better to repair in Windows. no cap.

when the system has been shut down suddenly on linux, the filesystem should normally be marked as dirty. because the linux ntfs filesystem doesn't support journaling, fsck has to scan the entire disk for checking and repairing. that's the whole reason ntfsck is a useful utility for checking and repairing ntfs filesystems on linux. iconic behavior honestly. πŸ’…

device is a block device (e.g., /dev/sdc1) or a file containing the ntfs filesystem. and if device is mounted, then ntfsck will not be executed, because running on a mounted filesystem is not safe. periodt.

if ntfsck is run in interactive mode, it will ask the user to fix each problem found in the filesystem. if you specify '-r' or you don't specify any option at all, ntfsck will execute in interactive mode. and at that time, you should not specify -a/-p, -y, -C, or -n options, because those options are mutually exclusive β€” meaning that above options should be specified by just only one option. the meaning of the -a/-p, -y, and -n options is the same as other fsck utilities', except for the -C option. the -C option will exit after only checking whether the device is dirty or not. it returns 0 if the device is clean. it returns 1 if the device is dirty.

and also, ntfsck will set the clusters bitmap which is allocated to a repairable inode even in no-repair mode β€” to prevent cluster duplication during fsck, or during filesystem operations after mount without finishing checking the filesystem. so yeah, she's doing stuff even when you told her not to touch anything. lowkey unhinged, highkey necessary. πŸ™ˆ


πŸ’œ OPTIONS πŸ’œ

  • -a, --repair-auto β€” Auto repair mode. this does the exact same thing as the -p option. it's provided for backwards compatibility only, and it is suggested that people use the -p option if possible. this option should not be specified at the same time with the -y, -n, or -C options.
  • -C β€” Check only mode. check if the device volume is dirty or not. this option should not be specified at the same time with the -a/-p, -y, or -n options. ntfsck returns zero if the device is clean, else it returns 1 (meaning that the volume is dirty).
  • -n, --repair-no β€” No repair mode. open the filesystem read-only. this mode just checks problems of the filesystem, and answers 'no' to all questions. even in this mode, ntfsck will set the cluster bitmap for all repairable candidate inodes to prevent cluster duplication. this option should not be specified at the same time with the -a/-p, -y, or -C options.
  • -q, --quiet β€” do not print the progress percent. shhh. 🀫
  • -r, --repair β€” Interactive mode. check and repair interactively. right now it does not support 'yestoall' or 'notoall', so you should input 'Y' or 'N' for all questions about a problem. every single one, bestie. no shortcuts.
  • -p β€” Preen repair mode. ntfsck will fix any filesystem problems automatically without human intervention. generally, fsck will try to fix automatically as much as possible, and when it finds a problem that requires human interaction, fsck prints the problem and asks for input from a human. but right now this option is the same as -y in ntfsck.
  • -y, --repair-yes β€” Yes repair mode. assume an answer of 'yes' to all questions. this option should not be specified at the same time with the -a/-p, -n, or -C options.
  • -y --verbose
  • -V --version β€” print ntfsck version.
ok real talk, the page literally lists -y twice, once as --repair-yes and once as -y --verbose, and I'm not about to pretend otherwise. the manual said what it said. πŸ€·β€β™€οΈ

⭐ EXIT CODES ⭐

all exit codes returned by ntfsck are listed below, and she keeps receipts:

  • 0 β€” No errors
  • 1 β€” Filesystem errors corrected
  • 2 β€” Filesystem errors corrected, need to reboot
  • 4 β€” Filesystem errors left uncorrected
  • 8 β€” Operational error
  • 16 β€” Usage or syntax error
  • 32 β€” Canceled by user interrupt
  • 64 β€” Not supported filesystem
  • 128 β€” Shared library error

🌈 EXAMPLES 🌈

normal usage (auto repair mode) for repairing /dev/sdc1:

ntfsck -a /dev/sdc1

look at her go. πŸ’…


πŸ‘‘ AUTHORS πŸ‘‘

ntfsck was written by Namjae Jeon <linkinjeon@kernel.org> with contributions from Jay Sim. giving credit where credit is due, as we always should. 🫢

🧚 AVAILIBILITY 🧚

ntfsck is part of the ntfsprogs-plus package and is available at:

https://github.com/ntfsprogs-plus/ntfsprogs-plus

πŸ“ BUG REPORTS πŸ“

if you found a problem where ntfsck cannot repair a filesystem, then you may dump a disk image using ntfsclone and send it to the above github homepage for debugging. sample of dumping an image using ntfsclone:

ntfsclone -o <target image name> -f -m --ignore-fs-check <device>

you can also refer to ntfsclone(8) to know further information. πŸ’–

πŸ’€ SEE ALSO πŸ’€

ntfsclone(8) ntfsinfo(8) ntfscluster(8) ntfsprogs-plus(8)


and that's the whole page, bestie! ntfsprogs-plus 1.0.0, dated AUGUST 2023 β€” go forth and fsck responsibly, and please unmount first. mwah. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from