How can I extract some of the folders of a stock FreeBSD install from the ISO without actually installing FreeBSD?

I am trying to build a number of cross-compilers for various major versions of FreeBSD and need to get the libc and some includes and would like to be able to extract /usr/include and /usr/lib or rather parts of them ...

Edit: given the first response I feel I have to elaborate a bit. It is trivial to mount an ISO file and I know how to do that on a number of platforms (e.g. on my Linux box: mount -o loop FreeBSD-7.0-RELEASE-amd64-disc1.iso freebsd7/). However, when you mount the installation ISOs for FreeBSD you will notice that they don't contain a folder usr as can be easily seen from the output of find -type d -name usr while inside the folder in which the ISO is mounted. Evidently the files are stored away in some format and I need to be able to parse whatever meta-information exists to find what file is the archive that contains the stuff I need to extract and then extract it.

  • 1
    The files from e.g. ftp.fr.freebsd.org/pub/FreeBSD/releases/amd64/8.2-RELEASE/base are extracted with: cat base.?? | tar --unlink -xpzf - (not sure if the archive in base/ has the /usr you seek)
    – hhaamu
    Commented Feb 15, 2012 at 21:25
  • @hhaamu's hint is good, there's a file called base.mtree that gives some insight, i.e. lists what's in the base.?? files -- and it does mention gcc.
    – sr_
    Commented Feb 16, 2012 at 13:07
  • @hhaamu: can you write that up as an answer, please? ... Commented Feb 16, 2012 at 14:28

2 Answers 2


If you download the files from e.g. ftp://ftp.fr.freebsd.org/pub/FreeBSD/releases/amd64/8.2-RELEASE/base/ (you can probably find them on your ISO, too), you can extract them with this:

cat base.?? | tar --unlink -xpzf -

(taken from the install.sh in the same directory)

In addition, the base.mtree file describes the contents of the archive.

There are other archives to be found, too. For example, manpages which contains the manual pages to be put in /usr/share/man/, kernels which contains the kernel modules, and dict which contain wordlists to be put in /usr/share/dict/


You should be able to do this (at least with the FreeBSD-9.0-RELEASE-i386-disc1.iso image) by mounting the ISO image to some location and them perform the file operations from there. Something like:

# mkdir /mnt/freebsd
# mount -t auto /path/to/install_image.iso /mnt/freebsd
# cp -r /mnt/freebsd/usr/include /some/other/location
# umount /mnt/freebsd

No need to install anything. So after you have everything, simply unmount the ISO and continue hacking. This seems to be the simplest way I can think of.

  • Okay, I had to use mount -o loop because I'm on Linux. So I have a FreeBSD 7 ISO mounted. However, find -type d -name usr gives me an empty set. I would not have asked the question if it was that trivial as I knew how to mount it. The problem is how to find the files that are apparently packed up in some way. I edited my question. Commented Feb 15, 2012 at 16:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .