0

This question already has an answer here:

I installed Raspbian Jessie Light on a 16 GB card and then used raspi-config to expand the filesystem to fit the whole card.

Is it possible to go back?

That is, create a new image with smaller footprint without using another SD card reader? Or can raspi-config change it back?

I don't imagine dd will work while system is running on the card.

Maybe even a Windows tool where I can do it when the card is offline?

marked as duplicate by goldilocks Jul 13 '16 at 17:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • "Maybe even a Windows tool where I can do it when the card is offline?" -> Windows cannot even read an ext4 partition without third party tools, so while it's not impossible, it is unlikely to be easy; if you do have such tools you could do it along the same lines as explained in the duplicate answer. Probably a better idea is to just install a VM or get a live CD. You probably want to investigate the "simpler" method mentioned at the top of the accepted answer. – goldilocks Jul 13 '16 at 18:47
  • Hmmm - thanks I never would have found that by looking at the title "Reverse the expand root FS". I do use win32diskimager to save the image as I modify it - then restore it if I screw it up. So thought it possible that there might be something out there - definitely would look at third party tool - when I said Windows - I just meant platform – dbmitch Jul 13 '16 at 20:03
  • 1
    Windows can work the image file as a whole, the problem is it can't read the second partition inside the image because of the filesystem type, and you have to shrink first the filesystem, then the partition it is inside of (and the partition is either inside an image file, or on the actual card). If you stick the actual card in a Windows box, it will not even recognize there are two partitions there, it will just see the first (quite small) one. This may help with some of the distinctions if you are uncertain (see "Image Files" at bottom). – goldilocks Jul 13 '16 at 20:08
  • 1
    This answer has links to two articles about shrinking the filesystem (via resize2fs) and then the partition (via fdisk) which is the "simpler" method to just change the card in place. Again, you'll need a linux system (you can run one inside a virtual machine on windows, e.g. vmware or virtualbox). Or if you have two cards set up for the pi and a USB SD adapter, you could do it on the pi running off the second card. – goldilocks Jul 13 '16 at 20:14