Question about ISO filesystems and CD-R's

Ian Smith smithi at nimnet.asn.au
Tue Nov 2 05:39:08 PST 2004


On Tue, 2 Nov 2004 freebsd-questions-request at freebsd.org wrote:

 > Message: 18
 > Date: Mon, 1 Nov 2004 18:43:02 -0800
 > From: "Michael C. Shultz" <ringworm at inbox.lv>

 > On Monday 01 November 2004 06:29 pm, Jonathon McKitrick wrote:
 > > Question: If I have an iso image smaller than the CD-R I am burning
 > > it to, what happens to that extra space? Is it useless?  Can I burn
 > > another iso fs to it later, overwriting the first?
 > >
 > > jm
 > 
 > The extra space on a CD-R is useless once burned, to burn another iso 
 > over the first you need a CD-RW.

Well yes, you'll need a CD-RW to overwrite the first (after erasure),
but you can keep on adding further ISO images to a CD-R (or CD-RW) until
it's full, using mkisofs + burncd at least.  Very handy here for certain
types of backups, especially on a remote box visited weekly.

My cdappend script's full of paranoid parameter and error checking and
such, but is based on this simple and likely more illustrative one: 

#!/bin/sh
# original googled at http://www.opennet.ru/base/sys/cd_session.txt.html
# indecipherable Russian (including author's name) except for:
if [ "$1" = "-n" ]; then
    echo -- New disk --
    mkisofs -J -jcharset koi8-r $2 | burncd -m data - fixate
else
    echo -- Add session --
    msinfo=`burncd msinfo 2>&1 | sed "s/ //g"`
    sleep 3
    mkisofs -M /dev/acd0c -C $msinfo -J -jcharset koi8-r -o tmp.iso $1
    burncd -m data tmp.iso fixate
    rm tmp.iso
fi

It probably depends on the burner, but I found I had to add the below to
reliably reset the device after burning on a 4.8-RELEASE system.  YMMV.

  echo -n "CD "   # eject / inject needed _after_ session (or reset?)
  cdcontrol -f $dev eject; echo -n "ejected .. "
  cdcontrol -f $dev close; echo "closed"
  sleep 10        # 5 secs not enough to spin up ready for 'info'
  cdcontrol -f $dev info

Cheers, Ian



More information about the freebsd-questions mailing list