From mwm@mired.org Sun Mar 18 03:28:07 2001 Return-Path: Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id 8F5F837B718 for ; Sun, 18 Mar 2001 03:28:06 -0800 (PST) (envelope-from mwm@mired.org) Received: (qmail 67335 invoked by uid 100); 18 Mar 2001 11:28:05 -0000 Message-Id: <20010318112805.67334.qmail@guru.mired.org> Date: 18 Mar 2001 11:28:05 -0000 From: mwm@mired.org Reply-To: mwm@mired.org To: FreeBSD-gnats-submit@freebsd.org Cc: Subject: [PATCH] There's no general guidance on creating cds. X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 25890 >Category: docs >Synopsis: [PATCH] There's no general guidance on creating cds. >Confidential: no >Severity: serious >Priority: medium >Responsible: dd >State: closed >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Sun Mar 18 03:30:01 PST 2001 >Closed-Date: Sat Apr 21 16:15:01 PDT 2001 >Last-Modified: Sat Apr 21 16:15:15 PDT 2001 >Originator: Mike Meyer >Release: FreeBSD 4.3-BETA i386 >Organization: Meyer Consulting >Environment: System: FreeBSD guru.mired.org 4.3-BETA FreeBSD 4.3-BETA #4: Sun Mar 11 17:47:12 CST 2001 mwm@guru.mired.org:/sharetmp/obj/usr/src/sys/GURU i386 >Description: No single document describes how to create a CD on FreeBSD. >How-To-Repeat: Look for the document, and fail to find it. >Fix: I wrote up a handbook chapter covering this. I'm not sure where it should go, though. Creating CDs Written by mwm@mired.org Introduction When CDs have a number of features that differentiate them from convential disks. Initially, they weren't writable by the user. They are designed so they can be read continuously without delays to move the head between tracks. They are also much easier to transport between system than similar sized media was at the time. CDs do have tracks, but by this they mean a section of data to be read continuously, not a physical property of the disk. To produce a CD on FreeBSD, you prepare the data files that are going to make up the tracks on the CD, then write the tracks to the CD. The ISO 9660 file system was designed to deal with these differences. It unfortunately codifies file system limits that were common then. Fortunately, it provides an extension mechanism that allows properly written CDs to exceed those limits while still working with systems that do not support those extensions. The mkisofs program is used to produce a data file containing an ISO 9660 file system. It has options that support various extensions, and is described below. You can install it with the /usr/ports/sysutils/mkisofs port. The tool to use to burn the CD depend on whether your CD burner is ATAPI or something else. ATAPI CD burners use the burncd program that is part of the base system. SCSI and USB CD burners should use the cdrecord from the /usr/ports/sysutils/cdrecord port. mkisofs mkisofs produces an ISO 9660 file system that is an image of a directory tree in the Unix file system name space. The simplest usage is: &prompt.root; mkisofs imagefile.iso /path/to/tree This command will create a imagefile containing an ISO 9660 file system that is a copy of the tree at /path/to/tree. In the process, it will map the file names to names that fit the limitations of the standard ISO 9660 file system, and will exclude files that have names uncharacteristic of ISO file systems. Read &man.mkisofs.8; for details of this process, and options that can be used to control it. A number of options are available to overcome those restrictions. In particular, will enable the Rock Ridge extensions common to Unix systems, causes Joliet extenions used by MicroSoft systems, and can be used to create HFS file systems used by Macs. Read &mak.mkisofs.8; for more information on the last two. For CD's that are going to be used only on FreeBSD systems, can be used to disable all filename restrictions. When used with , it produced a file system image that is identical to the FreeBSD tree you started from, though it may violate the ISO 9660 standard in a number of ways. The last option of general use is . This is used to specify the location of the boot image in producing a El Torito bootable CD. This option takes an argument, which is the path to a boot image from the top of the tree being written to the CD. So, given that /tmp/myboot holds a bootable FreeBSD system with the boot image in /tmp/myboot/boot/cdboot, you could produce the image of an ISO 9660 file system in /tmp/bootable.iso like so: &prompt.root; mkisofs boot/cdboot /tmp/bootable.iso /tmp/myboot Having done that, if you have vn configured in your kernel, you can mount the file system by doing: &prompt.root; vnconfig vn0c /tmp/bootable.iso &prompt.root; mount cd9660 /dev/vn0c /mnt At which point you can verify that /mnt and /tmp/myboot are identical. There are a large number of other options you can use with mkisofs to fine tune its behavior. See &man.mkisofs.8; for details. burncd If you have an ATAPI CD burner, you can use the burncd command to burn an ISO image onto a CD. burncd is part of the base system, installed as /usr/sbin/burncd. Usage is very simple, as it does not have a lot of options: &prompt.root; burncd cddevice data imagefile.iso fixate Will burn a copy of imagefile.iso on cddevice. The default device is /dev/acd0. See &man.burncd.8; for options like setting the write speed, ejecting the floppy, and writing audio data. cdrecord If you do not have an ATAPI CD burner, you will have to use cdrecord to burn your CDs. cdrecord is not part of the base system; you must install it from either the port at /usr/ports/sysutils/cdrecord or the appropriate package. Changes to the base system can cause binary versions of this program to fail, possibly resulting in a coaster. You should therefore either upgrade the port when you upgrade your system, or if you are tracking -stable, upgrade the port when a new version becomes available. While cdrecord has many options, basic usage is even simpler than burncd. Burning an ISO 9660 image is done by: &prompt.root; cdrecord device imagefile.iso The tricky part of using cdrecord is finding the to use. To find the proper setting, use the flag of cdrecord, which might produce results like this: &prompt.root; cdrecord Cdrecord 1.9 (i386-unknown-freebsd4.2) Copyright (C) 1995-2000 Jörg Schilling Using libscg version 'schily-0.1' scsibus0: 0,0,0 0) 'SEAGATE ' 'ST39236LW ' '0004' Disk 0,1,0 1) 'SEAGATE ' 'ST39173W ' '5958' Disk 0,2,0 2) * 0,3,0 3) 'iomega ' 'jaz 1GB ' 'J.86' Removable Disk 0,4,0 4) 'NEC ' 'CD-ROM DRIVE:466' '1.26' Removable CD-ROM 0,5,0 5) * 0,6,0 6) * 0,7,0 7) * scsibus1: 1,0,0 100) * 1,1,0 101) * 1,2,0 102) * 1,3,0 103) * 1,4,0 104) * 1,5,0 105) 'YAMAHA ' 'CRW4260 ' '1.0q' Removable CD-ROM 1,6,0 106) 'ARTEC ' 'AM12S ' '1.06' Scanner 1,7,0 107) * This lists the approriate value for the devices on the list. Locate your CD burner, and use the three numbers separated by commas as the value for . In this case, the CRW device is 1,5,0, so the appriate option would be =1,5,0. There are easier ways to specify this value; see the &man.cdrecord.1; for details. That is also the place to look for information on writing audio tracks, controlling the speed, and other things. >Release-Note: >Audit-Trail: State-Changed-From-To: open->feedback State-Changed-By: dd State-Changed-When: Wed Apr 18 18:11:00 PDT 2001 State-Changed-Why: This looks very good except for some of the markup. Unless you plan to expand on it quite a bit, I'd rather make this a section of the Disks chapter rather than a chapter on its own; I think it'd fit in better there. Any objections to the above? If not, I'll fix up some of the markup and commit it. Responsible-Changed-From-To: freebsd-doc->dd Responsible-Changed-By: dd Responsible-Changed-When: Wed Apr 18 18:11:00 PDT 2001 Responsible-Changed-Why: I'll take care of this. http://www.freebsd.org/cgi/query-pr.cgi?pr=25890 State-Changed-From-To: feedback->closed State-Changed-By: dd State-Changed-When: Sat Apr 21 16:15:01 PDT 2001 State-Changed-Why: Committed, thanks! http://www.freebsd.org/cgi/query-pr.cgi?pr=25890 >Unformatted: