Page 1 of 1

Backup image doesn't fit the new SD card

Posted: Tue Apr 30, 2019 8:20 am
by tampe125
Hello everyone,

I have a problem that is really bugging me.
I have made a backup of my SD card (16Gb) using dd. Then I wanted to copy the same exact setup to a new Raspberry.
So I got a new SD card (16Gb) and dumped data back using dd

and...

No space left on device

sigh, I knew it could happen, so I decided to resize the image chopping few bytes (there's plenty of free space).
I mounted the image on dev/loop and used gparted to shrink the filesystem, so I have about 200-300Mb of unallocated space.
Finally I chopped off those bytes using truncate:

truncate -s -100Mb myimage.img

I put everything back but, my Pi complains about the inode count. The GUI starts (I added a touchscreen), but it seems the Wi-Fi is not found and several services I created with systemd are not firing. So basically it's borked.

Any suggestions on how I can create small images (let's say 10Gb), so I can easily restore them in any card?

Re: Backup image doesn't fit the new SD card

Posted: Tue Apr 30, 2019 8:33 am
by B.Goode
Any suggestions on how I can create small images (let's say 10Gb), so I can easily restore them in any card?
If you are using the Raspberry Pi Foundation Raspbian Operating System, consider using their SDCardCopier utility.

(It doesn't work with images, but it does produce the smallest backup possible without using compression.)

Re: Backup image doesn't fit the new SD card

Posted: Tue Apr 30, 2019 8:39 am
by tampe125
I just owe you a truckload of beer!