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