antiriad
Posts: 158
Joined: Sun Nov 17, 2013 7:38 pm
Location: Italy
Contact: Twitter

Reduce customized Raspbian image size for sharing

Sun Oct 22, 2017 7:24 am

Hello,
I'd like to share my customized Raspbian as a downloadable ISO for a project.

What would be a good (and easy?) approach to get an ISO smaller than the SD card size, and to allow users to resize it easily afterwards?

Thank you very much.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Reduce customized Raspbian image size for sharing

Sun Oct 22, 2017 11:00 am

Burn a gparted live CD and use it with your image.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

antiriad
Posts: 158
Joined: Sun Nov 17, 2013 7:38 pm
Location: Italy
Contact: Twitter

Re: Reduce customized Raspbian image size for sharing

Sun Oct 22, 2017 11:09 am

Hello and thank you for your answer.

Actually I make a SD-card image with Win32DiskImager (I'm on Windows, but I can eventually use OSX or Ubuntu).

So should I use gParted to open the ISO file?

d_older
Posts: 126
Joined: Mon Jun 25, 2012 5:04 pm
Location: East Yorkshire, UK

Re: Reduce customized Raspbian image size for sharing

Sun Oct 22, 2017 11:16 am

Hi Antirad,

If its a true Raspbian image (not Noobs)

I've had good results using resizeimage.pl for shrinking backups - from these forums back in 2013 - I'm surprised it's not mentioned more

viewtopic.php?f=91&t=58069

and there is a version on git hub at

https://github.com/mikerr/pihome/blob/m ... zeimage.pl


I would recommend copying the image for the first test as the program replaces the file.

YOU WILL HAVE TO MANUALLY EXPAND THE FILE SYSTEM ON FIRST BOOT IN THE PI.

Hope this helps

Dave

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Reduce customized Raspbian image size for sharing

Sun Oct 22, 2017 11:43 am

All proper tools to handle Pi images are only available on Linux. gparted is one of them.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

antiriad
Posts: 158
Joined: Sun Nov 17, 2013 7:38 pm
Location: Italy
Contact: Twitter

Re: Reduce customized Raspbian image size for sharing

Sun Oct 22, 2017 12:20 pm

Thank you very much for your feedback.
Going a bit further: is technically possibile to make in Raspbian another (third) partition like "boot", readable both in Raspbian and Windows/Mac?
And maybe to make users to expand it with a custom script?
Thanks

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Reduce customized Raspbian image size for sharing

Mon Oct 23, 2017 7:21 am

Windows only mounts the first partition on removable media.

The Pi expects the first partition to be FAT. It doesn't support UDF , HFS , NTFS or anything else on the boot partition.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Reduce customized Raspbian image size for sharing

Mon Oct 23, 2017 9:59 am

ghans wrote:
Mon Oct 23, 2017 7:21 am
Windows only mounts the first partition Windows readable partitions on removable media.
FTFY

It will also threaten to reformat every unreadable parition. ALWAYS choose [CANCEL] from those pop-ups.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

antiriad
Posts: 158
Joined: Sun Nov 17, 2013 7:38 pm
Location: Italy
Contact: Twitter

Re: Reduce customized Raspbian image size for sharing

Mon Nov 06, 2017 9:02 am

Hello,
I have abandoned the idea of expanding the boot partition (for transferring data I set up a shared Samba folder), but I'm stil trying to make my Raspbian (not NOOBS) customized image as light as possible (would be great to keep below 1GB).

I successfully built this Raspbian Shrink script for Docker on Mac, but still I get 2.5 GB image (from 4GB).

Any other hint?
(maybe this script will work also on Mac, more confortable for me?)

Thanks

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Reduce customized Raspbian image size for sharing

Mon Nov 06, 2017 9:51 am

ghans wrote:
Mon Oct 23, 2017 7:21 am
Windows only mounts the first partition on removable media.
The rumor is that this is fixed in Windows 10. I do not have a Windows 10 machine upon which to test this.

Could someone test/confirm this rumor?

Note: By "fixed", I mean that it will mount all Windows-readable partitions; not just the first one.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

User avatar
Imperf3kt
Posts: 3626
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Reduce customized Raspbian image size for sharing

Mon Nov 06, 2017 11:28 am

n67 wrote:
Mon Nov 06, 2017 9:51 am
ghans wrote:
Mon Oct 23, 2017 7:21 am
Windows only mounts the first partition on removable media.
The rumor is that this is fixed in Windows 10. I do not have a Windows 10 machine upon which to test this.

Could someone test/confirm this rumor?

Note: By "fixed", I mean that it will mount all Windows-readable partitions; not just the first one.
Not sure where this (mis?)information comes from, but in the last ~20 years I have been using Windows, it has never _not_ shown all readable partitions on external media.
Its actually really frigging annoying.

Do note that I customise every install to show hidden files and folders (off by default to keep Windows 'idiot-proof')
55:55:44:44:4C
52:4C:52:42:41

User avatar
r3d4
Posts: 982
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Reduce customized Raspbian image size for sharing

Mon Nov 06, 2017 11:43 am

DougieLawson wrote:
Mon Oct 23, 2017 9:59 am
ghans wrote:
Mon Oct 23, 2017 7:21 am
Windows only mounts the first partition Windows readable partitions on removable media.
FTFY

It will also threaten to reformat every unreadable parition. ALWAYS choose [CANCEL] from those pop-ups.
see also : diskmod.sys

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Reduce customized Raspbian image size for sharing

Mon Nov 06, 2017 2:49 pm

see also : diskmod.sys
Interesting. Check this URL for more info:

http://agnipulse.com/2012/03/filter-dri ... k-windows/

There seems to be several alternatives (3 are given at the URL) - of which "diskmod.sys" is only one - but note that they are all 3rd party (not-standard-Windows).


To whoever it was who posted above that this is a nothing-burger - that it "just works" - the article at the URL seems clear that it doesn't "just work" unless you use one of these "filter drivers". Whether any of this is true or not, I must confess I have never tested, so cannot say with any certainty - note that it takes a fair amount of setup (some would say, a perverse setup) to test this. I suspect that the poster did not actually test correctly.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

User avatar
r3d4
Posts: 982
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Reduce customized Raspbian image size for sharing

Mon Nov 06, 2017 3:46 pm

antiriad wrote:
Sun Oct 22, 2017 7:24 am
I'd like to share my customized Raspbian as a downloadable
Ok ...

What did you change in rasbian ?

Why do you need ppl to download raspbian + your changes ?


IMHO

You should
A) script your changes to rasbian , and distribute the script .

B) make the changes that you need to PiCore which is the pi version a tiny linuxOS ,so smaller to DL.

feelslikeautumn
Posts: 315
Joined: Wed Aug 09, 2017 9:51 pm

Re: Reduce customized Raspbian image size for sharing

Tue Nov 07, 2017 10:34 am

Yeah, if you want to go down the scripting route then you could do it with the debian installer (I posted my own version for raspbian last month). That only needs something like 30MB, and with a preseed file you could automate the whole thing. The downside is to install it takes something like 30 of 40 mins on a pi3.

If you are after a more instant thing (and depending on your use case), you might like to consider a debian live install image. Again, I posted my own version of lubuntu for the pi on this forum as an example. It uses squashfs and is under 1GB.

Otherwise I can only suggest standard compression tools, with the compression turned all the way up to get it under 1GB.

Return to “Advanced users”