While we’re waiting. Recovering a disk.

As some of you might know, my old server harddrive ran into a series of problems. And no I don’t have a backup.

It all started with that sometimes the server, which is a small ITX board with Atom processor running VMWare ESXi, just stopped responding. So a hard reboot was required. I found out that accessing a few places on the guest servers OS, made this happen (hence why my backups failed).

I disregarded it until it died completely, I couldn’t boot the guest OS.

I should mention that the harddrive is a Seagate 1TB SATA2 drive.

I found out that the harddrive has bad blocks. And when these bad blocks were accessed, the harddrive would just stop responding, a power cycle (unplug hdd power and reinsert) would bring it back again. I tried doing a unix dd, which is a cloning of the harddrive, Windows users might relate to Ghost or ImageCast. The dd command didn’t work of course as the drive would stop responding when accessing the bad blocks.

I mentioned this to some of my associates at my weekly retro evening, which PHK and UJ both said.. hey, you should try recoverdisk from FreeBSD. So I did.

recoverdisk is similar to dd-rescue, basically a resumeable dd command.

3 weeks after starting, and unplugging/replugging power to the drive, restarting the command stopping the script, repeat. I was close to an end.. I got to 100% woohoo !! or not I found out at one time I’ve rebooted the computer and forgot to mount the target disk. There were two things to do, start over or try and grab the data that was separated, it was stored on the local disk anyway. The later seemed like a tedious task, so I went with a do-over. At the time of writing I’m around 87% done. Luckily for me it’s much faster this time as I’m using the drives on a SATA controller, where before it was on a USB to SATA adapter.


Back to the superb tool, which is part of the FreeBSD operating system: recoverdisk.

Recoverdisk is a command line utility and is quite simple to use actually.

What recoverdisk do, is that given the right parameters dumps the disk and keeps a logfile of what it’s done. It takes all the good blocks first, if it hits a bad block, it tries to copy that. If it’s unsuccessful it skips the bad until next pass. Where it adjusts the block size into smaller chunks, and repeats until it finishes, or until stopped.

In my scenario, which might be a rare one. When it hit the bad block, and skipped it, the disk would be rendered unresponsive. I had to stop the command, unplug power and reinsert the power again, restart the command to continue. I had to do that a lot, and by every pass it would want smaller block sizes, making the dumping even slower. This mostly happend because I left it working over night, now I keep an eye on it and stop it when I no longer can keep it under surveilance.


How to use

Part of the man pages

     recoverdisk [-b bigsize] [-r readlist] [-s interval] [-w writelist]
                 source [destination]

     The recoverdisk utility reads data from the source file until all blocks
     could be successfully read.  If destination was specified all data is
     being written to that file.  It starts reading in multiples of the sector
     size.  Whenever a block fails, it is put to the end of the working queue
     and will be read again, possibly with a smaller read size.

     By default it uses block sizes of roughly 1 MB, 32kB, and the native sec-
     tor size (usually 512 bytes).  These figures are adjusted slightly, for
     devices whose sectorsize is not a power of 2, e.g., audio CDs with a sec-
     tor size of 2352 bytes.

     The options are as follows:

     -b bigsize
             The size of reads attempted first.  The middle pass is roughly
             the logarithmic average of the bigsize and the sectorsize.

     -r readlist
             Read the list of blocks and block sizes to read from the speci-
             fied file.

     -s interval
             How often we should update the writelist file while things go OK.
             The default is 60 and the unit is "progress messages" so if
             things go well, this is the same as once per minute.

     -w writelist
             Write the list of remaining blocks to read to the specified file
             if recoverdisk is aborted via SIGINT.

     The -r and -w options can be specified together.  Especially, they can
     point to the same file, which will be updated on abort.

In it’s most simple form it’s like dd, read disk device and write to an image file mounted to the system (usually my system drives aren’t as big as my data drives).

recoverdisk /dev/da0 /my/mounted/disk/image.dd

This command is like using dd.

For the inital run you should write to a log file

recoverdisk -w /home/tomse/recoverlist /dev/da0 /my/mounted/disk/image.dd

This will write the log list into the specified dir. And for large drives that can take a long time to recover, my suggestion is to break out of it right away, this way we can set it to read the log file when it passes it’s first pass.

recoverdisk -r /home/tomse/recoverlist -w /home/tomse/recoverlist /dev/da0 /my/mounted/disk/image.dd

-r = read, -w = write. quite logical and very easy to use.

this is is.. let the drive finish until it reaches 100% you can break it at any time, and run the command again (with the -r/-w parameters) to resume it’s work.

When using the USB adapter in the first run I got a message they I should change the blocksize to 131072 using the -b parameter, fortunately for me I haven’t been needing to do so yet on the current setup.

recoverdisk -b 131072 -r /home/tomse/recoverlist -w /home/tomse/recoverlist /dev/da0 /my/mounted/disk/image.dd

By default, the block size is 1MB

So a big thank you to Poul-Henning Kamp for implementing this into FreeBSD, to  Ulrich Sporlein for doing some fixes and most importantly writing the man pages.

And to my associates at our weekly retro gathering.

Use a C= 1530 datasette as tape audio player

How to listen to audio using your Commodore C1530 datasette, and why.

Please read through the whole post, as there are some things in the end, you might want to start with.

If you’ve ever had the doubt whether there was audio or data on a casette tape, and you’ve only had your Commodore computer and a datasette, and of course a computer to work with. This might come in handy for you.

First of all, you’ll need some kind of connector for the equipment you want to use. I’m using a standard 3,5mm minijack connector. Stereo/mono doesn’t matter as there’s only one channel. If you have a stereo connector, make sure you use the left channel then. You can use the cable from a cheap set of earpieces, one item less to solder.

This is not a stand alone solution, you need to supply power to the datasette, this can come from the Commodore computer, or a stable power supply.

Beware, you might have a different version than this. This one I have here use a Goldstar Lm324, it’s a quad-amp chip. The schematic isn’t precisely the same as the model, but it’s close enough.

Basically you just attach the cable to the output of one of the amps. On the shcematic below I’ve marked Pin 1 and “Pin 7” well actually it’s the output going to the Commodore computer, but I call it pin 7 here. I’ve taken Pin 1 instead of Pin 7 as the voltage level is alittle less there. On the output of Pin 7 you get around 3v peak-to-peak, and you get around 2v peak to peak on pin 1. the normal input of a soundcard is around 1v peak to peak. So just make sure that the input volume is way down.


Here is an older picture where Ground and Signal line (pin7) is marked. I did a little testing here, and it’s way too much output. But it’s doable if you don’t want to solder on pin 1.

As you can see I’m using a stereo cable/minijack connector, but I’m only using left channel. Here it’s still Pin 7.


Sorry for the image quality. I’ve added a small extension cord to the left channel of the audio cable. It’s the green one you can see in the middle of the pcb, soldered to Pin 1 of the goldstar lm324 amp chip.


Before you start soldering, you should take the audio cable and stick through the rubber ring.

This is a real easy hack to do, you only need to know how to solder, and have access to a solder of course.

I haven’t tried transfering data from tape to PC into a tap file using this method, but it might be doable. If anyone tries this, I’d love to hear about it.


Disclaimer: if this doesn’t work for you, or if you destroy your hardware, don’t blame me.


GPS Photo Tracking

Today I reVentus G730 GPS Loggerceived my Ventus G730 GPS Route logger.

It’s an older thing, but I bought it used at a fair price.

It came with everything original, and it didn’t seem like it’s been used more than for 5 min. On Windows 7 I had to get the latest software, get the driver from a 3rd party location than the vendor site. And I ended up with having loads of issues with google map API etc.

Moving on to a more fun and up-to-date operating system; Linux., and in my case Kubuntu.

The dongle is seen with no problems in Linux, I only had to install the skytraq-datalogger and digiKam. digiKam is in the debian repository, and is a very powerful picture application. The deb package from this site makes it easy to install on a debian distribution, like ubuntu and it’s alternatives.

Anyway I had some problems, atleast I thought I had problems, getting the skytraq-datalogger to communicate with the GPS tracker. It turned out that it complains there is no GPS tracker when the storage is empty. I hung the GPS in the handle of our window  and opened it a tad, after a couple of minutes, and a few pictures taken I had data to play with.

Something to remember, set the time properly on the camera before starting. digiKam uses the timestamp of the camera and the timestamp of the GPS data to sync up.

skytraq-datalogger --dump > tracks.gpx

was all I needed to type, in a shell, to dump my data. digiKam v2.5.0 can import this format without any conversions.

Import the pictures from the camera to the local harddrive. Don’t forget that adding GPS data to an image’s EXIF data also modifies the picture, so make sure you have a backup.

In digiKam you can now select all the pictures you’ve taken while the GPS tracker was recording locations. Image -> GEO-Locations. Open the Geo Correlator pane, import the GPX file using the Load GPX button, make any changes if you need, i.e. camera time is the same as system time. Correlate, and apply.

Congratulations, you have now added geo locations to the selected photos. The can be added to several applications to show on the map where the picture was taken.

And a nice preview of digiKam’s suggestion to the location.

Picture is from the Imperial War museum in London, which is worth a visit.


Another good example is the Church near St. Mary Magdalene Primary School and Little Venice (London Westminster)

CF Rescue disk for A600/A1200

I’ve uploaded a new version of the Amiga CFRescue Disk.

I’ve packed the executable files so there would be space for DMS, there was only 8kb free space before.
After compressing several files, and adding dms, there’s 156kb free space now.

get it here : http://www.retro-commodore.eu/files/misc/amiga/CFRescue_v1.11.zip

If you don’t know what this disk does, I’ll give you a short description.

The disk consists of software found on Aminet. TsGUI, HDInstTool, lha, dms, CF library and Fat95. But also the server part of Amiga Explorer lies on this disk.

All this has been gathered on a single disk, so you have the oppertunity to backup your A600/A1200 harddrive to a Fat formatted CF (Compact Flash) card using the PCMCIA port, or transfer your ADF files to diskettes or however you want to transfer.

What is it used for, and what are the thoughts behind doing it?

The disk is a small compilation of free software, to quickly get you up running from a virgin (or crashed) harddrive. It  was made as a tool where you can transfer ADF files to disks, and with the support of the PCMCIA port it opens up for an easy way of transfering data between the Amiga 600/1200, creating i.e. Workbench diskettes so you can create a system from scratch even if you lack the physical disks. You can look at archive.org to find the adf files you need. Using TSGui you can also dump your existing harddrive partition to an other harddrive partition. But that can take a long time to do. You can of course also use the diskette in any other Amiga.

Recommended extras for the A600/1200 : PCMCIA to CF adapter, and a Fat formatted CF card.

Recommended extras for all other Amigas : Serial or Parallel cable, PC with serial or parallel interface, trial or bought version of the Amiga Explorer.

There is a usermanual on the disk that can help you out with the details.

Updated: 2014-12-20

Keeping your FreeBSD install up-to-date

Until very recently, I thought FreeBSD lacked the ability to upgrade binary packages, the same way as the debian repository. I was wrong of course, a friend of mine told me to use pkg_upgrade that comes with bsdadminscripts.

I’ll show you how to upgrade not only packages but also the system, and keeping it up to date.
The tools I’ll use are already installed, else I’ll go through the installation.


If you aren’t familiar with ports, I’d suggest you do so. Though I’ll make a very short description of it here.
Ports contains information of where source code can be found, dependencies and BSD patches if needed.
to install a port simply go to it’s directory and enter
# make install clean

i.e. we’ll need bsdadminscripts later
# cd /usr/ports/sysutils/bsdadminscripts && make install clean

To keep ports up to date there are a couple of methods, like cvsup, manual download and portsnap, there probably are a few more, but we’ll be focusing on portsnap.

If you make a fresh install, I can recommend not to install ports, but wait till later, I’ll tell you why in a few.

If you don’t have ports installed, and you need a fresh ports tree:
# portsnap fetch extract
This will download the latest database and extract it to it’s default location; /usr/ports

using portsnap

To update your already installed ports, you can run
# portsnap fetch update

this will download the diff from your existing ports tree and the newest, and merge them in your local ports tree.
Now, if you haven’t done so in a long time, or if you are updating your tree that was installed from the CD/DVD it can take a very long time, the download itself doesn’t take that long, depending on your connection of course, the most recent ports tree in copressed format is around 60-65mb in size. What takes a long time is the extraction of alot of small files. So as I said ealier, it’s better not to install ports from the installation media and just start with a fresh download after installation.

Compiled from ports

If you have an application compiled from ports and want to update it, make sure your ports tree is up to date before continuing.

using portmaster

Install portmaster by doing pkg_add -r portmaster

as an example I’ll upgrade sit which is a nice web based incident tracker, assuming the requirements for this package has been met on a previous install, all you need to do is.
# portmaster www/sit

This will fetch the new version, compile it if required, deinstall the old package and install the new version. Since this is a web app it might require to update the database schema, this is described on the packages homepage.

to recompile all packages installed
# portmaster -a

Will do that for you, it runs through all the packages and prompt you for config settings if required, before compiling the first package, this way you don’t need to accept configs all the time through the upgrade, as you normally would do with portupgrade.


You might know about the package system now, precompiled binary packages, ready to download and install.
# pkg_add -r bash

Using -r will download the package from one of the mirrors available, rather than take the input as a file located on the local harddrive.
Unless you actively do anything, you’ll always download the release packages, after some time these can get old, bugs and security issues found etc, so it’s recommended you upgrade these to the newest release.

Since I’m using C-Shell for my root user, I’ll modify /root/.cshrc, I’ll add the link to where the stable (newest) repository is stored.

So edit your /root/.cshrc with your favorite editor, and add:
setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/Latest/

Preferably with the rest setenv lines.
If you use another major version make sure you change the 8 to the major version you use. also change i386 to amd64 if you are running 64bit, or other supported architectures.

A full list of mirrors can be found here so pick on closest to you : http://www.freebsd.org/doc/handbook/mirrors-ftp.html

If you have problems using the FTP protocol, try using HTTP instead.

Save your .cshrc file, and reload it
# source ~/.cshrc

Installing a package as root now, will get the latest binary.

To uprade using the latest binaries you’ll need bsdadminscripts which can be found in ports in
/usr/ports/sysutils/bsdadminscripts (cd to the dir and type in “make install clean”)
or use pkg_add
pkg_add -r bsdadminscripts

This will give you some nice tools, amongst pkg_upgrade which we are going to use in a few.

Upgrading an application with latest precompiled package we can now use
pkg_upgrade mc

This will upgrade midnight commander, a norton commander clone, to latest binary, using the precompiled packages leaves out custom installs, so make not of that if you’ve previously compiled a package, i.e. apache with mod_dav.

pkg_upgrade -nav
This will give a list of all (-a) packages, not (-n) upgrading it, with verbose (-v) information.
removing the -n will upgrade all packages while giving you a nice verbose output on screen.


Updating your system is pretty easy to do, again FreeBSD delivers some nice tools out of the box to help you.

Using freebsd-update

freebsd-update fetch install
This will update your current version with latest patches.

If you want to upgrade from an old version i.e. 7.4 to 8.2 (which at current time of writing is the latest version).
freebsd-update -r 8.2-RELEASE upgrade

This will upgrade with binaries to the chosen version with latest patches. Though you might need to answer some questions about config files, for example if you edited /etc/hosts and others too. It’s usually not a big problem and you probably know what to do if you have an advanced setup.

When upgrading, it installs the kernel first, later it’ll need world, so it prompts you to reboot after the first step, and asks you to run freebsd-update install after a successful reboot.

Read the man pages for more info, when you run freebsd-update and portsnap without parameters you’ll get a small output of what you can do, if you ever are in doubt.

I suggest you try this first before doing it in a production environment. Don’t blame me if your system crashes or otherwise gives you problems, thats what the manual is for.

Good luck and happy updating.

Credits to Uffe Jakobsen

Adding heatsink to the A4000 voltage regulator

I’ll show you how to add a heatsink to the A4000 voltage regulator without soldering.



A voltage regulator like the 7905 shown in this guide delivers -5v out even if you have an input of -10v. As with almost all things in the physical world excessive energy will be transformed into heat, so will the excessive voltage from -10 to -5 volt, that means the regulator becomes hot. I haven’t checked the input voltage on the Amiga 4000 but looking at the print beneath the regulator shows it gets really hot.

On some pieces of electronics you can see the PCB will be used as a heatsink around the regulator, this is done by attaching the regulator to the PCB with a screw. This is ok when it doesn’t become too hot and the engineers have done a good job designing it.

You can also attach a heatsink to the regulator, which is what I’ll show in a few.


Getting ready

Tools needed:

  • Thermal compound (optional but recommended)
  • Screw and a bolt
  • A screwdriver that fits the screw
  • A pair of tweezers or similar (optional), or a hexagonal top that’ll fit the nut

I couldn’t get a flat bolt, but the triangular headed screw can do the job. I cut the screw to a shorter size with a dremel.

I bought a few heatsinks on the internet, the silver ones were priced around €0.50 each

The dimensions of the medium sized one is 13.3 * 19.1 * 12.7mm

The black one is way too large, the small and medium ones are good choices. I could use the smallest one as the A4000 didn’t come with any at all, but I might as well use the medium one.


The mentioned voltage regulator

Ready to work

Add some compound on the heatsink, not much is required. The cut down screw with nut

I gently lifted the regulator to an upright position so it was easier to attach the screw with the screwdriver. The screw is preferably inserted from the bottom, it was a little troublesome to attach the nut when you don’t have a hexagonal top, but I managed.

The screw doesn’t need to be tightened with force, just enough when you feel a resistance and the heatsink is firmly attached.


The finished result from 2 angles

The regulator cannot be bent down vertically again, if you want this, you need to do some soldering.


Fixing Soldering Pads

Yesterday I started on repairing the motherboard of an old Amiga 1200. For the first test it seemed to work fine. Then I started looking closer at the board.

The initial inspection, everything seems to look fine, a little rust on the tv tuner shielding, a lot of dust

Amiga 1200 motherboard

Looking closer on the blue resistors, those small blue ones in the middle of the picture, the solderings are matte, they should be shiny. This is typical for old computers where the smd capacitors have leaked acid.

Hold on. There seems to be a capacitor missing, just to the left of the white connectors. The solder pads are gone too. This capacitor is used for one of the audio out, if this is missing, no sound will be heard from on of the stereo channels. I checked the other channel, which was missing too, but solderpads were intact.

Amiga 1200 - Corrosion and missing capacitor

Working with lemon juice on a cotton stick to neutralize the acid from the capacitor, I gave it a good cleaning around the area. After that, a trip to the dishwasher. And letting it dry for ½ day. I probably won’t power it on for another week or so, so all the water should be evaporated for that time.

The following pictures were taken from a USB microscope bought for $1 on ebay, quality is not perfect, sorry about that.

I scraped off the protective layer of the rest of the wires, and tinned them afterwards. Time to look for something that can be used as solder pads, as I didn’t dare solder the new capacitor onto the wires directly, they are just too fragile.

Zoom-in on missing solderpads

I found an old PCI board this is a promise SATA150 controller.

Solderpad spares

Using a simple knife, this one isn’t particularly sharp, I managed to remove a couple of connector legs.

Removing pci connector

Doing a quick measure to see if they are allright, looks like it

Solder pads are ready

I used some loc-tite glue to glue the pads to the pcb. I found out later I should probably have used another kind of glue as this one got liquid again when warmed.

Glued solderpads

After a little work I managed to tin the connectors, and get a connection to the wires. It’s not the best solution, but it’s better than the alternative. I also tinned the copper surface to prevent it from oxidizing.

Solder pads, glued and tinned

Soldering the cap onto the newly made solderpads were less of a hazzle, glue seems to be effective again

Fixed the capacitor

Almost finished board, this now has it’s SMD capacitors replaced, a trip to the dishwasher and cleaned some acid infected solderings. Only the 4 non SMD electrolytes are missing from replacement. Only the electrolytes were replaced.

Amiga 1200 refurbished

There are plenty of guides out there how to replace SMD capacitors, I find them the easiest to replace from regular old fashion caps.It’s basically

  1. Spin the house around till it falls off.
  2. Use the solder iron to remove the broken pin from the solderpads.
  3. Clean the solderpads with a desoldering wire.
  4. Apply alittle solder paste to each pad
  5. Attach the cap (remember in the right direction), eventually adjust it so it looks nice too.
  6. Heat the solder paste with your solder iron until it gatheres around the pad and cap leg. Instead of solder paste you can also use a thin solderwire. I use that when it’s easy to access the pads. I use a 0.25mm wire for that. 0.6mm should be good too.

Updated 28/6-11
New status – I’ve tested the amiga board, and everything runs perfectly (floppy, sound, video, harddrive), except for the right mouse button. Activating the right mouse button gives a click in the sound, and it’s not functioning, I’m affraid that I’ll have to replace paula.