Mast Kalandar

bandar's colander of random jamun aur aam

Mon, 23 Jan 2006

< Some comments on the FOSS Initiative by PSA. | · | A collaborative framework for academic work >

Using CD's in read/write mode (like floppies)


debian, floss, howto [link] [comments ()] [raw]
Aim:

To take a CD/RW media and use it as one would formerly have used a floppy (except that writing can only be done by a CDwriting device of course).

Pre-supposes:

Debian sarge or later with 2.6.x kernel and udftools installed.

Quickstart:

Read the second section (B) below.

The Long of it

  1. There is a way in which optical disks can be written in "packets" which can have variable lengths. This method, called Mt. Rainier and invented by Philips, is supported natively in Linux by a module written by Jens Axboe called "pktcdvd".

  2. There is a file system called "UDF" which was created as an ISO standard format in which data can be stored on optical media and is used by most DVD's. The UDF file system is supported by Linux by a module called "udf" which is currently maintained by Ben Fennema. (Was it written by him too?)

  3. The udftools contains tools (what else!) that setup a drive and a disk for using Mt. Rainier and UDF in conjunction.

The Short of it

So what does all this mean for us?

A. If you just want to read a UDF formatted CD/DVD, you put it in the drive and go

mount -t udf -o ro /dev/cdrom /mnt

(mutatis mutandi) and you can read the data. There may be a slight complication about "closure" (see below) for disks written on other drives.

B. If you want to use a CDRW (CDR may work I haven't tried it) as a "large" floppy, then you run as root (if you have installed "pktsetup")

modprobe pktcdvd
pktsetup /dev/pktcdvd/0 /dev/cdrom

(Note that udftools comes with a start script which does this providing you edit /etc/default/udftools appropriately).

You then "format" your media with the command

cdrwtool -d /dev/cdrom -q

This takes a while so you may want to have that cuppa-cha now.

Now this is ready for use. Whenever you need to read/write from this "floppy" you go

mount -t udf /dev/pktcdvd/0 /mnt

You can then read/write files from/to /mnt.

Of course, like a floppy you need to remember to (sync;umount /mnt) before removing the CD from the drive.

C. On the same drive as the one you used to do (B) you should be able to manage (A) with your CD but if you want to make your UDF written CD truly "universal" you may need to run:

cdrwtool -d /dev/cdrom -c

This will "close" the track ("fixate" the media). But you will not be able to write to the same track any more without blanking the disk. I haven't needed to use this but I have only checked things on a couple of machines.


Archives

< January 2006 >
SuMoTuWeThFrSa
1 2 3 4 5 6 7
8 91011121314
15161718192021
22232425262728
293031    

2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001, 2000, 1999, 1997, 1995,