Recreating the FreeBSD Installation Disks

Martin G. McCormick martin at
Wed Aug 27 14:25:19 UTC 2014

	I have been asking lots of questions recently about
whether the procedure for building a custom FreeBSD installation
CD has changed and it apparently has not but the problem I am
having is not hard to define.
The original image downloaded from is:
FreeBSD-9.1-RELEASE-amd64-disc1.iso and it is
718862336 bytes large.
I mounted it on a FreeBSD9 system as follows:
##Set up memory disk.
# mdconfig -f FreeBSD-9.1-RELEASE-amd64-disc1.iso -u 1
##Mount it.
#mount -t cd9660 /dev/md1 /mnt2
	Everything looks normal if you ls /mnt2.
If one was to use mkisofs with /mnt2 as the top of the tree, a
new iso image file should appear somewhere that is about the
same size as the starting ISO file. As a test to see if this
happens, I did the following:
#   mkisofs -J -R -V customBSD -no-emul-boot -b boot/cdboot -iso-level 3 -o \
#/home/martin/tmp/serialcd64.iso .
#ls -l /home/martin/serialcd64.iso
-rw-r--r--  1 root  martin  833892352 Aug 26 10:48 serialcd64.iso

Man! I sure wish my pay check could do that after a week of
	I know that hard links will make tar and rsync produce
larger outputs if not called correctly. My understanding is that
hard links are multiple sets of inode numbers pointing to the
same files so they are hard to mechanically distinguish from
actual disk space being occupied by the same data in more than
one spot.
	When one needs to make a custom CD, the extremely
difficult part is recreating the steps that were used to
originally build the image.
	An amusing side note; I used rsync to create a writable
copy of the tree as follows:
#cd ./treetop
#sudo rsync -a /mnt2/ ./
	A few seconds later, I had something that built without
a single complaint so I made an image out of treetop and got:
#ls -l custom*
-rw-r--r--  1 martin  martin  455213056 Aug 26 11:42 custom.iso
	That was the exact same file tree that insists on being
120 MB too large if you try to make a straight ISO image from
the mounted file system of the original image which is about 300
MB larger than this one.
	That has been pretty much the story of the last few days
and I am running out of things to try. The process for building
the FreeBSD installation CD is clever since it manages to cram
so much in to the limited space without compressing the entire
image. So far, orthogonalness has escaped me at every turn.

Martin McCormick

More information about the freebsd-questions mailing list