using cd rw drive

Dan Strick strick at covad.net
Wed Jan 21 04:05:52 PST 2004


There is a third reason why you can't treat a CD-RW just like
a hard disk drive:

3) A CD has 2048 byte data sectors.  FreeBSD hard disk drivers expect 512
   byte sectors.  The CD driver might have to be modified to fake the hard
   disk sector size.

   Even if the UFS fragment size is a multiple of 2048 bytes the OS might
   attempt 512 byte transfers to access disk labels.  I am not sure the CD
   driver will look for disk labels or support all the special ioctls used
   by the disklabel program.  Since the CD driver fakes a trivial partition
   table, you should not have to use the disklabel program anyway.  If the
   newfs program and the OS do not do gratuitous sub-fragment transfers,
   setting the fragment size to 2048 bytes might finesse the sector size
   problem.

Even if it works, UFS is probably not normally the best file system for
CD-RW.  The long seek times discourage random access and favor contiguous
files.  (However, I do see a small environmental niche for UFS on CD.)

Given all these nagging little software issues, we may be stuck with
mkisofs/burncd/cdrecord for the near future even with CD-RW.

Dan Strick
strick at covad.net


More information about the freebsd-questions mailing list