


What’s particularly frustrating is that, by default, the dd file copy process makes an image out of ALL the space on your microSD card, even the unused space.For example, you might have a 64GB microSD card, but only be actually using 6GB of space. img.gz file you create in the tutorial above should be much smaller than your source card, you still need enough space to accommodate the uncompressed. If you want to make a disk image of a microSD card, but don’t have an external USB drive of a greater capacity, you have a problem. How to Shrink a Partition on Raspberry Pi You can copy this file to your PC, upload it to the cloud or send it to a friend. This process will also take several minutes but, when it is done, you will end up with a reasonably sized image file called.

sudo dd if=/dev/mmcblk0 of=/myimg.img bs=1M count=7000 The amount of data is equal to count * block size (bs) so 7000 * 1M means 7GB. So, to be on the safe side (better to copy too much data than too little), we rounded up and set dd to copy 7GB of data by using count=7000. For example, in our case, we had had a 16GB card, but after shrinking the rootfs down to 6.5GB, the card only had about 6.8GB in use (when you count the /boot partition). However, if you shrank a partition on the source microSD card, you’ll need to use the count attribute to tell it to copy only as many MBs as are in use. sudo dd if=/dev/mmcblk0 of=/myimg.img bs=1M Copy all your data to an img file by using the dd command. However, you can’t and shouldn’t do that if it’s already mounted.ĥ. If your drive isn’t mounted, try rebooting with the USB drive connected or you can mount it manually by typing sudo mkdir /dev/mysub to create a directory and sudo mount /dev/sda1 /dev/myusb to mount it. Your USB drive will probably be mounted at /media/pi/. You’ll see a list of drives connected to the Raspberry Pi and the mount point name of each.
