[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).
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:
[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
[root@k6 /root]# mount -t cdfs -o ro,single
/dev/cdrom /mnt/cdfs
[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
[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
[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.