freebsd-update fails with 'Incorrect hash'

I've been trying to update (using freebsd-update) an old FreeBSD 12.0 system for almost a week without success. It starts off OK every time and downloads 000's of files but always stops with some file has 'incorrect hash'. I don't know if all these downloaded files are stored in cache, and each subsequent attempt to update just carries on where the last one failed, but after a week of attempts I guess all the required files would have been downloaded....

If I constantly have this problem, would the same occur if I attempted to set up my own update server as described here:-


The above guide is ten years old and I wondered if it was still applicable or needed updating in some way...
 
I don't know if all these downloaded files are stored in cache, and each subsequent attempt to update just carries on where the last one failed, but after a week of attempts I guess all the required files would have been downloaded....
Try cleaning out /var/db/freebsd-update/ (don't remove the directory itself).
 
After a clear out I ran freebsd-update -r 13.0-RELEASE upgrade. This is on a system running 12.0-RELEASE. It only has a 60GB disk but over 40GB is available.

The first run fetched 9110 files and successfully applied patches and then showed:-

Fetching 9593 files... failed

No 'incorrect hash' or anything else. Would some sort of error msg have been recorded anywhere?

I'm now trying again...

(Some time later)

...fetched 8540 files.
Applying patches... done
Fetching 9480 files...
 
freebsd-update is a shell script, so (if that's an option for you) then you could try adding more debug code to it to see where it's going wrong on your system?

/usr/sbin/freebsd-update

Obviously back it up first.
 
I just noticed that there is a '--debug' option. I'll see what that gives me. The previous attempt failed, but did not report 'incorrect hash'.
 
As this is an old system, are you sure the disk itself is still good? It might be having bad sectors that cause some of the downloaded files to get corrupted when written to disk.
 
It's definitely an old disk, a 1.8" PATA disk in an IBM ThinkPad X41. Never seen any disks like this before.

I just use the machine for occasional testing, but not really had any problems with it.

What's the best way of checking for bad sectors?
 
I rebooted and did a PXEBOOT where I have lots of utiities and ran an old DOS progam - VIVARD which did a surface scan and no bad blocks was reported, so I think it's safe to assume that the problem lies elsewhere.

I noticed that in /var/db/freebsd-update there are some file called serverlist* where either or both of two servers are listed. What purpose do they serve?
 
I noticed that in /var/db/freebsd-update there are some file called serverlist* where either or both of two servers are listed. What purpose do they serve?
update.freebsd.org is actually load-balanced. It's how freebsd-update(8) keeps track of the mirrors.

Code:
# Pick a mirror.  Returns 1 if we have run out of mirrors to try.
fetch_pick_server () {
# Generate a list of not-yet-tried mirrors
        sort serverlist_tried |
            comm -23 serverlist_full - > serverlist

/usr/sbin/freebsd-update is a shell script, so you can easily read what it does. It's a large and complex script though.
 
… Would some sort of error msg have been recorded anywhere? …

I suspect not.

FreeBSD bug 256143 – freebsd-update does not log its activities

… if all these downloaded files are stored in cache …

I suspect not.

FreeBSD bug 257247 – freebsd-update / pkg: add automation, no questions, continue from interrupted state

… The first run fetched 9110 files and successfully applied patches and then showed:-


No 'incorrect hash' or anything else. …

FreeBSD bugs:
You might like to edit the title of this topic; broaden its scope (no longer specific to hash mismatches).
 
ViVARD

… did a surface scan …

Scanned in what ways, technically?

<https://www.hiren.info/downloads/freeware-tools/page/46> and the 2013 review at <https://www.softpedia.com/get/System/Hard-Disk-Utils/ViVARD.shtml> lack relevant detail.

Can a scan by VIVARD perform writes to the disk in its entirety?

HDAT2

From a user manual, for the most powerful test:

Read defined block of sectors into memory 1, write this block of sectors onto device, read the same defined block of sectors into memory 2 and compare memory 1 and 2.



ViVARD, HDAT2 and more are included in Ultimate Boot CD.

(The included version of HDAT2 is outdated, but should be good enough for your purposes.)
 
Back
Top