[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CDfs v0.4 <http://www.elis.rug.ac.be/~ronsse/cdfs/>



 
    

 
Title: CDfs v0.4

CDfs logo

  • What?

  • CDfs is a file system for Linux systems that `exports' all tracks and boot images on a CD as normal files. These files can then be mounted (e.g. for ISO and boot images), copied, played (audio and VideoCD tracks)... The primary goal for developing this file system was to `unlock' information
    in old ISO images. For instance, if you have a multisession CD with two ISO images that both contain the file 'a', you only see the file 'a' in the second session if you use the iso9660 file system:

    [root@k6 /root]# mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom

    [root@k6 /root]# ls -l /mnt/cdrom
    total 2
    -r-xr-xr-x 1 root root 2 Aug 8 19:16 a
    -r-xr-xr-x 1 root root 2 Aug 8 19:19 b

    If you mount the CD with the cdfs file system, you get the two sessions as files:

    [root@k6 /root]# mount -t cdfs -o ro /dev/cdrom /mnt/cdfs

    [root@k6 /root]# ls -l /mnt/cdfs
    total 33389
    -r--r--r-- 1 ronsse ronsse 33503232 Aug 8 19:36 sessions_1-1.iso
    -r--r--r-- 1 ronsse ronsse 34121728 Aug 8 1999 sessions_1-2.iso

    These files can then be mounted loop back:

    [root@k6 /root]# mount -t iso9660 -o loop /cdfs/sessions_1-1.iso /mnt/loop1

    [root@k6 /root]# mount -t iso9660 -o loop /cdfs/sessions_1-2.iso /mnt/loop2

    and the file a can be accessed in both sessions

    [root@k6 /root]# ls -l /mnt/loop1
    total 9889
    -r-xr-xr-x 1 root root 10104236 Aug 8 17:34 a

    [root@k6 /root]# ls -l /mnt/loop2
    total 2
    -r-xr-xr-x 1 root root 2 Aug 8 19:16 a
    -r-xr-xr-x 1 root root 2 Aug 8 19:19 b

    The file system also allows you to access data on faulty multi session disks, e.g. disk with multiple single sessions instead of a multi session (for instance created with mkisofs without the proper -C parameters).

  • Limitations

  • Red Book (audio), Yellow Book Mode 1 (data) , Green/White Book Mode 2 / XA Form 1 and Green/White Book Mode 2 / XA Form 2 (data) tracks are exported. Other types will be added in the future. Data tracks are checked for ISO, HFS and boot images. If none of these are found, the data track is exported as `unknown`. This version only exports the first HFS and boot image (anybody seen a CD with more than 1 HFS or boot image?).
  • Download, compile & install

  • The file system can be downloaded from here, compiled using make and installed using insmod cdfs.o. See the file INSTALL for more information.
  • Usage

  • Mount a CD with something like

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

    Check /proc/cdfs for information about the tracks. The exported files can be found under /mnt/cdfs and will have one of these names:

    • sessions1_?.iso: an ISO session. ISO sessions are exported in groups, e.g. if you have a disk with four images, you get

    • [root@k6 /root]# mount -t cdfs -o ro /dev/cdrom /mnt/cdfs

      [root@k6 /root]# ls -l /mnt/cdfs
      total 0
      -r--r--r-- 1 ronsse ronsse 362471424 Mar 10 21:39 sessions_1-1.iso
      -r--r--r-- 1 ronsse ronsse 518234112 Apr 10 01:11 sessions_1-2.iso
      -r--r--r-- 1 ronsse ronsse 638572544 Jun 19 22:33 sessions_1-3.iso
      -r--r--r-- 1 ronsse ronsse 680714240 Jul 21 01:35 sessions_1-4.iso

      The first file contains the first session, the second file contains sessions 1 & 2, the 3 contains sessions 1, 2 & 3 and the last file contains all the sessions. You can mount all the files/sessions at the same time:

      [root@k6 /root]# mount -o loop /cdfs/sessions_1-1.iso /mnt/loop1
      [root@k6 /root]# mount -o loop /cdfs/sessions_1-2.iso /mnt/loop2
      [root@k6 /root]# mount -o loop /cdfs/sessions_1-3.iso /mnt/loop3
      [root@k6 /root]# mount -o loop /cdfs/sessions_1-4.iso /mnt/loop4

    • session-?.iso: a single session ISO image. Use the 'single' option when mounting to access all sessions on a CD as single session images, e.g.:

    • [root@k6 /root]# mount -t cdfs -o ro,single /dev/cdrom /mnt/cdfs

    • boot.image: a boot image. Use the file command to check the file system on the boot disk and mount it loop back. E.g. (WIN98):

    • [root@k6 /root]# mount -t cdfs -o ro /dev/cdrom /mnt/cdfs

      [root@k6 /root]# ls -l /mnt/cdfs
      total 0
      -r--r--r-- 1 ronsse ronsse 1474560 Jan 1 1970 boot.image
      -r--r--r-- 1 ronsse ronsse 654815232 Nov 24 1998 sessions_1-1.iso

      [root@k6 /root]# file /mnt/cdfs/boot.image
      /mnt/cdfs/boot.image: x86 boot sector, system )+3EjIHC, FAT (12 bit) unlabeled, 2880 sectors

      [root@k6 /root]# mount -t vfat -o loop /mnt/cdfs/boot.image /mnt/loop1

      [root@k6 /root]# head /mnt/loop1/autoexec.bat
      @ECHO OFF
      set EXPAND=YES
      SET DIRCMD=/O:N
      cls
      set temp=c:\
      set tmp=c:\
      path=a:\

      IF "%config%"=="NOCD" GOTO QUIT
      LH MSCDEX.EXE /D:oemcd001 /L:D

    • apple.hfs: an Apple Hierarchical File System. You can mount it loop back with the hfs file system. Example: a CD with one data track containing both an ISO and a HFS file system:

    • [root@k6 /root]# mount -t cdfs -o ro /dev/cdrom /mnt/cdfs

      [root@k6 /root]# ls -al /mnt/cdfs
      total 15666
      dr-xr-xr-x 2 ronsse ronsse 1234 Aug 14 18:46 .
      drwxr-xr-x 12 root root 1024 Jul 24 22:56 ..
      -r--r--r-- 1 ronsse ronsse 16008192 Jan 1 1970 apple.hfs
      -r--r--r-- 1 ronsse ronsse 61360128 Apr 17 06:18 sessions_1-1.iso

      [root@k6 /root]# mount -t iso9660 -o loop,ro /mnt/cdfs/sessions_1-1.iso /mnt/loop1

      [root@k6 /root]# mount -t hfs -o loop,ro /mnt/cdfs/apple.hfs /mnt/loop2

      [root@k6 /root]# ls -a /mnt/loop1
      . .. autorun.inf files jpg1024 jpg1152 jpg1280 jpg640 jpg800 setup.exe

      [root@k6 /root]# ls -a /mnt/loop2
      . .. .finderinfo .resource .rootinfo AppleShare PDS Desktop DB Desktop DF M&T ScreenSaver M&T ScreenSaver Data OpenFolderListDF:0d Trash

    • videocd-?.mpeg: a VideoCD track. Use your favourite player to view the contents (mtv[p], plaympeg, gtv, ZZplayer).

    • track-?.wav: an audio file. The file starts with a WAV-header and can be copied or played (by copying it to the audio device) , e.g.

    • [root@k6 /root]# mount -t cdfs -o ro /dev/cdrom /mnt/cdfs

      [root@k6 /]# ls -l /mnt/cdfs
      total 0
      -r--r--r-- 1 ronsse ronsse 42973392 Aug 8 18:01 track-1.wav
      -r--r--r-- 1 ronsse ronsse 65164512 Aug 8 18:01 track-2.wav
      -r--r--r-- 1 ronsse ronsse 71743056 Aug 8 18:01 track-3.wav
      -r--r--r-- 1 ronsse ronsse 66940272 Aug 8 18:01 track-4.wav

      [root@k6 /]# sox /mnt/cdfs/track-1.wav -t ossdsp /dev/dsp

      Note that audio tracks are `exported' by cdfs because they are on the CD. However, cdfs will make no attempt to correct reading errors while reading from scratched disks, to solve misalignment, frame jitter, loss of streaming, etc. You should use cdparanoia or cdda2wav if you encounter these problems.

  • Related work:
    • for audio tracks only:
    • for VideoCD only:
      • vcdfs, xreadvcd and vcdread for Linux
  • History
    • For kernel 2.2.X:
      • v0.1 (08/21/99): Original Release.
      • v0.2 (10/24/99): Added support for detecting the type of boot image.
      • v0.2b (11/05/99): Solved problem with versioned symbols (thanks to Bodo Bellut).
      • v0.3 (01/06/00): Audio cache is now dynamically allocated. Removed 1/75 seconds of silence from the start of each audio track. Better memory management. Detects more boot images. Changed numbering of audio tracks.
      • v0.3b (01/11/00): Solved problems with systems with multiple CD drives (cache problems).
      • v0.3c (01/17/00): Several bugfixes.
    • For kernel 2.4.X:
      • v0.4 (07/27/00) for 2.4.X: Added a kernel thread 'kcdfsd' for asynchronuous I/O and support for VideoCD (thanks to Chih-Chung Chang). Karaoke CDs should also work. Uses address_space_operations for all block sizes. Simplified root.c. Support for bigendian CPUs.
    • Author

    • Michiel Ronsse

    10/24/99
Google