Copy One Micro SD Card to Another?

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
misterrocks
Posts: 88
Joined: Tue Jan 11, 2022 1:43 am
Has thanked: 43 times
Been thanked: 2 times

Copy One Micro SD Card to Another?

Unread post 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?

User avatar
Armakuni
Posts: 189
Joined: Fri Jan 13, 2023 10:37 am
Has thanked: 35 times
Been thanked: 27 times

Re: Copy One Micro SD Card to Another?

Unread post 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

User avatar
lagerfeldt
Posts: 158
Joined: Mon Jan 03, 2022 8:32 pm
Location: Denmark
Has thanked: 31 times
Been thanked: 79 times
Contact:

Re: Copy One Micro SD Card to Another?

Unread post 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 ;-)

Patron of MiSTer + theypsilon + Jotego Team + Coin-Op Collection + Pierco + Nullobject

MiSTer RePlay website

Ultimate SID Collection website

misterrocks
Posts: 88
Joined: Tue Jan 11, 2022 1:43 am
Has thanked: 43 times
Been thanked: 2 times

Re: Copy One Micro SD Card to Another?

Unread post 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
User avatar
lagerfeldt
Posts: 158
Joined: Mon Jan 03, 2022 8:32 pm
Location: Denmark
Has thanked: 31 times
Been thanked: 79 times
Contact:

Re: Copy One Micro SD Card to Another?

Unread post 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.

Patron of MiSTer + theypsilon + Jotego Team + Coin-Op Collection + Pierco + Nullobject

MiSTer RePlay website

Ultimate SID Collection website

Post Reply