3

I have configured by raspberry pi as a wifi access point using a 32GB SD card, and installed postgres. I would like to clone the SD card (from my mac) to smaller size SD cards (like 16GB, or potentially 8GB cards). Is this possible (knowing that I use mush less than 8GB space on the card)?

Is there something more to do than just usual dd commands?

I tried with an 8GB card, but it didn't work, although I got no error message.

  • See here: raspberrypi.stackexchange.com/a/29952/5538 As per the hint at the beginning, there may be a slightly less tedious method you could use directly on the image with resize2fs, but only slightly, which is why I did not bother to go through it there. In either case you will need a linux system or the equivalent to do it. – goldilocks Jan 17 '16 at 12:08
  • thanks for you comment. I read this thread: raspberrypi.stackexchange.com/questions/1058/…, and although I didn't fully get what he/she was doing, it seemed to me it was simpler – Clémentine Jan 17 '16 at 14:40
  • 2
    It depends on whether you expanded the filesystem(s) at some point beyond 8/16 GB. E.g., if the total size of partitions is 3 GB and there are no gaps between them, you could just use dd on the first half of the card. However, if the total size is 10 GB, you could not fit that onto an 8 GB card without resizing the partitions and filesystems (they are two different things) first. You must do this even if a filesystem is mostly empty (if it is full, you cannot shrink it anyway). – goldilocks Jan 17 '16 at 14:45
  • Depending on whether you are using ext4 or ext3 as a file-system you may be able to resize both the file-system and THEN the partition. On the other-hand we do not know that you ARE using the full 32GB of the SD card. Can you include the output of sudo sfdisk -l (last character is lower cased 'ell') that particular incantation will not change anything about the partitioning but don't mess about with the sfdisk command generally! – SlySven Jan 18 '16 at 10:59
1

You can easily resize file systems and partitions using GParted to less then 8GB and then clone card to smaller one.

0

I won't try this before but copying 8Gb to 16Gb is quite possible and easy. You could also use the un-allocated space as an extra space. Try to check here: [RaspberryPI 8Gb img to 16Gb]. It would really help!

In order to the un-allocated space, there are a few steps to follow.

The steps that I did:

  1. Copy the 8GB img to the 16GB storage drive/device using "Win32 Disk Imager".
  2. Boot you RaspberryPI using your old 8GB SD card or USB.
  3. Open LXTerminal and type or copy and paste "sudo apt-get install gparted".
  4. Connect the 16GB SD card or USB in the other USB slot.
  5. Type or copy and paste "gksudo gparted" in the LXTerminal. Wait for the GParted window will appear.
  6. In the drop menu located at the upper right side the GParted and select the 16GB SD card or USB.
  7. Click "Resize/Move" and move the GParted slider to the end.
  8. Click "Apply All Operations" to all apply the change you to the storage drive.
  9. Just close the GParted window and shutdown the RaspberryPI
  10. Remove the 8GB and keep the 16GB plug in the USB port.

The RaspberryPI will the display the text indicator in a startup but it will not continue in your desktop, but don't panic, it just detecting all the block and keeps all intact. I will restart in the second time, and it time that the RaspberryPI will boot to its desktop.

Check the storage if it increases in size/capacity, if "YES", congratulations, you made it and that's easy.

  • 1
    This does not answer the question. The asker want to shrink a 32 GB SD Card to 8 GB, not what you suggested with expanding a SD Card installation. – Ingo May 11 at 10:39
0

I've implemented an experimental option to shrink or expand Linux partitions in ApplePi-Baker. Maybe it's worth a try.

-1

1 use gparted live make the partition smaller then 8gb

2 use win32diskimager to make a image from the resized sdcard

3 use win32diskimager to restore the smal image to youe sdcard

4 use gparted live again to rezize the sdcard so that you have all the space from your sdcard

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.