What is the safest way to reduce a partition size?


I want to reduce the partition size of the mmcblk0p2 because I want to copy everything to a smaller SD-Card. What is the safest way to do that? Via ssh at the commandline with some kind of commands, download a partition manager to dietpi or the best way to do the copy on a windows pc with a partition manager?

What is the recommend size of the partition mmcblk0p2? At present it shows 1.3G in use. All my userdata I have moved to an USB-Disk. Are these 1.3G the size of DietPi an apps?

I would liked to have used dd to make an image of everything but I have read that this will not work for the systempartition while up and running.

Thank you.

On our online docs we recommend a SD card of at least 4 GiB.

If you have a 2nd Linux box, you could use our DietPi image tool to create an img backup of your SD card. This would reduce size as well and could be used to flash to new SD card.

Ok, thank you. But where do I find the DietPi image tool? I just know the DietPi Backup Tool.

  1. on the system you like to create the image from, enable the resize service first
systemctl enable dietpi-fs_partition_resize.service
  1. poweroff the original system
  2. attach the SD card to another Linux box via SD > USB adapter
  3. run the image script on the 2nd Linux box to create an *.img file from SD card
bash -c "$(curl -sSfL 'https://raw.githubusercontent.com/MichaIng/DietPi/master/.meta/dietpi-imager')"