MikeL's FreeBSD howto - 14.0 install

Note that this page is in reverse chronological order, newest on top. You may wish to start at the bottom in order to understand the events.
20240329
Don't forget to add freebsd-update cron to youe /etc/crontab file. Chapter 26. Updating and Upgrading FreeBSD

20240321
More stupid changes problems - really wish I'd spent more time reading and thinking about the changes in the release notes. Next thing to bite me is that they've changed where /home lives. Home directories used to go into /usr/home, and upon first use, a link would be created in / to point there. Now they've changed it to simply put them in /home. Ok fine, what's the problem?
The problem is that I have my system partitioned (the way we used to do it in the old days, see below), such that / is fairly small, it's basically just the bootable OS. Most everything else is in larger partitions, e.g. /usr which will swell over time to contain packages and other such stuff. /home can also grow out of control, so it was appropriate to be in /usr or even it's whole own partition. (I never went that far.)
So now, when I bring in my backup from the old system and 'tar' extract it into /home, I just suddenly filled up my main / directory!
I take partial blame, I did not pay sufficient attention, I just went along with things the way I've always done it. So -- now I have a running system with users on it, and I have to move /home.
Ideally, you would shut down the system, boot to single user, and simply do a move. My machine is colo-ed in a monster room full of racks and air conditioners, and is only remote accessible on a live system via 'ssh', so I can't do it this way.
WARNING WARNING WARNING! Do NOT just use a 'cp -R', this will lose all your file permissions and such. If you could do an 'mv', that would take care of it, but as it's a live system, files might disappear temporarily under customers - badness.
Try and do this during a quiet time on the system, e.g. at night -- as root:
cd /
mkdir /usr/home.new
tar -cf - -C /home . | tar -xpf - -C /usr/home.new
mv home home.bak
ln -s /usr/home home
cd /usr
mv home home.bak
mv home.new home
Of course make sure you can still login by doing a new 'ssh' session.
When satisfied all is well, 'rm -R' on both 'home.bak' files.

20240107
Bring over usrlocaletc backup, rename /usr/local/etc/namedb, untar previous into place, restart named service.
20240106
For all my old perl scripts with shebang syntax:
cd /usr/bin
ln -s /usr/local/bin/perl perl
Want to get my script working that checks certificates.
cpan install Config::Simple
cpan install DateTime
Errors out - look closely, it can't find 'curl'.
pkg install curl
Now DateTime again.
cpan install DateTime
cpan install DateTime::Format::Strptime
And for backup script:
cd /usr/local/lib/perl/site_perl
ftp to old system and mget VN*. Follow directions in VNNums.install
cpan install HTTP::Date
cpan install Net::FTP::Throttle
For comics reader:
cpan install URL::Encode
cpan install HTTP::Request
cpan install LWP
cpan install JSON

20240105
Breaking up today's work into seperate sessions - the first was getting the system up and running, this is where we start moving stuff over from the old system.

ftp over your backup files for 'root' and 'mikel'. 'tar' them into place. Edit bin/aliases to replace the xterm/xload alias color. Clean up cronfile for both of these guys, and do crontab cronfile for each.

pkg install bind918
sysrc named_enable="YES"
cd /etc
ln -s /usr/local/etc/namedb namedb (I've spent many years going to /etc/namedb)
cd namedb
rndc-confgen -a
Bring over master file from old system, and do merge.


20240105
I added a new set of 3 HDs to my RAID setup today. I went into BIOS via ctrl-R, and configured it up. Then, I completely dip-shitted out and initialized the existing VD instead of the new one - fuck, fuck, fuck. The reason this happened, is that the BIOS renumbered the VDs - the existing VD changed from VD0 to VD1, and the new one came in as VD0 - and I did not pay careful attention. Don't let this bite you.

So starting over, again. Boot from external HD, install doing the mfi magic described below.

For some reason giving DNS as my DSL modem gateway is not working, even though it's working fine on another FreeBSD12.4 system... Who knows, got things working by using the external CenturyLink DNS server 205.171.3.65.

Now to install 'pkg':
  pkg
Then the goal is to get remote access ASAP:
  pkg install xorg-minimal (yes, this was sufficient)
  pkg install xterm
  pkg install xload
Use 'vi' to edit /etc/rc.conf, and add the line:
sshd_flags="-o X11Forwarding=yes"
Note that you'll be changing it to the following once you've installed blacklistd:
sshd_flags="-o X11Forwarding=yes -o UseBlackListd=yes"
While you're there:
ftd_flags="-B -D"
Then:
service sshd restart
If you already had an 'ssh' session going, you'll need to close it. Now go back in and xterm and xload should work. Of course you'll need to do the standard
  setenv DISPLAY localhost:10.0

Be sure to add your personal user account to /etc/group on the root line so as to allow 'su' from 'ssh'.

Do vipw and replace that stupid "Charlie" name in the root user with the system name.

As of FreeBSD14, the default shell for 'root' is now 'sh', you'll want to correct this with chsh -s tcsh

I realized that the new disk was not yet mounted, so I decided to get that going before investing any more time updating in case it went all wrong and I had to reinstall again.
  mkdir /dsk2
  mount /dev/da1 /dsk2
gives an error, sorry, I've forgotten it already. Maybe it needs to be formatted?
  newfs -f 8192 -b 65536 /dev/da1
Now 'mount' again - all is well.
Edit /etc/fstab, add:
/dev/da1 /dsk2 ufs rw 2 2
then do:
mount -u
Hopefully this would give you a barf if you've messed up 'fstab' - you can brick your system with 'fstab' screwups.


20231225
(Merry Christmas!) Install mailman.

20231224
pkg install spamassassin
As pkg install instructs, add spamd options to /etc/rc.conf including chg user to spamd.
pkg install spamass-milter
Follow additional instructions at MikeL's spamass howto.
20231223
Install mysql. Summarize my MikeL's howto mysql install page:

20231222
install apache.
Install python.
Install php.
Bring over your backup world.
My ancient perl scripts all have old shebang syntax so: ln -s /usr/local/bin/perl /usr/bin/perl
cpan install HTTP::Date
cpan install Config::Simple
cd /usr/local/lib/perl5/site_perl. Copy in your VN* files.
cpan install Net::FTP::Throttle
Overnight daily run, I'm seeing: fetch: https://www.ietf.org/timezones/data/leap-seconds.list: Not Found
Fix by adding to /etc/rc.conf:
ntp_leapfile_sources: ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list (forum post)

Reboot, hit F2 to enter BIOS settings. Take "System BIOS" option. Take "System Profile Settings" option. Change "System Profile" to be "Performance Per Watt (OS)" to eliminate the boot error "CPU support Enhanced Speedstep, but is not recognized". (forum post)

20231221
FreeBSD no longer includes 'sendmail' by default.
pkg install sendmail
Follow the instructions from the pkg install:
cd /usr/local/lib/sasl2
Edit Sendmail.conf make sure it has pwcheck correct.
service saslauthd start
ps ax | grep sasl
cd /usr/local/etc/mail
cp mail.conf.sendmail mail.conf
service sendmail start
ps ax | grep sendmail
I'm doing my own hosting, I need 'named' (now 'bind'):
pkg search bind - Current latest is 9.18
pkg install bind918
ln -s /usr/local/etc/namedb /etc/namedb - this is the old location, makes it easier for me to find it
Follow the pkg install directions:
/usr/local/sbin/rndc-confgen -a

20231220
Make USB HD by using disk1.iso and balenaetcher. Plug it in, boot system.
Eventually you'll get a black bg screen with the option "F11 boot manager" - hit F11.
Eventually you'll get a menu with One-shot BIOS Boot Menu - down arrow to this and hit Enter.
Down-arrow to "[Hard drive] Disk connected to front USB", hit Enter.
When you get the FreeBSD boot menu, hit ESCape to go to loader.
At the prompt, enter set hw.mfi.mrsas_enable=1
Then enter boot
Eventually you'll get the blue bg FreeBSD Installer. Take Install.
Give full system with domain name. Take manual UFS partition. Specify as below. Note that it says 'da0' not 'mfi0'.
Specify your options, let it install.
Configure your network, root pswd, self user, etc.
When done, you're given the option "exit to shell to make any changes" - do this.
cd /boot
cp loader.conf loader.conf.bak
Use vi to edit loader.conf. Add the line:
hw.mfi.mrsas_enable=1
cd /etc
Use cat to confirm that fstab and rc.conf mention "da0" not "mfi0". If the latter, use vi to change it
Enter exit then take reboot option.
Tried installing xorg-minimal but did not get a functional window back, just the worthless "Error: can't open display" message. Install full "xorg", still no good. Closed out my ssh session, went back in and now it's working. I don't know if -minimal would have sufficed, I'll try that again next time. (See comments above 20240205.)
20231216
Have still been seeing the 'mfid0:' error intermittantly, so decided to work on that. Found the following: PLEASE READ if you use the mfi(4) driver with a newer RAID adapter.

So edit /etc/fstab and replace all references to 'mfi0' with 'da0'. Then edit /boot/loader.conf and add the line hw.mfi.mrsas_enable=1. It also says to do the replace in /etc/rc.conf, but I had nothing to change. I'm now booted into the system, we'll keep an eye out for that error in the future. (Couple days later - not seeing any disk errors, looks like it worked.)

I'm paranoid about the error I originally got when installing - it seems to me that there's a bad file on the disk somewhere that I may or may not ever hit, so I'm going to reinstall afresh again, this time using the 'da' drivers - I got advice from the forums.freebsd.org forum. See above for details.


20231210
Well, I haven't done anything with this system for a couple weeks, and I've finally gotten back to it. I have spent an entire afternoon, about 5+ hours, just trying to get an xterm back to an existing desktop computer that already works as this will be a headless machine locked in a remote co-lo site.

Finally got this figured out, if I had read the release notes I would have had the answer... New with FreeBSD14, you'll need to do:
    sysrc sshd_flags="-o X11Forwarding=yes"

BTW: If you do this manually (editing /etc/rc.conf), when done, do sysrc -a which does a syntax check. Errors in this file can leave you with an unbootable system.


20231123

Dell R730 server. Note that although this is an Intel processor machine, you want to use the 64bit OS, namely amd64. I have 3x 1Tb disks in a RAID5 configuration. (There was a fair amount of work getting the IDRAC updated and updating, I did not document it, sorry. I was able to get IDRAC to be able to handle updating the server though, it is worth doing the updates to get it there.) (While you're in IDRAC, see BIOS settings above 20231222.)

I did not find an option to boot from USB, so I went with the DVD option. Downloaded FreeBSD-14.0-RELEASE-amd64-dvd.iso onto Win11 desktop machine. Right-clicked on filename, took "burn image" option.
Booted server to DVD. Deselected debug stuff, selected src and ports. Took manual partitioning with MBR. It took the liberty of creating a boot partition of 512MB.
16GB freebsd-ufs /
64GB freebsd-ufs /tmp
4GB freebsd-swap
368GB freebsd-ufs /var
[remainder]GB freebsd-ufs /usr
This showed errors, and would not boot.

Went into Lifecycle Controller and selected OS Deployment. The "any other OS" option is a dead end, all options are grayed out. Tried selecting Windows server 2019, and selected my DVD in the drive - it did show up. Reboots and then boots from DVD. Looks the same as last time. This time I deleted all my previous partitions, and let it do auto, let's see if we get a bootable system this way.

As with previous attempt, I got a few "MFI0: failed to get command" errors. I don't know if this is a problem, but Yay! System now boots to FreeBSD! (see above 20231215)

I'm going to try again as I really want separate partitions, namely so that /tmp will be alone, thus cannot overflow the rest of the disk. I just booted the DVD again, and started again. This time however, due to the mfi0 error in 'lib32' load, I'm skipping that. Also skipping 'src' and of course skipping any debug.
I went into "manual" partition editing, deleted the main partition, leaving behind the 4G swap auto had previously created, then created as list above.

Then gosub new install release 10


Copyright © 1995-2024 Mike Lempriere (running on host bayanus)