Imported Upstream version 1.1.11
[platform/upstream/cdrkit.git] / doc / READMEs / README.multi
1 Creating multi-session CDs/DVDs Mini Howto FAQ
2
3 Multi-session filesystems are a trick that comes from the Kodak photo CD.
4 The OS mounts the last session that contains the sum of the current session
5 and all previous sessions.
6
7 To test (with Linux):
8
9  - create a iso-9660 filesystem image with genisoimage.
10  - genisoimage is included in the cdrkit release.
11  - use the -R flag to add Rock Ridge extensions (this is important).
12
13 Assuming that the CD-R drive is connected to target 2 on the SCSI bus.
14
15 Write the first session with:
16
17 wodim -v speed=2 dev=2,0 -eject -multi isoimage.raw
18
19 Note that all Sony drives do no support XA2 disks in firmware - read README.sony
20 for more information.
21
22 This must be a iso9660 image with Rock Ridge extensions (see above)
23
24 Note the number of sectors written and check the disk, it should be mountable.
25
26 Next step is to check if wodim is able to retrieve the following data:
27
28         1) The first block (sector) number in the first track of the last session
29            This must be '0' in our case.
30
31         2) The next writable address in the unwritten session following the current.
32            This should be the number of sectors written in the first
33            run + ~ 11400 sectors for about 22MB lead out/in
34
35            For the first additional session this is 11250 sectors lead-out/lead-in
36            overhead + 150 sectors for the pre-gap of the first track after the
37            lead-in = 11400 sectors.
38
39            For all further session this is 6750 sectors lead-out/lead-in
40            overhead + 150 sectors for the pre-gap of the first track after the
41            lead-in = 6900 sectors.
42
43 To get this information type:
44
45 wodim -msinfo dev=2,0
46
47 The output should be two numbers separated by a comma.
48
49         e.g.: 0,204562
50
51 The first number is (1), the second number is (2).
52
53 2nd session:
54 You should create a directory that contains a second directory with data in it
55 for this purpose.
56
57         e.g.:
58                 first_dir/
59                         second_dir/
60                                 file_1
61                                 file_2
62                                 ...
63
64 call:
65
66 On Linux:
67 genisoimage -o isoimage_2.raw -R  -C xx,yy -M /dev/cdwriter_blk_dev  first_dir
68
69 On SunOS:
70 genisoimage -o isoimage_2.raw -R  -C xx,yy -M target,lun first_dir
71
72 Note that the name "first_dir" is not important.
73
74 If you still keep the old raw image of the first session and there is only
75 one previous session on the CD you may also call:
76
77 genisoimage -o isoimage_2.raw -R  -C xx,yy -M isoimage.raw first_dir
78
79
80 The argument of -C is the output of wodim -msinfo
81 -       On Linux, the argument of -M is a device that would allow you to mount 
82         the current CD in the CD-writer
83 -       On SunOS, target and lun refer to the SCSI target and lun of the 
84         CD-R device with the same notation as for wodim dev=xxx,yyy .
85
86 Note that you can also use the -msifile=... option of wodim to store this data
87 in a reliable way. This is usefull for scripting.
88
89 If you want to check, whether genisoimage make everything right, you should create 
90 another image by using the following command line.
91
92 On Linux:
93 genisoimage -o isoimage_2.raw -R  -C xx,0 -M /dev/cdwriter_blk_dev  first_dir
94
95 On SunOS:
96 genisoimage -o isoimage_2.raw -R  -C xx,0 -M target,lun first_dir
97
98 Where xx is the first number of the pair returned by wodim -msinfo
99
100 You may check ***this** image by mounting it with my "fbk" on Solaris 
101 or the loopback driver on Linux.
102
103 On Linux type:
104         mount isoimage_2.raw -r -t iso9660 -o loop /mnt
105
106 On SunOS type:
107         mount -r -F fbk -o type=hsfs /dev/fbk0:isoimage_3.raw /mnt
108
109 For Solaris 8 and later you may also use the Sun lofi driver (see README.sun-lofi)
110
111 If you list /mnt, you should see all directories that have been in the first 
112 session and the directory "second_dir". If you try to read a file from the
113 first session, you will get an I/O error or bad data (depending on the
114 block address), don't worry about that. If you try to read a file from
115 the second session, you will see everything correctly.
116
117 To write the second session to CD, call:
118
119 wodim -v speed=2 dev=2,0 -eject -multi isoimage_2.raw
120
121 If you mount this CD, you should see the first session and the second directory 
122 from 2nd session added to the root directory of the CD.
123
124
125 Additional check:
126
127 call:
128
129 wodim -msinfo dev=2,0
130
131 The first number should be the first writable address which was retrieved by the
132 first call to wodim -msinfo after creating the first session.
133 The second number should be the first number + number of sectors of the second session
134 + ~ 11400 sectors.
135
136 Note: The first lead-out is 1:30 (6750 sectors) the lead-in is 1:00 (4500 sectors)
137 All following sessions need only 0:30 for lead-out (2250 sectors), the lead-in
138 is also 1:00. So in theory, the can be 44 sessions on s 74 minute disk if you
139 take into account that the minimum track size is 4 seconds.
140
141 The total amount of the overhead is 11250 + 150 sectors for the first additional
142 session and 6750 + 150 sectors for all subsequent sessions.
143 The 150 additional sectors are the pre-gap sectors for the first track after
144 the current session.
145
146 Some notes on multi-session CD's that contain only Joliet but no Rock Ridge:
147
148 Joliet is a really bad idea in general:
149
150 -       There is no way to find a relation between a ISO-9660 name and a Joliet
151         name. If the file has a size, you may try to match the starting sector #
152         but if the size in 0 it's impossible.
153
154
155 -       Joliet does not allow long filenames (it limits names to 64 chars).
156
157 -       Joliet does not allow all (usually used) characters in filenames.
158          
159         All code points between (00)(00) and (00)(1F), inclusive. (Control Characters)
160                 (00)(2A) '*'(Asterisk)
161                 (00)(2F) '/' (Forward Slash)
162                 (00)(3A) ':' (Colon)
163                 (00)(3B) ';' (Semicolon)
164                 (00)(3F) '?' (Question Mark)
165                 (00)(5C) '\' (Backslash) 
166
167         While '/' is not a real problem ;-) other characters may cause trouble.
168  
169 All notes above prevent you from doing reliable multi-session if the CD does
170 only contain Joliet but des not contain Rock Ridge attributes.
171
172 In addition, please read README.joliet in the genisoimage directory.
173
174 This is the answer to a commonly asked question is why can't I continue a
175 multisession CD that has been started on a Microsoft system using genisoimage. 
176
177
178 Note: It is not possible to create a multi-session HFS CD. If you create
179 a multi-session CD using any of the HFS options, then each new HFS
180 session will ignore HFS files from any previous sessions. A warning will
181 be printed if you attempt this. However, if you use the '-part' option to
182 genisoimage for each session you create, then each session will appear as 
183 separate volumes when mounted on a Mac. In this case, it is worth using the 
184 '-V' or '-hfs-volid' option to give each session a unique volume name,
185 otherwise each "volume" will appear on the Desktop with the same name.
186
187
188 Joerg Schilling
189
190 Edited for cdrkit by Christian Fromme <kaner@strace.org> and Eduard Bloch
191
192
193 This describes the programs as shipped with cdrkit, a spinoff from the
194 cdrtools project. However, the cdrtools developers are no longer
195 involved in the development of this spinoff and therefore shall not
196 be made responsible for any problem caused by it. Do not try to get
197 support for this program by contacting the original authors.
198
199 If you have support questions, send them to
200
201 debburn-devel@lists.alioth.debian.org
202
203 If you have definitely found a bug, send a mail to this list or to
204
205 submit@bugs.debian.org
206
207 writing at least a short description into the Subject and "Package: cdrkit" 
208
209