It sounds like the hard disk itself is having problems. ("short read," etc.) If so, dmesg | tail
will probably show some I/O errors.
Another way to check this is to run badblocks -n
on the problem partition. Or better, on the entire disk. Whatever you test, it needs to be unmounted. This will take hours on a large modern disk. If there's anything on the partition(s) that do mount that you can't live without, copy it off onto removable media or a network volume first.
The suggestion to mirror the disk is also good. It's kind of a "lite" version of the badblocks -n
check, because by forcing the disk to read in every sector, it can cause the disk to relocate problem blocks, as badblocks -n
will. badblocks -n
is more effective because dodgy sectors can be barely-readable, and only be shown to the disk as bad enough to move by attempting to write to them. Still, if the disk has enough life left in it to survive a rescue, the extra read pass won't be enough to finish it off.
I don't hold much hope that running fsck
on the disk image will recover everything. You'll almost certainly lose sectors in this process, which means some files will be unreadable or corrupted beyond use. A JPEG will partially decode with corrupted data, for example, but a JPEG with the bottom ⅔ cropped off might not be useful to you.
Is my data toasted?
Possibly, possibly not. The badblocks -n
pass can sometimes fix the problem. If it does, you still need to replace the HDD, since a disk can only get into such a bad state by being nearly dead to start.
Did I do the wrong thing already?
Other than forgetting the meaning of the word "rigorous," no. :)
You are looking for the systemd
journal. man journalctl
can be your entry point. To review the logs for systemd-fsck
you can look at:
journalctl -u systemd-fsck*
As you'll see in man journalctl
, there are are also machine-friendly output options like JSON. That's as close as you are going to come to an API to query fsck status, besides the other systemd tool for querying service status:
systemctl status systemd-fsck*
As you'll see in man systemctl
, it also offers machine-friendly output formats as well.
I'm aware of no way to query fsck
status without systemd
.
Best Answer
Try the -y option.
From fsck manual: