Is the same DD command appropriate for writing EMMC and SD cards
#1
I have written several SD cards and they all work from software on other machines. I have written images from SD card to emmc and had it work. Now I want to back up my emmc to an SD card and be able to boot from it.  Can I have DD read from the emmc device and write to the SD device and get that?
Ancient teacher (Secondary Field Science/Math), Warrior (USARNG- RET SSG), and IT warrior (30+ years Coder, Network/Systems Administrator, general house geek). 
Pinebook Pro user (Debian, Manjaro)
  Reply
#2
(09-19-2021, 06:30 PM)wpeckham Wrote: I have written several SD cards and they all work from software on other machines. I have written images from SD card to emmc and had it work. Now I want to back up my emmc to an SD card and be able to boot from it.  Can I have DD read from the emmc device and write to the SD device and get that?

UPDATE:  I found a spare SD card, dropped it in the clot, and ran
sudo dd if=/dev/mmcblk2 of=/dev/mmcblk1 bs=1M status=progress
where mmcblk2 is my emmc
and mmcblk1 is my sd card

It took a good while, but finished without error.  Rebooting the PBP brought me into the same session, settings, and everything as if I had booted to emmd without the card, except that the root mount point was on mmcblk1 now.

This is perfect.  As easy as that I have a card that is a clone of my usual boot to use as a backup card in case of issues, and from which to rewrite the emmc at need. 
UPDATE: 2021-11-13 I have now had it succeed once, and fail once.  (To the same SD card from the same EMMC!) so the lesson is that it CAN work but you might want another solution available: just in case.
Ancient teacher (Secondary Field Science/Math), Warrior (USARNG- RET SSG), and IT warrior (30+ years Coder, Network/Systems Administrator, general house geek). 
Pinebook Pro user (Debian, Manjaro)
  Reply
#3
dd is blind. The beauty of it is that all it does is copy raw data without interfering with it in any way.

There are some U-Boots, and some operating systems, that will not work like this. That is, they assume the boot device is the one the were installed with.
:wq



[ SRA accepts you ]
  Reply
#4
dd has been nicknamed as DESTROYER OF DISKS. and i have full experience Rolleyes , i have destroyed one harddisk in the past. (good time for remind others, did you do your backups, i did not).

"sudo dd if=/dev/mmcblk2 of=/dev/mmcblk1 bs=1M status=progress"
previous command works if both disks are exactly same size by bytes. bs=1M was good, because default is 512 and it's suboptimal and slow. "fdisk -l" shows some info. also "lsblk" and "blkid". linux does not always guarantee same order for disks, so be very careful.

few things for dd command. users need to know difference between disk, partition and file. one could backup whole disk to as file.

linux booting uses uuid's in most cases, can be shown by "blkid". uuid's are relative, so booting works in other disks or memories. some rare cases absolute paths are used, then booting won't work on other disks or media.
  Reply
#5
You can copy disks of different sizes. But know what you are doing. Copying a smaller disk to a larger one is no problem except that there will be unused space at the end. When copying large to small, only copy the length of the smaller one and know that it will be truncated (likely corrupt).

dd is like a dangerous weapon. It does exactly what you tell it to do, and there is no recourse when you make an error. I'm pretty sure we've all wiped out the root partition at least once. Always, always always read back the command you are about to issue and study it before pressing <RETURN>. This should apply to all Unix commands, but especially dd.
:wq



[ SRA accepts you ]
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  NVMe timeout when booting from eMMC but not SD satwell 5 1,785 10-29-2021, 07:41 AM
Last Post: psstoev
  Blank screen after Armbian 20.04 install to emmc? psychoacoustic 2 349 10-14-2021, 03:11 PM
Last Post: psychoacoustic
  Enabling spekaer/Connecting to bluetooth from command line axisarm 1 467 08-06-2021, 04:29 PM
Last Post: nfms
  Manjaro wont recognize eMMC after booting with it disabled peasant 1 633 06-27-2021, 02:39 AM
Last Post: Arwen
  eMMC frequently not found by Linux kernel (especially on low battery) v-man 14 7,102 05-14-2021, 01:18 PM
Last Post: djhnsn
  PBP won't boot from eMMC or SD card: a saga archaicmeander 18 4,487 02-06-2021, 07:40 PM
Last Post: wdt
  eMMC Trouble After Flashing WRONG Image balin 7 3,084 12-29-2020, 04:24 PM
Last Post: KC9UDX
  installing OS from SD to eMMC methods for flashing SD PineHead7 3 2,087 12-22-2020, 06:52 PM
Last Post: jiyong
  Double your Manjaro eMMC speed xyzzy 1 1,626 11-23-2020, 10:50 PM
Last Post: xyzzy
Bug eMMC Fails After Suspend Lodj 3 1,754 11-16-2020, 11:06 PM
Last Post: ab1jx

Forum Jump:


Users browsing this thread: 1 Guest(s)