# Install to chroot directory



## paradoxmonkey (Oct 3, 2010)

What's the best and easiest way to install a minimal (< 100MB) freebsd FreeBSD system to a directory? I would then be able to chroot into the minimal system and install all needed packages.

I'm going to run Freebsd FreeBSD on an small flash disk (256MB) so I need it to be small.


----------



## graudeejs (Oct 3, 2010)

http://www.freebsd.org/doc/en/articles/nanobsd/index.html ?
Otherwise 256MB is probably not enough... 512 would bee ok


----------



## aragon (Oct 3, 2010)

It's funny that I'm working on exactly this right now. I need to build custom packages for multiple systems and a mix of amd64 and i386 architectures.

NanoBSD was my starting point too, but I've modified it hugely already so that it sets up and maintains a ports skeleton, tracks run dependencies, and builds packages automatically. Busy changing it to use portmaster for a lot of work now.

Sorry, nothing useful to show yet...


----------



## SirDice (Oct 4, 2010)

Make use of DESTDIR when doing *installkernel* and/or *installworld*. Also tune the heck out of /etc/src.conf. See src.conf(5).


----------



## SIFE (Nov 1, 2010)

How to remove chroot directory?


----------



## graudeejs (Nov 1, 2010)

You mean exit chroot?
`# exit`


----------



## SIFE (Nov 23, 2010)

No, I mean:

```
rm -R /path/to/chroot
```


----------



## graudeejs (Nov 23, 2010)

if you can't remove it, then run
`# chflags -R 0 /path/to/chroot`
then remove it


----------



## SIFE (Dec 11, 2010)

Reinstalling chroot also fix my problem Mr killasmurf86.


----------

