2

I was trying to clone one Raspberry PI Image and write it to a new SD card. Unfortunately after tests i have found that the orginal SD 4G card is actually 3.69G and the new 4G SD card is actually 3.68G. :(

Am i screwed?

Cheers for looking

Deadlocked
  • 29
  • 1
  • 2

2 Answers2

1

You're not screwed. That is not to say my solution will work, but one way or another this can be worked out.

The easiest way might be to start by using the image that was the original source of the card you want to copy (presuming it is not also 3.69G). Put that on the new card. Next, use gparted or whatever to size the data partition (for raspbian, that's the second one) on the card up. Then mount both data partitions, and update the new one from the old one with rsync:

rsync -aE /mnt/data-old /mnt/data-new

The -aE switches ensure permissions (including the executable bit) remain the same.

I have done this (for different reasons) before with raspbian and there were no problems.

Just to be clear: make sure you do this with the two cards mounted on a computer. Although you could use rsync over a network to update / on a running Rpi system, it is a very bad idea, if the pi is the destination of the sync.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
1

This problem is taken care of by the built-in accessory "SD Card Copier" that is part of the RPi3 op system. It seems size tolerant: I copied my 32 GB card to a 16 Gb card.

user68832
  • 11
  • 1