How to prepare a CF card with the system - retrotruestory/M1DEV GitHub Wiki

I had intended to suggest that you make a backup image of the compact flash before starting. Minix is very susceptible to drive damage if the machine crashes or is turned off without shutting down first, so this kind of thing happens to me a lot as well.

My backup strategy is to take "dd" images fairly frequently. Also, I use 2 IDE2CF adapters - one master and one slave - so I can switch between them to recover files from a damaged drive.

Anyway, here is a link to an image:

https://drive.google.com/file/d/1T4g5juSll0WbCOs_5AvW6yLq3hYRSGju/view?usp=sharing

To recover the image, use a USB to CF adapter on your laptop. I assume there is a "dd" port for Windows, but if not you should be able to run real dd under a Linux virtual machine. On my system, the USB to CF adapter shows up as /dev/sdb, so my recovery command would be:

sudo dd if=m1_02_15_2025.dd of=/dev/sdb

Similarly, to do a backup: "sudo dd if=/dev/sdb of=m1_xx_xx_xxxx.dd"

I have only created a disk completely from blank twice (and that was more than 15 years ago). I recall that it was quite difficult and time-consuming. Since then, I have largely just used dd to recover the image with 256MB CF disks.

I know I built a lot of drive initialization commands into the monitor program, but it's been so long I don't know if they still work. I strongly recommend just using dd images to recover, but if you want to try a different-sized CF card, then it would probably be best to do it from a system running Minix on the Master IDE slot while building up a new image on a CF card in the slave slot. To use a slave CF card, you need can use a standard IDE cable with master and slave connectors along with an additional IDE2CF adapter. Just be sure to jumper the adapters correctly.

Assuming you have a running Magic-1 Minix system that booted off of the master IDE drive, you would create a new image on the slave IDE drive roughly as follows:

Run the Minix partition manager: "part /dev/c0d1". Then, create a MAGIC1 partition (code 76) that runs from sector 32 through sector 20480. Follow that with up to 3 additional MINIX partitions (code 81) that are no more than 64 mbytes (65536 Kb). Be sure to write the partition table (see the man page for "part" on Minix". Use "dd" to blindly copy the MAGIC1 partition from the Master to Slave drive. It should go something like: "dd if=/dev/c0d0p0 of=/dev/c0d1p0". In other words, copy partition 0 of the master drive (c0d0) to partition 0 of the slave drive (c0d1). I don't remember, but you might need to also copy the sectors between the MBR and the beginning of partition 0.
Next, create the Minix file system on each of the new Minix partitions of the slave drive. "mkfs /dev/c0d1p1", "mkfs /dev/c0d1p2" and "mkfs /dev/c0d1p3". If you have 64Mbyte partitions on the new drive, you can use dd to image them. Otherwise, you'll need to go the hard route and build them from scratch as follows. Mount the new drive to copy the Minix files. Assuming you have a "/mnt" directory, do "mount /dev/c0d1p1" and then start creating directories and copying files. I don't have a script to do this automatically, and I think it would be a lot of work. You would need to use "mknod" to create the special files in /dev and would also need to make sure you get permissions correct. At minimum, you'd need the device files in /dev, the Minix files in /minix, the utilities in /bin and /usr/bin and I think some things from /usr/lib. To assist, Minix did come with some setup and installation scripts that can be found in /usr/lib/scripts - but I doubt they would work for Magic-1 Minix. Still might give some hints, though.

..Bill

⚠️ **GitHub.com Fallback** ⚠️