This is really just a sanity check!
Background: The current standard Pi Rasbian image is 3.8GB in size. If I write that to (say) an 8GB card it'll only give me access to that 3.8Gb until I resize the partition (for which Raspbian includes scripts).
Assume I *don't* do that resize.
I set things up the way I want on the Pi, and I then want to create a new image of the SD card to restore to another card (possibly a different size). "dd" will get me an 8GB image by default (since it's an 8GB card) but am I correct that I can safely limit the image to the exact size of the original Rasbian image?
The objective here is that (a) writing a 3.8GB image to a new card is much faster than writing an 8GB image, and (b) that it will safely write to any 4GB/8GB/16GB/etc card (where an 8GB image might not fit on a different model of 8GB card). The third benefit (c) of a smaller image is less of a concern as I can compress it anyway and unused space should pretty much disappear that way.
On 17/03/16 10:48, Mark Rogers wrote:
This is really just a sanity check!
Background: The current standard Pi Rasbian image is 3.8GB in size. If I write that to (say) an 8GB card it'll only give me access to that 3.8Gb until I resize the partition (for which Raspbian includes scripts).
Assume I *don't* do that resize.
I set things up the way I want on the Pi, and I then want to create a new image of the SD card to restore to another card (possibly a different size). "dd" will get me an 8GB image by default (since it's an 8GB card) but am I correct that I can safely limit the image to the exact size of the original Rasbian image?
The objective here is that (a) writing a 3.8GB image to a new card is much faster than writing an 8GB image, and (b) that it will safely write to any 4GB/8GB/16GB/etc card (where an 8GB image might not fit on a different model of 8GB card). The third benefit (c) of a smaller image is less of a concern as I can compress it anyway and unused space should pretty much disappear that way.
Not entirely sure on the working of DD, but...
If rather than resizing the partition initially to the full 8GB, you just increased it a bit, to give you enough room for your mods (4 1/2?) Then tweak you install, then image the 4.5gb partition, then you're sorted and don't have to tweak dd or limit anything.
You'd have to write more than 3.8GB, but still way less than 8GB.
Cheers Steve
On 17 March 2016 at 11:39, steve-ALUG@hst.me.uk wrote:
If rather than resizing the partition initially to the full 8GB, you just increased it a bit, to give you enough room for your mods (4 1/2?) Then tweak you install, then image the 4.5gb partition, then you're sorted and don't have to tweak dd or limit anything.
The default image has enough space for my needs, because there's enough pre-installed stuff that I uninstall anyway that gives me about 1GB free (and I need next to nothing for my purposes).
But if I did what you suggest that still leads me back to the original question but with a twist as I'm not sure how to calculate the size of image to create using dd. Presumably it's everything up to the end of the used partitions, which I guess I can get from fdisk?
Keeping to the size of the original image avoids a calculation but I'm still looking for confirmation that this will do what I expect. "Try it and see" is the obvious answer but just because it seems to work doesn't mean I haven't stored up problems for later.