# Data cd: ########## # Ok I will try to get my weather work burned to the CDRW # # Make data image to be burned: (MYDATA is volume label, J is Joliet) root cdrec> mkisofs -V MYDATA -J -r -o data.iso /var/www/html/weather Where: -V is volume label -J use Joliet iso9660 format -r set all permissions to world readable -o output filename root cdrec> ls data.iso howtopages.txt ########## # check it out: root cdrec> mount -t iso9660 data.iso /mnt/cdrom -o loop,ro root cdrec> ls /mnt/cdrom ani-gifs fronts_2011 nexrads notes.txt anim_images-20110421.html fronts_2011_png nexrads.html x anim_images-listgen fronts_map_caption.txt notes.bak root cdrec> umount /mnt/cdrom ########## # Blank existing CDRW: # First check out what drive number is. # If the disc is automounted by some gnome thingy umount it first: root cdrec> umount /media/CDROM root cdrec> cdrecord -scanbus scsibus6: 6,0,0 600) 'TSSTcorp' 'CDDVDW TS-H653N ' '0208' Removable CD-ROM 6,1,0 601) * 6,2,0 602) * 6,3,0 603) * 6,4,0 604) * 6,5,0 605) * 6,6,0 606) * 6,7,0 607) * # OK , my cdrw is on 6,0,0 ...so I do this: root cdrec> cdrecord dev=6,0,0 speed=4 -v blank=fast # See a buch of info go by... hopefully no problems. # Now do a test record: root cdrec> cdrecord dev=6,0,0 speed=4 fs=16m -v -eject -dummy data.iso # Look Ok? # now go for the burn: cdrecord dev=6,0,0 speed=4 fs=16m -v data.iso # My data.iso was 73 mb which wrote at about 1-1/2 second per mb. # # Some clarification on the parameters: # speed=4 tell what speed to use to prevent trying to burn too fast # fs=16m is the desired fifo buffer size (16mb) # if set too big can cause failure due to lag between reads and writes # -v is verbosity # -eject eject when done # -dummy do a test run ########## # Now let's check it out: root cdrec> mount -t iso9660 /dev/cdrom /mnt/cdrom -o ro root cdrec> ls /mnt/cdrom ani-gifs fronts_2011 nexrads notes.txt anim_images-20110421.html fronts_2011_png nexrads.html x anim_images-listgen fronts_map_caption.txt notes.bak root cdrec> du -sh /mnt/cdrom 72M /mnt/cdrom # And I play the animation file on the cd and it works!!! Firefox: file:///mnt/cdrom/fronts_2011_png/anim_images-20110504.html ########## # Now umount and eject: umount /mnt/cdrom root cdrec> cdrecord dev=6,0,0 -eject WARNING: the deprecated pseudo SCSI syntax found as device specification. Support for that may cease in the future versions of wodim. For now, the device will be mapped to a block device file where possible. Run "wodim --devices" for details. Device type : Removable CD-ROM Version : 5 Response Format: 2 Capabilities : Vendor_info : 'TSSTcorp' Identification : 'CDDVDW TS-H653N ' Revision : '0208' Device seems to be: Generic mmc2 DVD-R/DVD-RW. Using generic SCSI-3/mmc CD-R/CD-RW driver (mmc_cdr). Driver flags : MMC-3 SWABAUDIO BURNFREE Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R ===================================================================== Copying a disk: (from ibm howto) To directly copy from the source disk to the recordable disk, use this command: $ cdrecord -v dev=0,1,0 speed=4 -isosize /dev/scd0 This command directly streams the contents of the CD-ROM, /dev/scd0, to the CD recorder, dev=0,1,0. Don't do this on an old, slow machine. Direct copying is fast, but more error-prone. It is better to first copy the source disk to a hard drive, then copy from the hard drive to the CD recorder: $ mount /cdrom $ dd if=/dev/scd0 of=/tmp/diskfile.iso $ cdrecord dev=0,1,0 speed=8 fs=8m -v -eject -dummy /tmp/diskfile.iso ===================================================================== Trying to do multisession # Get the location of the end of the previous burn: root cdrec> cdrecord dev=6,0,0 -msinfo # That does not work with burn method above as the disk is "fixated" by default # so I need to blank that disk: cdrecord dev=6,0,0 speed=4 -v blank=fast # ...and start another burn with the -multi parameter: root cdrec> cdrecord dev=6,0,0 speed=12 fs=16m -v -multi -eject fronts_20110512.iso # Ok , that disk now will open in the file browser and I can use files on it. # So now we can get the address for next burn: root cdrec> cdrecord dev=6,0,0 -msinfo 0,32619 # hmmm ok so I made another image with this line: root cdrec> mkisofs -V CSPROGS -J -r -o csprogs.iso -C 0,32619 -M 6,0,0 ../csprogs # I needed to have the cd in for some reason and ths command accessed it for something, even though I had the address info there and all... # a ls shows I ow have a new image: root cdrec> ls -l -rw-r--r--. 1 root root 2328576 May 13 08:50 csprogs.iso -rw-rw-r--. 1 hlenderk hlenderk 43452416 May 13 00:20 fronts_20110512.iso # So now I guess burn that to the cd? root cdrec> cdrecord dev=6,0,0 speed=12 fs=16m -v -multi -eject csprogs.iso # I'll be damn, it worked. # But I notice that everything is lumped together. # That is , the 2 sessions are not in seperate directories, all together, # images and c# programs,,, kinda confusing... # ...ANDe Volume label is now CSPROGS! # So I guess I need to figure out how to mkiso into a directory? # or is there a way to tell it to retain the directory it was given # (which is what I would ha e expected it to do in the first place) # Well I have some success with this method using symbolic links: # # Create a project directory and put symlinks to targeted directories in it: #eg: mkdir proj cd proj ln -s /home/hlenderk/csprogs csprogs ln -s /home/hlenderk/javascript javascript ln -s /home/hlenderk/walt walt cd .. ls -go proj lrwxrwxrwx. 1 22 May 14 08:41 csprogs -> /home/hlenderk/csprogs lrwxrwxrwx. 1 25 May 14 08:41 javascript -> /home/hlenderk/javascript lrwxrwxrwx. 1 19 May 14 08:42 walt -> /home/hlenderk/walt # Ok and now add the -f parameter to follow symlinks in the mkisofs line: mkisofs -V 20110514_misc -J -r -f -o 20110514_misc_backup.iso proj # check it out: su ls -go 20110514_misc_backup.iso -rw-rw-r--. 1 2160640 May 14 09:31 20110514_misc_backup.iso mount -t iso9660 20110514_misc_backup.iso /mnt/cdrom -o loop,ro ls -go /mnt/cdrom dr-xr-xr-x. 10 10240 May 14 08:40 csprogs dr-xr-xr-x. 2 4096 Feb 26 00:11 javascript dr-xr-xr-x. 2 2048 May 14 08:57 walt # And it navigates as the originals! # So now do an open burn: cdrecord dev=6,0,0 speed=12 fs=16m -v -multi -eject 20110514_misc_backup.iso # Hey the disk ejects, I reinsert and there are the 3 dirs: ls -go /media/ dr-xr-xr-x. 5 2048 May 14 08:42 20110514_misc ls -go /media/20110514_misc dr-xr-xr-x. 10 10240 May 14 08:40 csprogs dr-xr-xr-x. 2 4096 Feb 26 00:11 javascript dr-xr-xr-x. 2 2048 May 14 08:57 walt # hmm, I notice that the space used on the cd is smaller than the originals: du -s /media/20110514_misc/csprogs /media/20110514_misc/javascript /media/20110514_misc/walt 1553 /media/20110514_misc/csprogs 30 /media/20110514_misc/javascript 5 /media/20110514_misc/walt du -s /home/hlenderk/csprogs /home/hlenderk/javascript /home/hlenderk/walt 1824 /home/hlenderk/csprogs 88 /home/hlenderk/javascript 8 /home/hlenderk/walt x=$((1553 + 30 + 5)) y=$((1824 + 88 + 8)); echo "$y - $x = $(($y-$x))" 1920 - 1588 = 332 # So I suppose that mkisofs packs files to some extent?. # now I add a fronts to that cd ~/cdrec> ls 20110514_misc_backup.iso cdrecord_myhowto.txt howtopages.txt proj ~/cdrec> mkdir proj2 ~/cdrec> cd proj2 ~/cdrec/proj2> ln -s /var/www/html/weather/fronts_2011_png fnt_201105150735 ~/cdrec/proj2> ls -go total 0 lrwxrwxrwx. 1 37 May 15 08:28 fnt_201105150735 -> /var/www/html/weather/fronts_2011_png root cdrec> cdrecord dev=6,0,0 -msinfo 0,12457 root cdrec> mkisofs -V MISC2 -J -r -f -o fronts_2011-0515-0735.iso -C 0,12457 -M 6,0,0 proj2 # I can not successfully mount this on /mnt/cdrom, # I think because of -C 0,12457 # but I can burn it: root cdrec> cdrecord dev=6,0,0 speed=12 fs=16m -v -multi -eject fronts_2011-0515-0735.iso # and now there is a new directory on the cd! And the animation runs fine! ##################################################################### # Burn some images. # So I put the camera card in the usb card reader and cancel the the pop-up # gui picture manager crappy thing. # In xterm I navigate to a suitable directory to copt to and find the card ~> cd ~/Pictures/2011/ ~/Pictures/2011/> mkdir 2011-05-01 ~/Pictures/2011/> ls /media/Kodak/DCIM/100KC160 ~/Pictures/2011/> mv /media/Kodak/DCIM/100KC160/* 2011-05-01 ~/Pictures/2011/> ls 2011-04-01 2011-05-01 ~/Pictures/2011> du -sh 78M . # Ok there is an annoying thing to fix. the dos files have .JPG instead of .jpg # So here is a one liner to change the names: ~/Pictures/2011> cd 2011-05-01 ~/Pictures/2011/2011-05-01> for ea in *.JPG; do s1=${ea/JPG/jpg}; $(mv $ea $s1); echo "$ea $s1"; done; 100_0614.JPG 100_0614.jpg ... ~/Pictures/2011/2011-05-01> ls 100_0614.jpg # Ok so now to make the image ~/Pictures/2011/2011-05-01> cd ~/Pictures ~/Pictures> mkisofs -V IMG_2011 -J -r -o 201105152311.iso 2011 root Pictures> mount -t iso9660 201105152311.iso /mnt/cdrom -o loop,ro root Pictures> ls /mnt/cdrom 2011-04-01 2011-05-01 root Pictures> umount /mnt/cdrom # Ok it looks good so # I'll burn this as multi because I could add more to the cdr at a later date. cdrecord dev=6,0,0 speed=12 fs=16m -v -multi -eject 201105152311.iso # success! Runs on xp machine fine! # ok back later... Howard References: http://howto-pages.org/cdwriting.php (which is saved here in .txt form) http://www.ibm.com/developerworks/linux/library/l-cdburn/index.html (where I learned about -multi) http://www.cdrfaq.org/faq.html