DietPI migration from 32GB to 128GB SD card

hi all,

I’ve got my P4 running on DietPI 32GB SD card and would like to upgrade the SD card to 128GB. I’ve bee trying to find some instructions online on how to migrate the OS onto new card but nothing seem to be working. As this is 128GB card looks like I can forget about installing DietPI throubh balenaEtcher as apparently it won’t format the card properly (mentioning that as I was also trying to install fresh DietPI on this card with no joy).

I also took an image of my 32GB card with Win32diskImager and restored it onto 128GB but it didn’t work either (was able to see FAT32 boot partiotion on the new SD card but it did not boot up)

Question: Does anyone successfully upgraded SD card from <=32GB onto larger one and can share some tips how to do it?

I wonder if you had two of those sd card adapters if you could boot into clonezilla and use it to ghost from the 32GB to 128GB so it would copy over the boot info and once copied over boot into another livecd distro with a gui interface and use gparted to expand the partition to fill the new drive

That is how I moved over dietpi from that 2GB SATA SOC (where it almost filled it completely up but it installed it) to a 128GB M2 drive on the M340C thin client I have. It should work just fine with two USB → SD card adapters as well
A. Used clonezilla live .iso on a USB drive that has ventoy installed on it
B. Cloned the 2gb SOC to the 128gb M2 drive
C. Booted ubuntu live cd to get gui desktop, then used gparted to expand the partition to fill the entire drive
D. Tell BIOS to use the new M2 drive (for you it would just be the new SD card inserted)

warhawk@M-340C:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G     0  3.8G   0% /dev
tmpfs           782M   81M  701M  11% /run
/dev/sda1       118G  2.5G  110G   3% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs           3.9G     0  3.9G   0% /tmp
tmpfs            50M  640K   50M   2% /var/log
/dev/sdb1        15G  1.9G   13G  14% /mnt/722c121a-917e-4039-9f09-6bfa3e571047

I need to do the same to the 15GB external to a new USB3.0 for the data backup…however it might change the mount point since it will be a new device

The reason you need a livecd linux flavor to boot into is that it will not use/mount the OS SD card allowing it to be copied in it’s entirety

Clonezilla will also allow you to create a ghost image file if needed


did you had a look to following community guide?

It should work similar with a larger SD card. Indeed if you are able to connect both SD card to same computer, you could use GParted to clone the small one into the larger one.

But there might be other obstacle if you are not able to flash that new large SD card with a new image

@Joulinar yes, I’ve looked into this one just yesterday but I think I’'ll first try @WarHawk suggestion as thats something I was actually considering, I have a feeling this might work alright :slight_smile:


try GParted. usually one of the best tool for such operation.

Easiest (not fastest) is to attach both SD cards to another Linux system and use dd:

dd if=/dev/mmcblk0 of=/dev/mmcblk1 bs=1M status=progress

Replace the SD card device numbers with the actual ones, of course, “0” being the 32 MiB SD card and “1” the 128 MiB one.

The same can be done from the running DietPi system, but you need to mount the file systems in read-only mode first:

dietpi-services stop
umount /boot
mount -o remount,ro /

The last step might fail with “device is busy”, if there are still files write-opened. Check with:

lsof / | mawk '$4~/[0-9]+[uw]/'

but sometimes there is nothing shown and umount still fails, in which case waiting a bit or killing some more non-required processes via htop might help. However, best to do from an external system :wink:.

After done when booting the new SD card, expand partition and file system on a next reboot via:

systemctl enable dietpi-fs_partition_resize

Yeah I wasn’t sure if the

systemctl enable dietpi-fs_partition_resize

would work…but MichaIng said it would so just cloning the small to large sd then expanding will fill the device



i did manage to clone the cards with disk-to-disk Clonezilla live CD. Although I did not have another SD card slot I’ve cloned it from 32GB microSD (using build in laptop slot) onto 120GB external hard drive (USB), then from there onto 128GB microSD card.
Then using Ubuntu liveCD and gparted, expanded the ext4 partition and its all now dancing and singing.
Thanks all for your help, really appreciate it!

Great to hear that all worked well :slight_smile:!