How to copy directory tree to cd rom using command line?
I want to copy an entire directory tree (text files an pdf's) from my laptop harddrive to a cdrom. I want to be able to use the resulting disc on either Linux or Windows machines.
I don't want to use tar, or any backup software which creates a single image of all the files. Do I need to first use something like mkisofs, then cdrecord? Or can I just use wodim? I tried using wodim without success, I guess I'm confused about the details... My cdrom is located at /dev/sg1 I'm using Debian. Thanks, Keith |
If it fits on a cd, use growisofs. The man page has examples.
To check if it fits, use Quote:
|
you can use mkisofs and then use cdrecord to write a cd you can also use growisofs in this form :
by using grow isofs you dont need to make iso befor writing to cd. Code:
# growisofs -speed=4 -z /dev/cdrom -J -r -v "cdname" ./ |
Thanks guys. The growisofs man page is pretty terse.
I tried: growisofs -speed=4 -Z /dev/sg1 -R -J -v -dry-run ./* and that seemed to be OK, but when I ran it without the -dry-run it gives me this error: Code:
:-( write failed: Illegal seek Ideas? wodim reports: Code:
$ wodim --devices keith |
BTW- when I tried to apt-get mkisofs I get this message:
Code:
Package mkisofs is not available, but is referred to by another package. I guess I need a basic _recent_ tutorial on how to do this. All the web pages I have read confuse me with discussion of iso files, images, DVD's, past versions of software, etc. Keith |
Growisofs isn't exactly to be used against a CD-ROM. It might work if the CD format is not "finished" (an end marker record is written). You can't overwrite a CD that way very well.
Usually I've seen it used against an ISO file on disk (thus modifiable), but not on a CD. Once the ISO file is updated, a CD might be written (or overwritten if CD-R+). Part of the problem with unfinished CD recordings is that some systems will claim an I/O error, and not process the CD at all. The problem with finished CDs is that they are marked complete, and can't be extended... |
Are you tring to use the tree command and then send the output to your CD drive? If so, do this:
Code:
tree > nano |
If you've got a GUI on there, I've used k3b to burn stuff successfully.
Might be in your repos (it is in Centos) or see http://www.k3b.org/ |
Thanks for all your responses guys.
I didn't want to load a gui, I do this so seldom. I only had 155M of data I wanted to copy to cd. There are lots of examples to copy to DVD, but not to cdrom. For me, who doesn't do this very often, the documentation is confusing. I looked through the man pages for burn, wodim, mkisofs, genisoimage, etc. Most of the docs discuss audio and creating iso images, and mostly in reference to DVD's. The terminology is confusing to someone who doesn't do this a lot or in depth. I wound up doing this: Code:
sudo genisoimage -R /home/keith/datadirectory/ | wodim -v fs=6m speed=2 dev=/dev/sg1 - I may actually have tried something similar before, but aborted when I saw the process saying Code:
Starting new track at sector: 0 It's actually much more straight-forward writing audio cd's! At least the docs and examples for that are thorough and detailed! Keith Ostertag |
wodim = cdrecord? This process works for me
mkisofs -o filename.iso /some/files cdrecord -scanbus Note the device numbers. They mean crazy things to a strange man but you don't have to worry about that. Let's say, for example, your cd is on 1,0,0 cdrecord dev=1,0,0 speed=4 -eject filename.iso I always limit speed to limit errors as faster writing causes more errors. Take it from someone who has run BLER (Block Error) tests on real cds and cdrs. The eject spits it out when you're finished. If you want a dry run, there's an option for that also. |
Thanks. Even though I didn't use your choice of apps, I learned something from your post :-)
Here's part of what was tripping me up. I had thought that if I created an iso or raw file out of a bunch of files in a directory, that it creates one big file (it does). And that I'd wind up with one iso file on the cdrom, not a directory tree of files where I could, say, read or copy just one of them (later from the created cdrom). Now that I've tried it I see I was mistaken. Here's what I did (after changing to the directory I wanted to copy): Code:
$ genisoimage -R -o cdimage.raw ./ Code:
$ wodim -v speed=2 dev=1,0,0 cdimage.raw It didn't actually like using dev=1,0,0 and gave a warning, but worked. I now guess I should just use 1,0 or /dev/sg1. Finished, then mounted the cdrom, I feared I would see one big file on the cdrom- cdimage.raw. But instead I get the directory tree of files that I wanted to copy. I didn't realized it worked that way. Shazzam! So again, thanks! Keith |
The original guy who wrote that uses Solaris and [B]hates[B] glibc. Everybody who comes along after returns to convention "This is dvdrtools, not dvdlibc." "Returned the source to standard build procedure." are typical comments in READMEs.
It references /dev/pg* and /dev/sg* but often they're not made :-/. |
All times are GMT -5. The time now is 12:07 AM. |