Solved Missing a few man pages on my machine – what would cause this to happen?

I found that some of the man pages are missing on one of my machines. For example, I couldn't find a man page for save-entropy(8).

I inspected /usr/share/man/man{1..9} on some of my machines running FreeBSD 14.2-RELEASE and found that some files are missing. If I run ls /usr/share/man/man8 | wc -l, most of the machines print 607, while the problematic one prints only 600.

I cannot figure out what would cause this to happen. I'd like to know how to repair the missing man pages :)
 
I inspected /usr/share/man/man{1..9} on some of my machines running FreeBSD 14.2-RELEASE and found that some files are missing. If I run ls /usr/share/man/man8 | wc -l, most of the machines print 607, while the problematic one prints only 600.
Here I see 607, too. I suggest to run smartctl(8) to check if there is anything obvious related to the disk. Additionally it might make sense to check not only the existance of the files but also compare the size or checksums.
 
The checksums were different, too. Thank you for pointing out that. I ran smartctl(8) and nothing suspicious was found. Do you have any suggestions on how to repair the man pages?

FYI: I just wrote the following shell script to get checksums:
sh:
#!/bin/sh

mandir=/usr/share/man

PREFIX=${PREFIX:-}
if [ -n "$PREFIX" ]; then
    PREFIX="${PREFIX}-"
fi

for i in `jot 9`; do
    subdir="/usr/share/man/man${i}"
    md5file="./${PREFIX}man${i}.txt"
    find ${subdir} -type f | sort | xargs md5 -r > ${md5file}
done
 
Do you have any suggestions on how to repair the man pages?
I am not 100% where the man pages come from, but it should be within base.txz.
I would try to download the archive, see what is in and extract the man pages from there.
https://docs.freebsd.org/en/books/handbook/jails/#creating-classic-jail shows where the archive should be.
Code:
fetch https://download.freebsd.org/ftp/releases/amd64/amd64/14.2-RELEASE/base.txz
tar -tf base.txz
should be a starting point.
 
I am not 100% where the man pages come from, but it should be within base.txz.
I would try to download the archive, see what is in and extract the man pages from there.
https://docs.freebsd.org/en/books/handbook/jails/#creating-classic-jail shows where the archive should be.
Code:
fetch https://download.freebsd.org/ftp/releases/amd64/amd64/14.2-RELEASE/base.txz
tar -tf base.txz
should be a starting point.
Thanks, I'll try to manually copy them. BTW, does anyone know what would have led to this? Now I'm afraid that the system's integrity on that machine is no longer trusted and there might be other broken things.
 
Thanks, I'll try to manually copy them. BTW, does anyone know what would have led to this? Now I'm afraid that the system's integrity on that machine is no longer trusted and there might be other broken things.
I don't know if this would work but maybe it checks for missing man pages too and maybe installs them.

freebsd-update(8)
Code:
     IDS       Compare the system against a "known good" index of the
               installed release.
 
Finally... I found that a lot were broken 🙁
Something went wrong during freebsd-update(8)... maybe.

For those who are interested in what went wrong on my machine, I'm attaching the log files from both the broken machine and a normal one.
Now I'll have to install a fresh image of FreeBSD 14.2-RELEASE from scratch, which will be a burden...
 

Attachments

If the filesystem used is ZFS, then running zpool scrub on your ZFS storage pool will start the process of verifying the checksums of all the blocks in it.

If UFS is used, you can check for lost+found directories. Those may contain files that otherwise disappeared.
 
I'm using ZFS and I couldn't find anything bad after running zpool-scrub(8). I think that it was caused by corruption of the freebsd-update(8) process, due to some unknown reason.
freebsd-update by default creates a backup boot environment when installing updates. You could bectl mount the one from your last update and check if the missing files are indeed present there. That might not give a definite answer as to what had gone wrong, but could possibly give some clues.
 
freebsd-update by default creates a backup boot environment when installing updates. You could bectl mount the one from your last update and check if the missing files are indeed present there.
Unfortunately, I had deleted the old backups so that the oldest one is pointing 14.1-RELEASE-p5. I inspected that snapshot and I couldn't find ${MOUNTPOINT}/usr/share/man/man8/save-entropy.8.gz there, which means the corruption had already happened before that point.
 
Now I'll have to install a fresh image of FreeBSD 14.2-RELEASE from scratch, which will be a burden...
Nevermind; I just built the userland from source using make installworld and then followed this section from FreeBSD Handbook to clean up outdated files and libraries. Now I'm seeing nothing wrong with freebsd-update IDS, which is a little surprising since all the checksums are matching even with compilation from scratch.
 
Back
Top