1775
Posts: 51
Joined: Sat Apr 18, 2015 4:16 am

Move working OS to a smaller or larger SD card?

Thu May 14, 2015 9:18 pm

Is there a way to take a image backup of one of the Rasp Pi OSs that is installed and working and install that on a micro SD card that is not the same size. For example - Raspbian installed on a 32gb card moved and installed to an 8gb card. Or Ubunto Mate installed on an 8 gb card and moved to a 32gb SD card. The resulting image file size made as a backup of an OS on a 32 gb card through Win32Imager is about 32 gb - what happens if that is then attempted to be written to an 8 gb card? Or a smaller image written to a larger card - with being able to use the full capacity of the larger card.

W. H. Heydt
Posts: 10594
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Move working OS to a smaller or larger SD card?

Thu May 14, 2015 11:09 pm

Going to a larger card is trivially easy. Just us SDimager to read it to a file on Windows (and that, incidentally, provides you with a backup), then use SDimager to write it to the new--larger--card. The final step would be to either expand the Linux root partition to use the additional space, or create a partition to go there.

Moving to a smaller card is more complex. The first step would be to shrink the partition(s) to make the actual space to be moved smaller than the new card. You would probably have to use something like dd to copy the partitions involved to a new card, though I think there are means to shrink partitions using various tools. (I wouldn't mind having a good "cookbook" for that process myself.)

1775
Posts: 51
Joined: Sat Apr 18, 2015 4:16 am

Re: Move working OS to a smaller or larger SD card?

Thu May 14, 2015 11:19 pm

Thank you. Going from large to small may be more important to start with - but it is good to know it is possible to do this in both directions. A tutorial would be nice. I am not confident enough with partition manipulation - and I guess this needs to be done on the actual card the image is on and not just an image file...

User avatar
topguy
Posts: 5618
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Move working OS to a smaller or larger SD card?

Fri May 15, 2015 12:13 am

Actually, doing it on an image is possible, faster and probably safer. If you mess up the image you can create a new one from the card. If you mess up the card.. your screwed.

Return to “Beginners”