Creating a FreeBSD install DVD

FreeBSD distributions usually have 2 CDs. I wanted to have both CDs combined into one DVD. There are several good reasons to do this.

  • Convenience:   It is easier for me to keep track of 1 DVD.
  • Speed:  I get at the most 3-4MB/S from my 52X CDRom drive, but
    I get as high as 10MB/S from my DVD running at 16X.
  • Knowledge:   I wanted to learn more about the details of the CD and
    DVD formats.

Getting Started

     You will need the two install CD iso’s downloaded from www.freebsd.org.  Lets call then CD1.iso and CD2.iso. 
     Create a directory for the iso’s and put then into the temp directory.

# mkdir -p /usr/local/src/Downloads/temp
# cd /usr/local/src/Downloads/temp
# fetch CD1.iso
# fetch CD2.iso

     Create a memory disk of the CD2.iso and mount it on /mnt

# mdconfig -a -f CD2.iso md0
# mount -t cd9660 /dev/md0 /mnt

    Copy the contents of the iso to the directory we are in (/usr/local/src/Downloads/temp

# tar -C /mnt -cf - . | tar -xf - 

    OK.  Now unmount the iso and create a new mount for the second one.

# umount /mnt
# mdconfig -d -u 0
# mdconfig -a -f CD1.iso md0
# mount -t cd9660 /dev/md0 /mnt

    And copy the information over.  Then remove the mount.

# tar -C /mnt -cf - . | tar -xf -
# umount /mnt
# mdconfig -d -u 0

    Now we need to check a couple of things.  It is neccassary that the cdrom.inf file point to the first CD volume. In this example I am using the 7.0 BETA2 release so you might want to modify this for your release.

# cat cdrom.inf
 CD_VERSION=7.0-BETA2
 CD_VOLUME=1

    Change the package reference in the packages/INDEX file to point to the first CD.

# cd packages
# cat INDEX | sed "s/|2/|1/g" > ix
# mv ix INDEX
# cd ..

    The temp/rr_moved directory needs to be deleted.

# rm -r temp/rr_moved
# cd /usr/local/src/Downloads

    Everything is ready now to create the DVD.  We use growisofs to build and burn the DVD iso.  This next command will create the iso and burn it onto the DVD all in one action.  If you just want to create a iso image, then modify the next command (I’ll leave it up to you to read the man page 😉 ). NOTE: my DVD burner is on device /dev/cd0 and it can burn at 16x, if yours is different then you will have to modify the following line.

# growisofs -Z /dev/cd0 -speed 16 -J -R -no-emul-boot -b boot/cdboot -iso-level 3 temp

Why did I leave the origonal iso images on the DVD?

     DVDs and Cds start writing at inside of the disk. This is the slowest area of the media. By putting the 2 CD images into the directory first, I moved the DVD installation data about 1.2G into the DVD. The read speeds improve significantly by doing this.  You also never know when you might need the old iso’s and if you do then they are right there.

Leave a Comment

Your email address will not be published.