Backup image doesn't fit the new SD card
Posted: Tue Apr 30, 2019 8:20 am
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?
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?