Cloning to a larger microsd

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
AJRobson
Posts: 56
Joined: Fri Jan 08, 2021 2:23 pm

Cloning to a larger microsd

Post by AJRobson »

I’m currently running dietpi on a 200gb micro SD, Amazon have 512GB cards on sale for Black Friday.

If I make a copy of my card with something like win32 disk imager and write it to a larger card well everything just work? Will all my in progress torrents resume? My files be intact? My PiHole instance continue to work etc?
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Cloning to a larger microsd

Post by Joulinar »

yes this should work. But at the end your new disk will show 200GB after the copy because the disk will be cloned 1:1. You would need to resize the RootFS afterwards. But honestly I would not use such a big SD card. Better to use a SSD/HDD if you download constantly files. Otherwise you will run the risk of physical issues on the SD card as a SD card is not designed for constant r/w operation.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
AJRobson
Posts: 56
Joined: Fri Jan 08, 2021 2:23 pm

Re: Cloning to a larger microsd

Post by AJRobson »

Thanks for the reply. Once it’s up and running and the torrents are complete it won’t be used for downloading much anymore but I’ll look at getting an ssd if I have issues.

How would I resize the rootFS once it’s cloned? Is there an option in DietPi-config? I think I did it before on raspian through the raspi-config menu.
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Cloning to a larger microsd

Post by Joulinar »

The following user guide was created to describe on how to migrate from SD to SSD. But it should work similar way from SD to SD

viewtopic.php?p=28027#p28027
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 3514
Joined: Sat Nov 18, 2017 6:21 pm

Re: Cloning to a larger microsd

Post by MichaIng »

Puhh that is a long guide. In short:
  1. On the original running sytem: systemctl enable dietpi-fs_partition_resize
  2. Use a tool like win32 disk imager to do a full image clone of the SD card (not a single partition or filesystem only).
  3. Use your favourite tool to flash this image file to the new drive.
  4. The enabled service above will automatically resize partition and filesystem when booting the the new drive, all services will function as before, as UUIDs and mount points have not changed.
Post Reply