Retro Again – G4 Mac Mini Running Mac OS9

I’ve just got a G4 Mac Mini up and running Mac OS9. About six months ago I gave away a MDD (Mirror Disk Door) Mac, that I’d been keeping around in order to install Mac OS9. I got fed up of it hanging around and since it would not boot onto Facebook Marketplace it went But about a month ago I spotted a post in the r/vintageMacs subreddit, where somebody had started buying old G4 Mac Minis, upgrading them with SSD, then installing a hacked version of Mac OS9 that installed on them.


The G4 Mac Mini was only ever shipped with OS X. It ran Classic, but would not boot Mac OS9. Turns out [a few clever people on the macos9lives forum had swapped out the rom for the G4 Cube and messed about with it to boot Mac OS9. There’s an ISO of an installer for the unsupported G4 Mac Mini on that forum.

This is now the fastest G4 that will run Mac OS9. I guess there’s the G5 Mac Pro, but as of yet nobody has done this one, and I guess it will never happen as that would require a new kernel?. However, there are plenty of G4 Mac Minis out there for next to nothing.
These have IDE discs (the Intel Mac Mini moved to SATA). These clever people have also searched mSATA/IDE adaptors. There are so many of these available for next to nothing. I guess meant for somebody to plug into their old laptop they want to keep going.

So on eBay I went and got an Integral 128GB mSATA Internal SSD together with a Chenyang SA-106 CY mSATA Mini PCI-E SATA SSD to 2.5 inch IDE 44pin Hard Disk Case Enclosure. I removed the plastic case to increase air flow though.

Installation

I initially struggled as I could not get the optical drive to work. At first I thought it was because a few posts said the drive on the G4 Mac Minis would not recognise a 700mb cdr. So I found a pack of (expensive!) 650mb CDrs. But these failed too. However, I remembered that I had a cheap IDE-USB adaptor that I bought (for reasons I do not remember). I used OSX and Super Duper to create a bootable partition on a USB connected drive (for some reason two old Firewire drives I had would just not work). I then booted from these and used a tool called iBored to image the install ISO to the original drive still in the Mac. I then booted from the installer on the original disk, installed (using the Apple Restore IMG on that ISO) to the adaptor connected mSATA drive, swapped the drives over and fairly soon I was running Mac OS9 on that G4 Mac Mini.

Of course it was not as simple as that. Turns out my Mac Mini was the 1.5Ghz one. This has extra difficulties that the earlier Macs did not. Graphics was a pain. VGA allowed me to run my Dell 1920×1200 at fill res. But under DVI the screen was corrupted. But I found an extra driver on the macos9lives forum that solved that for me. Well nearly as I cannot go above 1900×1080.

The optical drive still did not work. I bought a new one that also failed as it was a generic rather than an Apple device. I thought only the OldWorld Macs needed those. I even dug a drive out of an old Macbook Pro. Which also failed. But I then found out that Mac OS9 will boot from a IDE drive connected via this USB/IDE device. I guess as it presents itself to the Mac as an IDE device (in the Mac OS9 System Profiler it is listed as an ATA device). I eventually had to install a second time and this made swapping the drives redundant and so I had no need of an optical drive.

Networking

Configuration on install

Mac OS9 is fine with DHCP, although the fairly dumb “registration” process asks you all sorts of daft questions that perhaps were relevant then, but are fairly archaic and annoying now. e.g. POP server, “do you want to connect via modem” etc..

Sharing files

For sharing Netatalk is an AFP server (remember Apple have deprecated this in favour of SMB3) that runs fine on Debian. Rather than install it using APT, which then pulls in all sorts of stuff to get zerofconfig network discovery working Avahi, mDNSResponder etc.) I used a Docker image. I could not get authentication working, so I had to change the afp.conf to allow anonymous discovery. Then creating an SMB share of the same folder I can easily share files.

First lot of potatoes in the ground (well dirt at least!).

After chitting the potatoes back in February I just got the first lot in the ground. I put these seed potatoes (four varieties) to chit much earlier than I normally do, so they’ve been slow. Normally three weeks would be sufficient to get some sprouts about 25mm long. After five weeks these Red Duke of York (first earlies) were ready so into the soil they can go.

Seed potatoes laying in a green tray chitting.
Seed potatoes chitting

Once you have 25/35mm of shoots, just pinch all but one, then place them upright into the ground.

Normally I place spuds in trenches in the ground, but in the past few years I’ve been putting First Earlies into these repurposed water butts (that were leaking). I put them half way down, cover with a bit of soil, then as the shoots appear keep earthing over until the butts are full. Potatoes grow above the seed potato so if you keep them deep you get more potatoes! Otherwise any that grow above the ground, and get exposed to light, go green (which makes them poisonous!).

Seed potatoes laying ion alayer of earth
Seed potatoes at the bottom of a waterbutt
Two green waterbutts by a fence on the river's edge.
Waterbutts

Spring-ish

I do like this time of year. It’s just a few weeks to Spring. Winter still has frosts and grey misery to throw at you, but its time is limited.

The garden has switched from soggy grass to life. The snowdrops and aconites have mostly gone. But the daffs and hyacinths are in full bloom. Plus so many other plants have promising buds showing. From the apple trees (now pruned) to the my tree peony.

In no particular order here are some photos of our messy garden!

Blue hyacinth against grass.
Hyacinth
white and yellow daffodils in front of a polytunnel
Daffodils
Hyacinth
Daffodils and snowdrops

Holiday journal

A long empty beach with a blue sky

Note: Since this draft post has remained in my drafts (using Drafts!) for six months now I guess a regular holiday journal is a bit beyond my blogging abilities! Oh well. Perhaps this year.

Earlier this (now last!) year I did a holiday journal. In a self deprecating offhand comment I said it was a one off. So here we are on the last day of the summer holiday and I remember to write my journal. Ah! I did not think I’d be so bad bad (even worse – see note above!)

Anyway here’s a few highlights. All written retrospectively. If I forget to do another daily blog for our next holiday then I will abandon the idea as unworkable. I’ve never been one for routine tasks. Even at 55 years old I still struggle to remember to brush my teeth daily).

# Sunday
Arrival at the campsite.


# Monday
First proper day of holidays whilst finishing the tent setup. But we did have lunch on the beach!

Also the day I discover that a new camera I recently added to my home built CCTV system (using [Motion](https://motion-project.github.io/)l) is generating a LOT of images/video. About 3TB in one day. Normally not a problem as a script will remove them at the end of each day. However, at some point I’d used “11” to the “mtime” variable to “find”…! So it was keeping 11 days of temporary files. Having to edit a script on a iPhone using VIM is not that attractive. Even with Tmux.

The Camera is a Reolink 4K IP PoE Camera Outdoor CCTV RLC-810A

This day was also a festival with fireworks. Pretty cool to watch a fireworks display whilst sat on the beach. The fireworks had a large “fall zone” and I guess had been set to explode lower as I did not have to strain my neck watching them!

# Tuesday
Pool and beach day with a stroll into town for dinner.

# Wednesday

Err. see the previous day for the exact same activities….!

# Thursday

A beach day, but this time we rented bikes and cycled along the coast to a lovely beach bar.

Quite amazingly spotted a fresh pizza vending machine!


# Friday

Another cycle along the coast for a fresh local beer. Lovely.

# Saturday

Beach!

# Sunday

Beach # Monday

# Tuesday
Getting boring now (which is the point of a relaxing holiday, but not necessarily an interesting blog post).

# Wednesday

# Thursday
A trip across the bay to Ile de Ré on a RIB. Outwards we were drenched. The overnight storm had not properly calmed down and the waves were big. I guess ripples are big at 40kph in a boat.


On the way back it was like a mirror.


I had a grapefruit ice cream at the famous ice cream shop in the harbour.

# Friday
A day of relaxing prior to leaving the next morning.

# Saturday
Drive to near Nante to stay at the brother in law’s for two nights.

# Monday
Drive across France to Douai to stay with the parents in law

# Tuesday
Drive back home via the Tunnel. Journey quite good and uneventful although quite a bit of Brexit swearing whilst waiting for passport control (fuck brexit).

Chitting!

Ten green trays with four varieties of seed potatoes in an untidy shed!
Left to right- Red Duke of York, Charlotte, Pink Fir Apple and Caledonian rose!

I’ve started early with the spuds this year. Chitting is the process of leaving them in daylight to get the shouts growing. Helps them get started quickly when you then bury them.

They are ready to plant when you have a 20/30mm of shouts. Remove all but the strongest then plant them at the bottom of a trench and just cover with soil. The spuds grow above the seed potatoe so as the shouts grow keep piling earth on top.

Adding two SATA SSD devices to a RAID10 six SATA array.

I needed a bit more space on my NAS’s RAID10 array which was 6 x 2TB drives.To be honest iI’m not sure why I am using RAID10. The array was initially on my main Linux workstation. Then I decided I needed a separate NAS as my existing NAS was way too small, so I moved it across. RAID5/6 would give me more space. But I guess I like the flexibility and the ability to survive failure of two disks even though it does reduce space by 50%!

The server is running Debian and is headless. I know there’s loads of NAS OSs. But I do prefer to do things myself. The boot/root partitions are on a single SATA SSD card and the (now) eight drives are plugged into a Seagate Smart Host bus Adaptor H240.

I found two “consumer” Crucial 2TB SSD disks on Black Friday for £65 which seemed reasonable. I did wonder how well two SSDs would do in a RAIDarray with spinning drives. Let’s find out….! So this is what I did (which I am blogging about so I do not have to remember next time!). Interestingly the last time I blogged about growing a RAID array was quite some time ago. Also that’s the only time I’ve ever got comments on my blog (127 to be exact!). I think growing RAID arrays with MDADM was quite new back then.

The procedure to add new devices and grow the raid array is:

Procedure to grow an array with two new disks

  • physically add new disks
  • Partition
  • add disks to array
  • increase number of active disks in array to grow the array
  • grow filesystem

The new disks are /dev/sda /dev/sdd

Partition

For GPT use sgdisk to copy the partition table from one disk to a new one

Backup first of course!

sgdisk /dev/sdX -R /dev/sdY

sgdisk -G /dev/sdY

“The first command copies the partition table of sdb to sda/d

sgdisk /dev/sdb -R /dev/sda

sgdisk /dev/sdb -R /dev/sdd

Now randomise the GUID of each device:

sgdisk -G /dev/sdd

sgdisk -G /dev/sda

Add new devices

mdadm --add /dev/md1 /dev/sdd1 /dev/sda1

mdadm: added /dev/sdd1

mdadm: added /dev/sda1

These are added as spares as the number of active devices does not change. Let’s check:

# cat /proc/mdstat
Personalities : [raid10] [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4]
md1 : active raid10 sda1[8](S) sdd1[7](S) sdc1[5] sdg1[0] sde1[6] sdh1[3] sdb1[1] sdf1[4]
5860141056 blocks super 1.2 512K chunks 2 near-copies [6/6] [UUUUUU]
bitmap: 4/22 pages [16KB], 131072KB chunk

Increase number of devices to include new ones

mdadm --grow --raid-devices=8 --backup-file=/mnt/USB/grown_md1.bak /dev/md1

The –backup-file creates a backup file in case the power goes. Not essential as I have a UPS. Also the filesystem is still mounted. However, to speed it up I turned off all services except the DNS/DHCP server. The less disk activity the quicker the reshape will finish.

The reshaping took about 20 hours. Much less than I thought.

Now we need to resize the filesystem. Unmounting is not essential for growing a ext4 filesystem (although it is for shrinking), but hey it’s a lot safer so I shut off everything and unmounted it

systemctl stop smbd
systemctl stop docker
umount /mnt/storage

resize2fs /dev/md1

This gave an error that the filesystem needed checking first.

e2fsck -f /dev/md1

resize2fs /dev/md1

This took about 30 minutes.

Finishing off.

Now let’s get it all back up and running.

mount /mnt/storage

systemctl start docker

systemctl start samba

systemctl start smbd

systemctl start docker

systemctl restart docker

The entry for the mdadm device does not need updating. Previous it did but I think that’s when I was using the 0.9 metadata block.

mdadm --detail --scan

cat /etc/mdadm/mdadm.conf

One bizarre issue was that when I restarted all the docker containers they downloaded a new image rather than using existing images. I have no idea why that happened.

Plan9 – what I do after an install

This was written in Markdown using acme on Plan9 with an sshfs mounted folder of my NextCloud setup (via a Linux host). Tidied up in Drafts, then posted on macOS using Marsedit! This post is for me really. ..it will also be a WIP.

initial post install stuff

Create a new user

Everybody seems to use the default user, Glenda (from Plan9 from outer space). This is the equivalent of a root* unix user. Except I do not like that.

*Well almost. There is no root user that is all powerful in plan9

This also shows how you run a lot of command stuff by cat’ing text to the running process. cwfs.cmd is the file server process that runs the CWFS filesystem (it’s different if you run another filesystem). You can do this in one step with the “con” tool. But i prefer to do each step one by one as I remember it better.

echo newuser chris >>/srv/cwfs.cmd

You also need to add the new user to the sys and upas groups.

echo newuser sys +chris >>/srv/cwfs.cmd

echo newuser upas +chris >>/srv/cwfs.cmd

Various how to pages also suggest the “adm” group too. I think this is equivalent to root. I have not yet added my user to it and not found any errors.

term% cat /adm/users
-1:adm:adm:glenda
0:none::
1:tor:tor:
2:glenda:glenda:
3:chris:chris:
10000:sys::glenda,chris
10001:map:map:
10002:doc::
10003:upas:upas:glenda,chris
10004:font::
10005:bootes:bootes:

I’ve no idea what the other groups are for!

Then reboot, login as this user. You will see errors. But run the newuser script to setup your $home folder and profile


/sys/lib/newuser

customise plan9.ini

This requires you to mount the 9fat filesystem which contains a plain text file (hey everything is plain text file!) that configures the boot process.


9fs 9fat
cd /n/9fat


“9fs” is equivalent to mount and “9fat” is the partition.


Nice and simple.


You now need to familiarise yourself with a text editor. Acme is the best. I have found myself having to use “ed” a streaming text editor. It’s Ok, but very basic and quite painful to do anything other than simple emergency edits. Keep backups!

acme plan9.ini

Setup plan9.ini to boot straightway into my user account

Once you have your user then you can bypass which filesystem to boot and which user to boot into.
Remembering that at anytime you are promoted for options in the boot process then you can type “!rc” at a prompt to launch a minimal terminal to fix the issue. ..and booting from the USB install image always allows you to easily mount the 9fat partition and fix things.

change the video driver to IGFX

customise your desktop – rio

Rio is the windowing application.

To customise Rio you need to edit your profile

acme $home/lib/profile

I now configure my profile to load a “$home/bin/rc/riostart”, which autostart a few tools and a few “rc” shells.
Change

rio

to

rio -i riostart

Mine is:

#!/bin/rcwindow 0,0,161,117 stats -lmiscewindow -miny 130
window bar
# run a system shell on the serial console
~ $#console 0 || window -scroll console`

Bar is a cool little tool you will have to compile and install.

Change the font

Change the following line. There are many different fonts in /lib/font:

#font=/lib/font/bit/vga/unicode.font
font=/lib/font/bit/dejavusans/unicode.14.font

keyboard

Add this line just before loading rio:


cat /sys/lib/kbmap/uk > /dev/kbmap

misc

Setup SSH

The instructions are here. However, there is an omission in that first line as “role=client” needs to be added.

auth/rsagen -t 'service=ssh role=client' >$home/lib/sshkey # generate private key
auth/rsa2ssh $home/lib/sshkey >$home/lib/sshkey.pub # generate public key, if you need to share it
cat $home/lib/sshkey >/mnt/factotum/ctl # put the private key in the password manager
echo 'ssh sha256=DDDDDDDDDDDDDDDDDDDDDDDD server=scotgate.pixies' >> /usr/chris/lib/sshthumbs

a few useful tips

Mounting a linux filesystem over SSH

sshfs is useful.

sshfs chris@scotgate.pixies
cd /n/ssh

..will mount your $home folder on the remote host as /n/ssh

Note if you are using Drawterm then /srv/ has your root filesystem of the host already.

Software to install

Treason

River Cam gauge

In a break from my usual plan9ing here’s the gauge for the lock just upstream of us on the River Cam from Shoothill River Gauge map. I had the boat turned around facing downstream as I was cleaning it last week. The back of the boat with its rudders and props is much more vunerable to damage from debris. With the biblical rain yesterday I saw the river had risen and dropped overnight (mud was deposited). Generally when that happens then 24 hours later the river rises again as rain from upstream reaches us. The river did not look to be running that fast, so I decided to turn the boat around by ropes in anticipation of the stronger flows to come. Whoops. The river flow was quite deceptive. It was a real struggle to spin the boat around. All done safely now.

So here’s a gauge for the river flows.

This is the code.

<iframe frameborder="0" width="300" height="446" src="https://gaugemap.blob.core.windows.net/gaugemapwidgets/1769-1909-3-300x446.html"></iframe>

The EA/.gov site says the level is normal albeit still rising:

River Cam level at Cambridge Baits Bite

Plan9 continues

So Plan9 is becoming a very large time sink! After playing with a VM/QEMU I decided to buy a cheap minipc and install on some real hardware (Lenovo ThinkCentre with 16GB Ram and an i5 – £70 from eBay).

Installing the 9front fork of Plan9 is really easy. I did decide to complicate matters and use two drives so I had to manually partition them as the install script is quite simplistic (but really does make life easier!). Plan9 is a distributed OS. It needs a CPU server a file server, and auth(entication) server and then clients. Due to it’s quite ancient heritage the file system (CWFS) uses a cache and a WORM (write once read many) partition. Which in times gone by could have been an optical drive jukebox. As the name suggests this partition is read from, but writes are instead done to the fscache drive.

Other partitions are:

  • 9fat (DOS partition where the boot parameters are stored in a file called plan9.ini)
  • other
  • nvram (used to simulate a real NVRAM storage where authentication stuff is stored).

Drive/partition naming is very similar to linux

/dev/sdE1/fscache
/dev/sdE0/fsworm

So for some inane reason I put the WORM partition on one largish SATA spinning drive and the rest on a different drive. Of course I made life harder for myself. plan9 prides itself on a simple filesystem. It does not really have command completion as the philosophy is that files should not be squirrelled away in hard to remember locations (you do have simple filename completion with CTRL – f). Not sure I quite agree with that, but what it does is automatically find portions and mount then (no stab needed here). But of course since my main partitions are on a separate drive which I went and attached to the second SATA port, then it cannot find them so I do have to specify them in plan9.ini

9fs 9fat
cd /n/9fat
acme /n/9fat/plan9.ini

(More on acme later. A quick to learn but wacky text editor).

Of course I found this out the hard way with an unbootable system in configuring the system to allow remote connections (see next section). But a quick reboot from the install USB stick. I mounted the 9fat partition. Unfortunately without a graphical environment none of the text editors worked. But sed does. A quick reboot later and all was well. But now I do create backups when I edit plan9.ini!

Now how do I connect to this headless plan9 server. With Drawterm of course! Drawterm is an emulated plan9 client. Calling it emulated is not really accurate as it runs natively on whatever OS you install on (for me that was Linux) and it brings the 9p protocol to connect.

But to do this you need to configure the authentication server and allow remote connections

Anyway with the networked OS model I got Drawterm working on Linux and the CPU, file and auth servers are all running on the ThinkCentre.

So after quite a few hours I find myself with this!

Drawterm on the right, Plan9 under QEMU on the left

Plan9 running under QEMU, with Drawterm on the right connected to a real Plan9 server.

Spot the difference?

No, me neither!

Taking procrastination further – Installing Plan9 under QEMU

So instead of doing something useful and needed (like gardening!) during a few hours off last week I decided that what I really needed to do was install plan9!

A few months back I got various Windows NT VMs and OS/2 VMs running. Then Haiku (a port of BeOs) the other week and now this….!

I started with the last “official” build of Plan 9. This was difficult and I had to abandon it as I just could not get it sufficiently configured to launch Rio (the window manager). However, further googling shows that there is a port of plan9 called 9front. This is under continual development and the build I installed was just a few months old. Under QEMU (using libvirtd) it was a pretty hassle free install.

Once installed I found that there is also a recent port of NetSurf, as the two existing browsers are a few decades behind. Downloading the sources from Git, compiling and installing was quite straightforward. The only hurdle was that text does not auto scroll in terminals. Not a significant hurdle you may think. But I guess due to “everything is a file” when the text reaches the end of the terminal then the process stops working. Here as soon as the build script got to the bottom of the terminal it just stopped compiling. Luckily there is an auto scroll option.

  • Middle click and choose SCROLL/NOSCROLL
  • Incidentally you really need a three button mouse. For example to open a new terminal:

  • RIGHT CLICK
  • Choose NEW
  • The cursor changes to a cross. With the RIGHT MOUSE BUTTON draw where you need the new terminal to be.
  • Screenshot from 2023 09 08 14 18 18

    Screenshot from 2023 09 11 12 31 52

    I have no idea what I will do with it. But that goes for more or less all the VMs I have. Install, fire up a few times, then never again.