April 2, 2024

Fedora 39 -- fresh install on new disk (for cholla)

See my adventures in this page. Disk errors prevent me from doing a F37 to F38 upgrade. The system continues to run F37, but the wise person will take the first hint of disk problems to replace the disk, being thankful that they got warning before it failed entirely. I got on Amazon and found a WD20EZBZ for $68. It is a 7200 rpm "blue" with 32M cache. Manufactured Feb 3, 2024 with a 2 year warranty Sold through Amazon by the Western Digital Store. It arrives in retail packaging.

Download the new Fedora

I search for "Fedora 39 xfce spin download" and start the download from here: This is a 1.7G iso image:
-rw-r--r-- 1 tom tom 1712130048 Apr  1 15:04 Fedora-Xfce-Live-x86_64-39-1.5.iso
Then I do this to an 8G flash stick I have laying around:
su
dd if=Fedora-Xfce-Live-x86_64-39-1.5.iso of=/dev/sde bs=64M
Be very careful to get the correct device name for the flash stick! Also I find it useful to type commands into an update log (like this very one I am now composing), then but and paste them onto the command line to avoid typos.

This is a live ISO image that can either be used to run F39 or to install it. I will use it to do the latter.

Run the live CD and install

I have a computer at home that I use to run Windows. It has a single SATA hard drive. I disconnect that drive and connect my new drive in its place. As I remember, this system was fussy about which USB slots it was willing to use to boot an ISO from. I plug my flash stick ("jump drive") into one of the USB slots that is part of the motherboard, right below the keyboard and mouse.

It has an ASUS motherboard and the DEL key gets me to the BIOS. I select UEFI boot (which it tells me is the lexar jump drive), this takes me to a Grub screen, which is good. I tell it to test media and then boot F39. I am now running F39 from the live USB ISO.

I get a Fedora desktop with the XFCE mouse. The lowest icon on the left says "install the live CD to your hard drive". I double click it and find myself in the Fedora installer.

I want to configure the "install destination". The vital thing is on the first screen to select "Custom" rather than "Automatic" configuration. After doing this you can thrash through the non-intuitive partitioning GUI.

I would like to end up with a partition scheme about like this:

sda1 - biosboot
sda2 - /boot 4G (was 600M)
sda3 - /  200G  (was 50G)
sda4 - swap  32G (was 16G)
sda5 - /u1 - the remainder (was only 11 percent full)
It is important (for me anyway) to tell it to use standard partitions.

I use the "+" key to add partitions, starting with biosboot. I let that default to 2M.

When I get to /u1, I simply don't give a size and it sets it up to use the rest of the disk (about 1.5G).

This went pretty smooth, but I have done this before and residual memory helps a lot.

I enable the root account, set a password, and click the box that says to allow ssh access for root with a password.

I add a user "tom" and use the advanced section to set the uid/gid to 104:104 The installer wants to force me to use 1000 or greater, so I will have to force this issue later. I use 1004:1004 for now.

Network and hostname do not allow me to set a static IP, so this is another thing I will have to force later.

It has the Phoenix timezone set, so I am ready to begin installation. Away it goes at 4:06 PM. In less than 10 minutes (4:13 PM) it tells me that the install is done and that I should reboot. I click "Done" and it takes me back to the live CD.

I pull the flash stick and press the reset button.

Configure the system

It boots up. I login as user "tom". It thinks it is "cholla" with an IP it got via DHCP (0.123).

On my home machine I set up an entry in /etc/hosts for "clam". It refuses ssh connections on port 22.

I type "dnf update" and after I say yes to a GPG key, it gets busy upgrading 615 packages.

When it is done there is a 6.7.10 kernel installed (and I am running 6.5.6), so ...

su
sync
reboot

Checklist

Disable selinux
Set static IP
Be sure firewall allows ssh and http
verify ssh access
fix tom uid/gid
Enable auto updates
Set up web server
Add /u1 (and /u2) to fstab
mirroring of /u1 to /u2
reboot and check everything

Static IP

What you want is nmcli in a terminal window. There does not seem to be any access to network settings from an XFCE settings GUI. Here is what I do:
su
nmcli con down "Wired connection 1"
nmcli con add type ethernet con-name Wired ifname eno1 ip4 192.168.0.6/24 gw4 192.168.0.1
nmcli con del "Wired connection 1"
I expected to have to do a "nmcli con up" on Wired, but that seems to happen automatically when I add it (and when there is no other connection on en01).

Note that /etc/hostname contains "cholla" and I am leaving that be for now.

DNS

This turns out to be part of setting up the static IP. I do this:
nmcli con modify Wired ipv4.dns 199.104.150.50
nmcli con down Wired
nmcli con up Wired

Allow ssh via firewall

firewall-cmd --list-services
dhcpv6-client mdns ssh
It turns out that the problem was not ssh being blocked by the firewall, but sshd was not running. Solve this via:
systemctl start sshd.service
systemctl enable sshd.service
Now that I have ssh running, I can connect from my main system via ssh and not have to roll my chair back and forth across the room. Also I don't have to fight with the screensaver. Also I can cut and paste commands from my files with notes.

Nuke selinux

Edit /etc/selinux/config and change from enforcing to disabled and reboot. You must reboot as far as I know.

I use "sestatus" to verify that it is disabled and smile.

Fix the uid/gid for "tom"

I have about 5 million files marked with uid/gid 104 from old times, and I just don't care about new ideas limiting users to 1000 and above. I'll note that there is a group "input" with gid of 104. I move that line below that for tom in /etc/group and feel good.

Edit /etc/passwd and /etc/group to make it so, then:

cd /home
chown -R tom:tom tom
I log out and back in to ensure that I can login as user tom, and it all seems fine.

Set up /u1 and /u2

I am surprised and pleased to find /u1 already mounted (I specified it when I did the partitioning during install). Later I will need to add /u2 to the fstab and reenable mirroring.

Install and start a webserver

dnf -y install httpd
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
systemctl start httpd.service
systemctl enable httpd.service
I aim my browser at: http://gila/ and see the Fedora Webserver test page.

I want to use /u1/www for my web page, not /var/www/html. This involves editing /etc/httpd/conf/httpd.conf . I make the changes here to change the documentroot to /u1/www and restart the server:

systemctl restart httpd.service

Set up dnf-automatic

dnf install dnf-automatic
vi /etc/dnf/automatic.conf
systemctl enable dnf-automatic.timer
systemctl start dnf-automatic.timer
The only line I edit is:
apply_updates = yes

On site configuration

Another checklist:
Change the IP number
copy all the old content into /u1
remove the old (bad) disk
set up the /u2 mount point and mount it
set up the mirroring /u1 to /u2
ensure that the web pages work
ensure that remote ssh works

Reestablish the mirroring

This is done via the following script, named "tjt_backup" in /etc/cron.daily:
#!/bin/sh

/home/tom/Backup/cholla_daily

exit 0
I placed this file there, ensured it was executable and owned by root, and will keep an eye on things to be sure it is working.

Final notes

Doing the F39 install at home and then transplanting the new disk into the system at the office worked well, with only a couple of hitches. The big one was adding DNS to the static IP setup (see above)

The top drive in the case is the root and /u1 drive, the bottom holds /u2

The following are old well known schemes using tar and pipes to copy files:

# before moving disk cables around
tar cvf /u1/root.tar --one-file-system -X /home/tom/excludes
# with the new disk in place as /u1, and the old disk as /u2
# the old /u2 just "off to the side" for the time being.
cd /u1
( cd /u2; tar cvf - . ) | tar xpvf -
And this info was important to jot down:
cholla IP - 199.104.150.52/24
gateway IP - 199.104.150.1
DNS IP - 199.104.150.50
At this point, I rarely if ever use cholla as a desktop system in my office. It is just a server that could be headless that provides ssh and http. If I start using it in the office, I will need to install other packages and do more setup.
Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org