Copying Amiga 3.5" media using 'dd'

The 'dd' command has been around since the 1970's and is part of the GNU Linux 'fileutils' package. In time you may see that 'dd' is your friend.

So you need to make a copy of a diskette? Or do you need to make backups of your old Amiga games? Use the 'dd' command. The 'dd' command has been around since the 1970's and is part of the GNU Linux 'fileutils' package. Jokingly, folks may refer to it as 'Disk Destroyer', 'Data Delete' or 'Disk to Disk'. Although it can ruin data if used carelessly, in time you may see that 'dd' is your friend.

A typical 3.5" floppy has 18 sectors per track, two heads and 8 cylinders. A good way to copy one is like this:

        # dd bs=2x80x18b if=/dev/fd0 of=/tmp/floppy_disk.image

The 18b specifies 18 sectors of 512 bytes, the 2x multiplies the sector size by the number of heads, and the 80x is for the cylinders -- for a total of 147560 bytes. This make an efficient transfer because the command will make a single 147560 byte read request and a single 147560 byte write request.

Now to copy the image to another disk, enter the following:

        # dd bs=2x80x18b < /tmp/floppy_disk.image > /dev/fd0 

That's it! Now to copy an Amiga disk - first, a little history...The Amiga used 3 famous chips nicknamed, Paula, Denise and Agnus. One of Paula's responsibilities was to act as the floppy disk controller. Paula is different from a PC's floppy disk controller because of the decoding mechansims which are used in each system. The PC's decoding is done in the drive hardware on chip, while the Amiga's was done by the CPU. This allowed custom coding techniques back in the day for the concoction of all sorts of diskette copy prevention alogorithims. This is the main reason why you can't read an Amiga floppy directly on the PC...Today you can create an image using Linux and the trusty 'dd' program for use in an emulator. You will just need to know the structure of the Amiga floppy and then substitute the values.

Amiga diskettes have 80 cylinders and 2 heads(tracks). Double density(DD) disks have 11 sectors and High density(HD) have 22 sectors. If your'e intersted, you can find a wealth of information on the Amiga disk filesystem(AFD) format at Laurent Clévy's website. Now you should be able to make an image of the disk and also format blank images. Use the following to create blank images for (DD) and (HD) disks:

        # dd if=/dev/zero of=blank.adf count=1760 
	# dd if=/dev/zero of=blank.adf count=3520

Use the following to make an image of a diskette:

	# dd bs=2x80x11b if=/dev/fd0 of=/tmp/amiga.img
	# dd bs=2x80x22b if=/dev/fd0 of=/tmp/amiga.img

'dd' is a very useful command, not only can it be used for cloning 3.5" media, but also to efficiently transfer files across the network, backup complete hard drives and create virtual file systems for Usermode Linux!

Use this to backup an entire copy of your hard drive to another locally connected hard drive using syncronized i/o - where the source hard disk is /dev/sda, and device name of the target hard disk is /dev/sdb. ( Warning: Take care, or you may destroy all your data!)

	# dd if=/dev/sda of=/dev/sdb conv=noerror,sync

Need to create an image of a iso cdrom? Use this.

 	# dd if=/dev/cdrom of=cdrom_image.iso bs=2048

Peace be unto you. Thank you for visiting!