Imported Upstream version 1.1.11
[platform/upstream/cdrkit.git] / doc / genisoimage / README.graft_dirs
1 This is from "Eduardo M. A. M. Mendes" <mendes@mgconecta.com.br>
2
3 Creating multi-session CD's with dir=/ feature Micro Howto
4
5 This mini-howto was written as guide to help me to create multi-session CD's
6 with the possibility of determining the location of files. I hope
7 that this guide helps you too.
8
9 In order to use wodim it is first necessary to define to which scsi bus
10 the cd-writer is connected. In my case the setup is dev=0,3,0. It is also
11 interesting to have a separate directory in which all image files can
12 be dumped: /home/cdsource is the directory I chose for dumping the images.
13
14 The best way to understand how to create multi-session cds is to read
15 README.multi. Most of what is going to be said here is based on that
16 README file and on the help of several wodim users. 
17
18 This Micro Howto is divided into two parts as follows:
19
20 Example a) A dir/=/dir1/dir2 example
21
22 Example b) A dir1/dir2/=/dir3/dir4 and dir1/dir2a=/dir5/dir6 example
23
24
25 We are now ready to start.
26
27 Example a) An dir/=/dir1/dir2 example
28
29 A simple example will demonstrate that we can create multi-session cds 
30 with the dir_feature of the type dir/=/dir1/dir2
31
32 Objetive: Saving root directories of Redhat 6.1 and Col 2.3 on a single CD.
33
34 Observation: Redhat installation is mounted on COL 2.3 at /mnt/redhat
35
36 First image - RedHat 6.1 - /mnt/redhat/root
37
38 genisoimage -D -l -r -f -m core -L -o image1.raw redhat/=/mnt/redhat/root
39
40 This will create a redhat directory on the cd. The option -D should be
41 used with care. The other options used in the above command are just 
42 to demonstrate the use of genisoimage.  Please
43 refer to man genisoimage if you want to know more.
44
45
46 To see if the image is created as expected, we need to mount image1.raw using
47 the option -o loop (Linux only! for information on Solaris read README.verify)
48 as follows:
49
50 mount -t iso9660 image1.raw /mnt/image -o loop
51
52 To see the contents type:
53
54 ls -l /mnt/image/redhat
55
56 Does it look ok?  Great! Unmount /mnt/image. Now the burning process itself:
57
58 wodim -v -dev=0,3,0 -multi -eject image1.raw 
59
60 To check the burned image we need to mount the cd; something like
61
62 mount -t iso9660 /dev/scd0 /mnt/cdroms
63
64 /mnt/cdroms is the device file for the cdrom I use.
65
66
67 Second image - Caldera 2.3 - /root
68
69
70 To create the second image on our cd, we need get information
71 about sectors related to the first track. To do that, issue the command
72
73 wodim -v -dev=0,3,0 -msinfo 
74
75 wodim returns the following number
76
77 0,135563
78
79 This number is the format XX,YY discussed on README.multi.  XX would be used
80 for testing the images as well as burning the new track.
81
82 genisoimage -D -l -r -f -m core -L -C 0,135563 -M /dev/scd0 -o image2.raw  caldera/=/root
83
84 Now we need to check of image2.raw is ok. The following command creates exactly what we 
85 need.  Plese note that -C option. Only the first number changes in this case. The second one
86 is always zero.  In our case the first number is zero due to wodim -msinfo.  When 
87 more tracks are added to the cd this number will change.
88
89 genisoimage -D -l -r -f -m core -L -C 0,0 -M /dev/scd0 -o image2_test.raw  caldera/=/root
90
91 mount -t iso9660 image2_test.raw /mnt/image -o loop
92
93 ls -l /mnt/image shows that there are two directories: redhat and caldera, just the way
94 we wanted.
95
96 Now let us burn image2.raw (not image2_test.raw)
97
98 wodim -v -dev=0,3,0 -multi -eject image2.raw
99
100 We can mount the CD again to see that the two directories are there.  We can carry on
101 doing this until we decide to close the CD. If this is the case, don't use -multi when
102 burning the last session.
103
104 b) A dir1/dir2/=/dir3/dir4 and dir1/dir2a=/dir5/dir6 example
105
106 The above example seems a bit silly, one could argue. Why did I create a single directory
107 called root and within two sub-directories: redhat and caldera?  
108
109 Using the procedure described above we would do as follows:
110
111 genisoimage -D -l -r -f -m core -L -o image1.raw etc/redhat/=/mnt/redhat/etc
112
113 wodim -v -dev=0,3,0 -multi -eject image1.raw 
114
115 To check the burned image we need to mount the cd; something like
116
117 mount -t iso9660 /dev/scd0 /mnt/cdroms
118
119 wodim -v -dev0,3,0 -msinfo 
120
121 wodim returns the following number
122
123 0,14391
124
125 The second image can be created using
126
127 genisoimage -l -r -f -m core -L -C 0,14391 -M /dev/scd0 -o image2.raw  etc/caldera/=/etc  
128
129 Creating a test image2
130
131 genisoimage -l -r -f -m core -L -C 0,0 -M /dev/scd0 -o image2_test.raw etc/caldera/=/etc 
132
133 mount -t iso9660 image2_test.raw /mnt/image1 -o loop
134
135 It works!!   That is great!!!
136
137 Now the burning process itself.
138
139 wodim -v -dev=0,3,0 -multi -eject image2.raw
140
141 and we're done !!!!
142
143 To add more tracks just do as indicated above.
144
145 Good luxk!!!
146
147 Eduardo Mendes - 11/23/99
148
149 Source: README.graft_dirs from cdrtools package
150 Edited for cdrkit by Christian Fromme <kaner@strace.org> and Eduard Bloch
151