Swap SD <> eMMC Installs?
#1
Is there a practical method to exchange the default Debian install on the eMMC with the Manjaro Plasma install I'm currently running from the SD card? I have invested a non-trivial amount of time and effort into installing the packages I need and customizing the environment of both -- I'd really like to not have to re-do all of that.

Could it be as simple as:

1. use Gparted to shrink the partitions of each to just larger than the actual space being used

2. use dd to copy the offline partitions to image files on a fresh install of Debian on a large SD

3. use dd to copy the Manjaro image to /dev/mmcblk2 (after verifying that's the right device)

4. boot into the newly-restored Manjaro and use dd to copy the Debian image to a SD card

5. use Gparted to resize the partitions of both filesystems to use all the space available on the drives?

I have not been able to boot to a USB flash drive, which would allow to manipulate both the eMMC and SD filesystems offline in the same session.
#2
Your best/easiest/fastest method would utilize the emmc reader if you have one. Use if to make a backup of the emmc on another computer, then write the contents of your SD to the eMMC and finally write Debian to the SD.

If you don't have the adapter, you can do it using a ext or thumb drive, a USB SD adapter/reader, and another SD running a Linux. Using the second Linux SD, make backups of the emmc and SD onto the ext/thumb drive. Then write each image to its new media. You shouldn't (and may not be able to) do this from within one of your installs.
#3
No eMMC reader here, just a USB card-reader that I can use to access another SD card while I'm booted from the built-in SD card.

I just realized that I don't understand the process of using dd to create an image file and write a bootable filesystem back to the drive. Can I copy from the first sector on the drive to the end (do I need to provide an offset or skip copying any portions of either drive, either during the backup or the restore)? Are there blocksize or other parameters to dd that are necessary (other than the obvious if= and of=)?
#4
No, dd the whole drive(s). Any offsets will carry over during the dd. Backup and restore the drives in their entirety to help maintain proper booting.
#5
I still don't understand the boot process, and made the mistake of trying to copy just the Debian partition rather than the entire drive. That didn't work.

Here's what worked:
  1. Prepare an empty SD card (formatted as ext4, labelled "XFER") to hold the backup copies. (I had a USB card reader that mounted as /dev/sda1)

  2. Use Gparted to shrink the partitions of each OS to just larger than the actual space being used

  3. Use dd to copy the offline partitions to image files on the fresh SD card (named XFER)
    Code:
    sudo dd if=/dev/mmcblk2 of=/run/media/jdcard/XFER/pbpDebian.img
    sudo dd if=/dev/mmcblk1 of=/run/media/jdcard/XFER/pbpManjaro.img


  4. Use dd to copy the Manjaro image to /dev/mmcblk2 (after verifying that's the right device)
    Code:
    sudo dd if=/run/media/jdcard/XFER/pbpManjaro.img of=/dev/mmcblk2 status=progress


  5. Boot into the newly-restored Manjaro and use dd to copy the Debian image to another SD card
    Code:
    sudo dd if=/run/media/jdcard/XFER/Debian.img of=/dev/mmcblk1 status=progress


  6. Use Gparted to resize the partitions of both filesystems to use all the space available on the drives

Thanks for the help.


Possibly Related Threads…
Thread Author Replies Views Last Post
  U-Boot with direct NVMe boot support for eMMC/SPI Flash pcm720 120 110,188 09-11-2021, 02:16 PM
Last Post: calinb
  Pinebook Pro not powering on when eMMC hardware switch is off vgrimaldi 2 432 06-29-2021, 05:19 AM
Last Post: KC9UDX
  UK Pinebook Pro for sale (UK buyers only, 64GB, eMMC reader, NVME add-on) Z0rua 0 461 06-01-2021, 12:51 PM
Last Post: Z0rua
  I am ready to accept that there may be a problem with my emmc. djhnsn 4 1,031 05-18-2021, 12:25 AM
Last Post: djhnsn
  Wiped EMMC, forgot do write new image, won't recognize EMMC zeno 4 937 05-11-2021, 01:53 PM
Last Post: wdt
  Need Advice for Wiping eMMC on Dead LCD Pinebook Pro calinb 9 1,689 05-10-2021, 12:49 PM
Last Post: calinb
  eMMC not gets detected by initramfs? overlisted 6 2,244 05-09-2021, 09:08 PM
Last Post: djhnsn
  Happy eMMC and SDcard OS usage for Pinebook Pro Newbies... Paulie420 40 23,738 02-27-2021, 11:01 AM
Last Post: wdt
  Pinebook Pro 128GB EMMC for sale **sold** dgkPBP 7 2,309 01-15-2021, 08:48 AM
Last Post: dgkPBP
  Booting to sdcard stopped working after emmc flash techiedog 3 1,434 12-31-2020, 06:30 PM
Last Post: Anarethos

Forum Jump:


Users browsing this thread: 1 Guest(s)