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)
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
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 .
After done when booting the new SD card, expand partition and file system on a next reboot via:
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!