moving existing installation from sd card to emmc

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
franklores
Posts: 2
Joined: Fri Aug 14, 2020 1:18 am

moving existing installation from sd card to emmc

Post by franklores »

Hello,

I have an installation setup with raid, plex, samba, webmin etc running on a sd card, I recently purchased a 32GB eMMC for my odroid XU4 and would like to copy the entire card to eMMC and boot from it directly, I've search and found that with dietpi-drive_manager I can move the root filesystem, but I haven't been able to find any information on how to move the boot partition. Any pointers appreciated,

Thanks.
User avatar
MichaIng
Site Admin
Posts: 2323
Joined: Sat Nov 18, 2017 6:21 pm

Re: moving existing installation from sd card to emmc

Post by MichaIng »

The boot partition cannot be copied like the root partition, especially since the bootloader is missing them and the drive references are wrong, hence manual steps are required at least.

Best approach is, when you want to competely boot from eMMC, to clone the whole SDcard (not the contained file data but raw disk) with a tool like dd (Linux, for Windows there will be something similar). Remount the root partition read-only for this, if you want to do it from within DietPi itself, but better to do it from an external system.

Since when doing raw disk cloning the UUIDs of boot and root partitions are preserved, it should boot without any manual adjustments.
franklores
Posts: 2
Joined: Fri Aug 14, 2020 1:18 am

Re: moving existing installation from sd card to emmc

Post by franklores »

I thought of this unfortunately the eMMC card is 32GB whilst the SD card is 64GB. I think I'll move the root filesystem partition to the eMMC and boot from the sd card.
User avatar
MichaIng
Site Admin
Posts: 2323
Joined: Sat Nov 18, 2017 6:21 pm

Re: moving existing installation from sd card to emmc

Post by MichaIng »

Ah, in theory you can shrink the file system and partition to move everything onto the eMMC. The /boot content is not large, so splitting up space is not an argument here. You could try your image creation script for this which includes shrinking the drive to minimum and creates an .img file + 7z archive from it to store and flash back: https://github.com/MichaIng/DietPi/blob ... tpi-imager
Post Reply