Forum

Full Version: Resize (shrink) Image the safest way?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I have an 8GB image that I would now like to fit onto a new 4GB card.

I've had a look on the net but it's confusing and I can't seem to find anything specific to Xbian.

So what is the best/safest way to do this? Use Gparted on the card to shrink and re-save the image prior to writing to the new card?

Any hints or help greatly appreciated :-)

Skywatch
1. Use gparted to shrink the partition till +- 3.8gb
2. Use dd (with the count parameter) to create a .img file
3. Restore the .img file to the 4gb SD card
Thank you Koenkk, Fast clear and consise.

It didn't work the way I thought it would in my first post. I will have a little look on the net and find out how to use dd and 'count' and hopefully that will be the answer and I won't have to reinstall everything (especially the shh keys! - They do take a little time to get set up).

Cheers for the info.

Skywatch
No joy. :-(

Here's what I did.

Gparted, resize to 1.9 Gb

dd if=/dev/sdb of=xb1a5.img bs=1M count=2000

dd if=xb1a5.img of=/dev/sdb bs=1M count=2000

But the new card won't boot. Where have I gone wrong?

Skywatch
Now Solved.....

I used Easus to completely wipe the 4GB card. Then used...

dd if=xb1a5.img of=/dev/sdb

and I waited.

Now it's all working! Thanks, I have learned something new today! :-)

Skywatch
Just a quick update that may be of interest.

It is a week since changing from a Transcend 8GB Class 6 card to a Transcend 4GB class 10 card and I have had no corruption of the SD card.

I am also now setting the device at 'Xbian' overclock setting with no trouble (the old card was on the lowest setting and still seeing problems sometimes).

So all in all it was a worthwhile upgrade for £5.50

Skywatch.
Great this topic, I am going to do exactly the same. But I only have a Macbook Air (no disc drive). Will figure out if I can access the SD card in Virtualbox so I can run the Gparted live cd from there.
Reference URL's