I've been trying to make a backup of this raspberry pi SD card and I keep failing. I just needed it a little bit smaller so it would fit on another 32GB SD card that I have. After a lot of failures following tutorials (like pishrink) I shrank my root fs down to around 8GiB which should fit just fine. Then I copied it over with DD like this:
dd if=/dev/mmcblk0 of=small.img bs=1M count=10240 and to the target like this
dd if=small.img of=/dev/mmcblk0 bs=1M count=10240 Whenever I do this the root partition ends up with an unknown filetype. It is originally ext4, here is the working SD Card in gparted. You can see the root partition is happy as ext4.
And here is gparted on the second card after I try to write it. The boot partition is fine but something happened to the ext4 root partition. The PI actually boots up until it tries to load the root partition. This happens no matter how many times I try to copy the image, or even if I try to leave off the size in the dd command. What could I be missing here?
I should say that I did all of this copying on my ubuntu machine after removing the SD card from the PI. So the filesystem was not in use on the card when copying it.
I was finally able to get it to boot though by putting the bad SD card into my ubuntu machine and running fsck -l /dev/mmcblk0p2. I ctrl-c'd when it started talking to me about garbage.
And now gparted sees it as ext4 and it boots... But what the heck :) I don't get why this happened.



mountto check if it's mounted or not