Wednesday, December 28, 2022

Amiga 1000 Parceiro making images of your SDCard & compatibility

 G'day everyone, this blog is my journey and experience with purchasing and restoring my favourite computer of all time, the Amiga 1000, and hopefully will help other people in their journey too.  My experience would see parts delivered from 9 different countries across the globe, and has been 4 months in the making.

Disclaimer: There is no sponsorship or payment in kind, and all comments are my own experience / opinions unless stated otherwise.  I am a private individual member of the public, I am not a business, nor am I representing any business.  This blog is not to be taken or used as advice or instruction, replicate at your own risk.  I have destroyed 1 x accelerators, 1 x GOTEK drive, and possibly 1 x Amiga 1000 (at time of writing) in my adventure so far 😅



Making backups with 'dd' on Mac OSX:

The Parceiro works really well with most SD Cards, but I have found the Sandisk Extreme and Extreme Pro have problems.  My advice is don't get fancy, and price is not a good indicator of compatibility (or performance).  My Parceiro came with a Gigastone 32GB card which I immediately made a backup of, and in my daily use now I am using a 32GB Sandisk Ultra Sd Card.

To make a backup on Mac with OSX I use the built-in terminal command dd.  If terminal scares you, try BalenaEtcher, it's free and easy to use from the GUI (Balenaetcher is on Mac and PC).

To use dd:

Connect the Sd Card to your Mac, and open a terminal window.

type 'diskutil list'

and look for the SD card you just inserted.  You are looking for the same size, maybe the manufacturer name, and a volume name as the card you just inserted.  The volume you will see for the Parceiro is the Windows FAT32 volume named 'XFER'.  


This is the volume you can use to swap files easily between you Mac/PC and the Amiga.

The important bit you are looking for, is what disk number this is.  Avoid assuming it is always the same disk number, it won't always be!  In my example, it is disk4.  Ignore the disk4s1, we only need the disk4 identifier.

To take an image, we need to first unmount the disk, using the diskutil command again:

diskutil unmountdisk /dev/disk4

You will get a message "Unmount of all volumes on disk4 was successful" and be returned to the terminal prompt again.

The next command must be run as administrator or it won't work, so we use sudo with dd:

sudo dd if=/dev/disk4 of=parceiro.img bs=512 status=progress

Breaking this down:

sudo - means run the next command with admin privileges

dd - is the linux command to take and restore images.  It can also do a lot more, but we only need an image.

if=/dev/disk4 - if stands for "input file" and we point this at the disk we identified with the diskutil command earlier.  your disk may not be disk4 remember, that's just the disk in my example.

of=parceiro.img - of stands for "output file", you can call this whatever you want, in my example I am calling this 'Parceiro.img'.

bs=512 - sets the block size to 512 bytes, which is how the parceiro has been set up.  This is the default for dd, but I like to specify it, just in case the default changes in the future.  You could omit this if you like.

status=progress - shows the read/write progress as the dd command runs.  Without this, the terminal window appears to be doing nothing, I like to see it is still working.

Note: Depending on the SD Card and reader you are using, this process could take from a few minutes, to a few hours!!  Writes are a lot slower than reads.

Once completed, you have an image/backup of all the Amiga and the FAT partition that you can go back to.  I have lost count of how many times I've re-flashed my SD Cards while playing around with installs.

To write an image back to the SDCard, the first part of the instructions are the same:

Connect the SD Card to your Mac, and open a terminal window.

type 'diskutil list'

and look for the SD card you just inserted.  You are looking for the same size, maybe the manufacturer name, and a volume on the card.  The volume you will see for the Parceiro is the Windows FAT32 volume named 'XFER'.  


This is the volume you can use to swap files easily between you Mac/PC and the Amiga.

The important bit you are looking for, is what disk number this is.  Avoid assuming it is always the same disk number, it won't always be!  In my example, it is disk4.  Ignore the disk4s1, we only need the disk4 identifier.

To take an image, we need to first unmount the disk, using the diskutil command again:

diskutil unmountdisk /dev/disk4

You will get a message "Unmount of all volumes on disk4 was successful" and be returned to the terminal prompt again.

now type:

sudo dd if=parceiro.img of=/dev/disk4 bs=512 status=progress

We just swap the IF and OF options!

Note in both examples, the Parceiro.img file will be created in whatever directory you are currently in.  You may want to change to your downloads folder before running these commands, to make the image file easy to find:

cd /downloads

will take you to your Downloads folder in Mac OSX.

final note: all commands are case-sensitive, just like on most *nix systems.  'downloads' is different to 'Downloads'.

Because the Parceiro image is actually just 16GB, you can write the image back to a 16GB SD-Card, rather than a 32GB SD-Card.  the 'dd' command will stop when it runs out of blocks to write too, but your image will be perfectly in tact.  Or if you wanton write just the data portion to an image, take David's advice (this is for the SD Card as supplied, if you have modified your card, this may not work):

 "...the actual image of the SD is 15,978,201,088 bytes in size, or 31,207,424 512-byte blocks in size.  So if you ever want to just save the non-empty parts of the drive, just do:

dd if=<the device reading from> of=<the file writing to> count=31207424 status=progress" 

- David Dunklee 2022

Why would you do this?  Well, depending what you read online, it might be good to only write the data you need, and then, the firmware controller on the card knows it can use all the unwritten space for moving bad blocks if it finds them.  You can write a 16GB image to a 32GB or even larger card, and leave all the unformatted space to the firmware controller and/or for your own use later.

At least on SSD disks that is how it works.  Note the firmware controller knows nothing about the Operating system or what partitions have or have not been created, nor what is empty space or not - it only knows where it has written data to a block, and and where it has not yet written data to a given block. 

If the firmware controller has written data, even NULL or 0's to a block, then the firmware controller considers it used.  This is also why you only ever want to use a Quick Format on a CF or SD-Card, never a low-level or full format!!

How to refresh the firmware controller is something I have not looked into, maybe SD Card Formatter from the SD Association does this for us?  It is free too!  You can also use this tool on CF Cards.


Tips on creating a new partition scheme:

Image courtesy of https://www.amigalove.com/viewtopic.php?t=1823

I like this image as it describes easily what we are trying to do - get an MBR and an RDB bootstrap on the same drive, and then create both Amiga and FAT partitions.  The FAT partition can be read and written on a Mac or PC, but the Amiga partitions will be invisible to the Mac/PC.  Your Amiga will be able to read and write to both eh Amiga RDB and the PC/Mac FAT partition.  It is the best combination.

As Mr Dunklee has pointed out, the Amiga was way ahead of its time in allowing the RDB bootstrap to sit anywhere on the drive, rather than fixed at block 0 like MBR.  Just another Amiga innovation.

You must use SDToolBox that came with your Parceiro, do NOT use HDToolBox or HDInstall, if for no other reason then, these cannot create a dual MBR and RDB boot record on the same disk - it's one or the other!!

And remember, once you save the changes to SD, you will most likely lose all data on the drive!

So why do it?  If you want to setup a new card from scratch and don't want to use an image (see 'dd' above).  You may want to create the partitions and ensure you have tick in create MBR to make your own disk.

SDToolBox has a very handy feature that allows you to save a partition structure to a file.  You can then take this file, and using 'dd' (see above), write it as an image to a new card/disk.  Pop the new card/disk into an Amiga, format it and you have a new drive ready, with both RDB and MBR bootstraps! 

SDToolbox has another special feature where you can set a partition to only be visible when the right OS has booted (i.e. only show when using OS1.3, or only show when OS3.1 has booted etc).  Way more powerful than HDToolbox!

"So the top mount and boot checkmarks are the typical guides to tell the Amiga if you want the volume Mounted and/or bootable.

I added below that an additional mount and boot checkmark.  These checkmarks override the above checkmarks if the OS version matches.

In this way you can make the volume visible under certain conditions.

View SD0, SD1, and SD2 and you'll see that SD0 will only mount and be visible and bootable in 1.3, likewise SD1 is only viewable/bootable in 2.1.  See?" - David Dunklee 2022

At the end of the day, it is much easier to take an image of the SD Card supplied with your Parceiro, and edit that.  David has already done so much of the heavy lifting - why torture yourself?

SD-Card Compatibility:

Better start with a definition of MB and Mb etc:

MB = MegaBytes
Mb = Megabits
1 Byte = 8 bits
1 Megabit = 0.125MB/sec when transferring data.  

All the SD Cards and CF Cards I have state their speed in MB.  However, real life performance is always a lot less (typically, I have seen about 6MB/Sec writes, and up to 35MB/sec reads).

Similar advice also applies for CF-Cards - I could not get a Sandisk Extreme or Extreme Pro CF Card to work with two accelerators I would soon test.

I dived into SD cards today and found that the Sandisk Extreme Pro I bought is an A2, V30, UHS-3  card.  

A(x) meaning it performs random read/writes better, A2 meaning capable of 4,000 IOPS, vs A1 which is 1500 IOPS (designed for GPS maps etc), 

V30 meaning it can sustain 30MB/s writes, and UHS referring to bus speed (10MB/s or 30MB/s).  

But..the A2 and A1 denotes 10MB/s sustained writes for application performance.  Noting any speed class promises are based on sequential writes only.

That’s all very nice, so the Gigastone (supplied with the Parceiro) is a class 10, UHS-1 card, class 10 is an earlier logo of the V standard (they have changed the naming 3 times already, garrr!), it denotes sustained writes of 10MB/s.  There is no UHS 2 by the way, just UHS 1 or UHS 3.

All that though is dependent on the Host, and apparently a combination of U’s and V’s etc does not guarantee 10MB/s, only that it will read and write at some speed :). Despite all that, in theory I should be getting whopping speeds when I read or write images (using dd on my Mac) to the Sandisk Extreme/Extreme Pro - not so, I get a max of about 6MB/s, whereas the Gigastone was reading and writing at 15MB/s on the same Mac hardware!?!

So…to conclude, theoretically faster, more expensive SD Cards may in fact pose an issue (like what I have seen), not only with the Parceiro, but anything that takes an SD card under the right circumstances.  

A good SD Card should last about 10 years (really cheap cards might die after 2 years), from what I’m reading, and if writing/changing data often, one site recommended formatting every 2 or 3 weeks!  

Anyway, I have my backups, and once personalised, I’ll be doing very few writes anyway.  Backups ready for 2032 :)

Some more wisdom from David Dunklee:

"There is a program called SDWORKOUT, (and a more extensive SDWORKOUT2) that you can run from the command line.  It basically does a workout of the target file system and SD card.

When you run these programs you'll find that the limiting factor of the system is WRITE performance.  So you'll generally want to get the 'fastest' SD card which can write the FASTEST.

However, know that the Parceiro is a very simple device.  It doesn't use the proprietary SDIO 4-bit interface and doesn't know anything about the new-fangled features that allow advanced READs or WRITEs.  It uses what's called the basic, Serial Peripheral Interface or SPI.  You can think of SPI as the original PCIE version 0.  It's very basic, but essentially allows you to talk to devices on a very fast (for '90's technology) interface.
...

I, too, thought that the EXTREME, 4GB Video cards would be the best, but I'm finding that the only way to use them in this capacity is with the SDIO interface.  SPI is deprecated on these devices.

...

I have a SanDisk A2 that I bought on a recent vacation. The Amiga doesn't want to boot off this one.  I do have a Samsung A2/v30 that works fine (so far)"

SDWorkout appears to also work for CF-Cards, by-the-way.  I'm using it to check through various branded/unbranded cards of 16GB and 32GB.

If you are interested in more information on SD Cards, I found a PDF I really like on the Farnell site here.

Cleaning up MacOSX droppings:

% sudo dot_clean /volumes/GOTEK

Password:


Failed trying to change dir to .Spotlight-V100

Bad Pathname: Operation not permitted

Failed trying to change dir to .Trashes

Bad Pathname: Operation not permitted

Failed trying to change dir to .TemporaryItems

Bad Pathname: Operation not permitted



Or I recently came across CleanEject - which does the job for you, worth checking out.


No comments:

Post a Comment

Recapping a PAL Amiga 1000

 Hi Again, Since I suspected I had issues with reliable and stable power, I took the plunge to recap my PAL Amiga 1000 (no piggyback), and p...