Last week I had a small power outage and I was able to properly shutdown my smartos server.I thought when the power returns, it would be nice to have an upgraded smartos image running. So I downloaded the latest release from /Joyent_Dev/public/SmartOS/20210128T022709Z and did the normal “dd” writing as described on the wiki page. (which I also have been doing for the last couple of years)
Now as soon as it boots, it is loading the image and it will do a hash check on the archive. Everytime I get a hash mismatch and the server reboots.
Loading unix...seconds. [Space] to pause Loading
/platform/i86pc/amd64/boot_archive... Loading
/platform/i86pc/amd64/boot_archive.hash... hash mismatch
and boom, it reboots
I tried loading with UEFI and normal. I also tried to go into the boot -s
mode, but I cannot even get a prompt. It loads the kernel and than I get the hash check failure and reboots. I reverted to use my older image, the joyent_20200729T205408Z image and it boots without issues.
Dan mcDonald helped me out on the maillinglist with given me the following tip:
If you can mount the USB key with the bad archive somewhere else, you should be able to:
1.) Find the boot_archive file
2.) Find the boot_archive.hash file
3.) Run a SHA1 checksum (e.g. `digest -a sha1 boot_archive` or `openssl sha1 boot_archive`) and compare it to what's there.
I should have known better, the sdcard failed on me. Looks like some bits are broken :) everytime I get a different hash.
[root@master /tmp/mnt/platform/i86pc/amd64]# digest -a sha1 boot_archive f1cf6e1673a8ee251a1389308c1df6f6b8a57b43
[root@master /tmp/mnt/platform/i86pc/amd64]# digest -a sha1 boot_archive bc45c7a15d56bc607533aa3750372050d290cbea
As you can see, everytime something different, so lesson learned. Never trust an sd card. Always do a hash check. dd
isn't safe enough