# DietPI migration from 32GB to 128GB SD card

**URL:** https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845
**Category:** General Discussion
**Created:** [13 January 2021 00:00 UTC](https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845 "2021-01-13T00:00:16Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![surrevival](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@surrevival](https://dietpi.com/forum/u/surrevival)
#### Post date: [13 January 2021 00:00 UTC](https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845/1 "2021-01-13T00:00:16Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![WarHawk](https://dietpi.com/forum/user_avatar/dietpi.com/warhawk/32/21_2.png) [@WarHawk](https://dietpi.com/forum/u/WarHawk)
#### Post date: [13 January 2021 03:10 UTC](https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845/2 "2021-01-13T03:10:02Z")

</div>

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)

```nohighlight
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

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [13 January 2021 09:23 UTC](https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845/3 "2021-01-13T09:23:07Z")

</div>

Hi,

did you had a look to following community guide? [https://dietpi.com/forum/t/raspberrypi4-rpi4-upgrading-from-existing-sd-card-setup-to-boot-from-ssd/4555/1](https://dietpi.com/forum/t/raspberrypi4-rpi4-upgrading-from-existing-sd-card-setup-to-boot-from-ssd/4555/1)

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

---

<div class="post-metadata">

### Author: ![surrevival](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@surrevival](https://dietpi.com/forum/u/surrevival)
#### Post date: [13 January 2021 10:34 UTC](https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845/4 "2021-01-13T10:34:07Z")

</div>

@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 🙂

Thanks!

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [13 January 2021 11:24 UTC](https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845/5 "2021-01-13T11:24:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [13 January 2021 14:24 UTC](https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845/6 "2021-01-13T14:24:00Z")

</div>

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

```nohighlight
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:

```nohighlight
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:

```nohighlight
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:

```nohighlight
systemctl enable dietpi-fs_partition_resize

```

---

<div class="post-metadata">

### Author: ![WarHawk](https://dietpi.com/forum/user_avatar/dietpi.com/warhawk/32/21_2.png) [@WarHawk](https://dietpi.com/forum/u/WarHawk)
#### Post date: [14 January 2021 01:20 UTC](https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845/7 "2021-01-14T01:20:08Z")

</div>

> [@](#):
>
> Easiest (not fastest) is to attach both SD cards to another Linux system and use dd:
> 
> ```plaintext
> 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:
> 
> ```plaintext
> 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:
> 
> ```plaintext
> 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:
> 
> ```plaintext
> systemctl enable dietpi-fs_partition_resize
> 
> ```

Yeah I wasn’t sure if the

```plaintext
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

Nice!

---

<div class="post-metadata">

### Author: ![surrevival](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@surrevival](https://dietpi.com/forum/u/surrevival)
#### Post date: [15 January 2021 19:20 UTC](https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845/8 "2021-01-15T19:20:54Z")

</div>

Hi,

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!

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [15 January 2021 19:55 UTC](https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845/9 "2021-01-15T19:55:14Z")

</div>

Great to hear that all worked well 🙂!

---

<div class="post-metadata">

### Author: ![WarHawk](https://dietpi.com/forum/user_avatar/dietpi.com/warhawk/32/21_2.png) [@WarHawk](https://dietpi.com/forum/u/WarHawk)
#### Post date: [15 January 2021 22:04 UTC](https://dietpi.com/forum/t/dietpi-migration-from-32gb-to-128gb-sd-card/4845/10 "2021-01-15T22:04:25Z")

</div>

> [@](#):
>
> Hi,
> 
> 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!

Awesome!!!
