Page 1 of 1

Copy One Micro SD Card to Another?

Posted: Fri Mar 01, 2024 5:30 pm
by misterrocks

Would it work to use dd to copy one card to a second card for a second MiSTer? If so does anyone know the right dd command for that?


Re: Copy One Micro SD Card to Another?

Posted: Fri Mar 01, 2024 5:42 pm
by Armakuni

There is a Migrate SD script that will clone the card directly on MiSTer and expand to a larger size at the same time. Its not the fastest due to the DE10 IO but works very well
https://github.com/Natrox/MiSTer_Utils_ ... in/scripts


Re: Copy One Micro SD Card to Another?

Posted: Fri Mar 01, 2024 6:52 pm
by lagerfeldt

Use Natrox's Migrate script - works like a charm.

Otherwise I use (g)dd on my Mac. gdd is the Homebrew version.

Switch to root:

Code: Select all

$ sudo su


Show mounted disks:

Code: Select all

$ diskutil list

Insert source SD and

Code: Select all

$ diskutil list

Note

Code: Select all

/dev/disk#

for the source SD, e.g.

Code: Select all

/dev/disk4

Insert target SD and

Code: Select all

$ diskutil list

Note

Code: Select all

/dev/disk#

for the target SD, e.g.

Code: Select all

/dev/disk5

Unmount both SDs:

Code: Select all

$ diskutil unmountDisk /dev/disk#

e.g.

Code: Select all

diskutil unmountDisk /dev/disk4

and

Code: Select all

diskutil unmountDisk /dev/disk5

Check with the mount command that both SDs are unmounted

Begin flashing the image:

Code: Select all

$ gdd if=/dev/rdisk4 of=/dev/rdisk5 status=progress bs=16M

if = input file (source SD)
of = output file (target SD)
bs = block size, 16MB (optimized for Mac + SanDisk Extreme in my test)

PS. Make sure you're writing to the right disk - dd is called Disk Destroyer for a reason ;-)


Re: Copy One Micro SD Card to Another?

Posted: Thu Mar 07, 2024 12:14 pm
by misterrocks

This worked great but took 8 hours for 512GB:

Code: Select all

dd if=/dev/rdisk4 of=/dev/rdisk5 status=progress bs=16M

Re: Copy One Micro SD Card to Another?

Posted: Thu Mar 07, 2024 2:59 pm
by lagerfeldt

Yup, it can take forever depending on the speed of your interface. It literally copies bit for bit, so it doesn't care about actual usage.

8 hours or so is what it takes me using this method as well.