Minimize FreeBSD size

Hello all.
I have chosen a minimal installation of FreeBSD 8.3 to only activate Bind but the size is about 400MB, so I wonder if there is a way to minimize this size.(but without using nanobsd because it is not easy for me to deal with unless you have a good tutorial for this).
Thanks.
 
Yes, you have a lot of possibilities, first have a look at src.conf(5) there is plenty of KNOB that you can define to make a world really smaller !

But this need to fetch system sources and rebuild world.

Then you can also build a custom kernel and remove all unnecessary modules by adding

Code:
options NO_MODULE="yes"

In the kernel configuration.

That also need to fecth source and rebuild kernel. These steps are not really hard, see

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html

For instance, this helped me to reduce my FreeBSD installation to something like 120-200Mo, can't remember well :)
 
If you don't build any modules, then you can not kldload any kernel functionality should you need it. You will have to rebuild the kernel each time you realize you forgot something. So bad idea IMHO. If you want to slim down on modules (which also saves on builkernel time), place this in src.conf:
Code:
WITHOUT_MODULES= "acpi_asus acpi_dock acpi_fujitsu acpi_hp ....."
That way you specifically select the modules you are sure you do not need. A full module list can be seen by listing files in /boot/kernel.

More effective option is to slim-down world, since modules do not take that much space anyway. In /etc/src.conf, get rid of everything you do not need. Some examples:
Code:
WITHOUT_BLUETOOTH
WITHOUT_EXAMPLES
All documented in the man page, and many options available to slim-down unnecessary world components. There is one thing you need to pay attention to in this file; clang vs gcc42. Pick one, and disable the other since space, not code optimization is your concern - for example:
Code:
WITHOUT_CLANG

@Markland: There are some other KNOBS that are not documented / enabled in /etc/srfc.conf. You need to set those separately. These can be set in a) /etc/make.conf, b) in environment:
# setenv NO_MAN yes
or c) in the command line with -DNO_MAN. Available knobs:
Code:
-DNO_MAN -DNODOC -DNO_GAMES -DNO_INFO -DNO_JAIL -DNOPORTS -DNOSRC
Once world is built like this, you can then roll this into an iso file to use elsewhere:
[CMD="/usr/src/release > #"]make iso[/CMD]
or make release if you prefer.
 
400MBs for the base system and you call that big? It's really really slim compared to what other similar operating systems take in their minimal installation. I would waste my time on other kind of "improvements".
 
@bsaidus

If You do not want to rebuild, then remove the kernel debugging symbols located at /boot/kernel/*.symbols, You can also compress the /boot/kernel/kernel with gzip(1) into /boot/kernel/kernel.gz which will reduce the total size to about 230MB.

You can also remove 'by hand' the unneeded modules and also unneded parts of the system under / as long as You know what You are doing.

The sysutils/ncdu will be handy.
 
Using gzip is a very good idea. Which brings up another idea for the OP: Just use mfsbsd - only 26 MB, or 100 MB for special edition. I have the smaller on on a usb flash drive which I boot from for rescuing things.
 
Beeblebrox said:
Using gzip is a very good idea. Which brings up another idea for the OP: Just use mfsbsd - only 26 MB, or 100 MB for special edition. I have the smaller on on a usb flash drive which I boot from for rescuing things.

Good idea! But do you have a method to install it (mfsBSD) on a hard-disk and boot from it?
 
Back
Top