Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Trying to copy a jpg and gif file from a CD-Rom to my RH8 directory.
This is what I'm doing from the target directory: # cp -a /mnt/cdrom/* ../
# cp -S /mnt/cdrom/* ../
The system prompts cp: overwrite '../files'?
I choose yes, but the files are not in the destination directory.
Am I missing something, here?
So you want to copy stuff FROM the /mnt/cdrom folder, TO... Where? To the root area? How about to 'destination_folder"
Try this:
cp -ruPv /mnt/cdrom/* /destination_folder
-r = recursive
-u = copy the file only if it doesn't exist or is older than the source.
-P = create target folder if it doesn't exist.
-v = verbose, so you can see what's happening.
PS - Read the man page for 'cp' to verify my options! No warranty is implied or expressed
The way you have the destination folder listed as "../" means "go up one directory", or in other words, you are telling it to copy from /mnt/cdrom TO /mnt
/ = root
./ = right here (current folder)
../ = up one directory
For this application of cp, unless you are trying to preserve the original permission on the file (which won't have write capabilites because it is coming off of a cdrom), you don't need the -a option.
It would be helpful for us trying to help you if
1. We knew what directory you were in so we know where you are copying to, ../ is relative to whatever directory you are currently in. or
2. You used the full path as the destination.
Thank you for your help, senior linux penguins!
Here's what worked:
# cp /mnt/cdrom/filename.jpg /var/www/html/filename.jpg
Copying one file at a time. Also, it was necessary to name the file in both the source and destination addresses. Failing that, the file seemed to be there, but not visible. What i mean is, i got the message "overwrite 'filename.jpg'". Then i would answer yes, and then see no file in the 'll' listing. So, copy twice and name it in both source and destination addresses. Perhaps that's a "duh" for y'all.
Thank you GrapefruiTgirl and jonlake. Copying has been going well, until today.
Problem: Linux RH8 is not recognizing file on CD Roms.
(1) When I copy the response is
cp: 'cannot stat /mnt/cdrom/9999jpg.jpg': no such file or directory
(2) The CDRom is mounted well. A different CDRom used previously mounts and copies fine.
# mount /mnt/cdrom/
# ll /mnt/cdrom/
0
# ls /mnt/cdrom/
# i.e. ll and ls show no files present on the mounted CDRom.
(3) I am using an Ativa CD-R. Copying and writing to the CD from Windows XP. This worked previously.
Thank you GrapefruiTgirl and jonlake. Copying has been going well, until today.
Problem: Linux RH8 is not recognizing file on CD Roms.
(1) When I copy the response is
cp: 'cannot stat /mnt/cdrom/9999jpg.jpg': no such file or directory
(2) The CDRom is mounted well. A different CDRom used previously mounts and copies fine.
# mount /mnt/cdrom/
# ll /mnt/cdrom/
0
# ls /mnt/cdrom/
# i.e. ll and ls show no files present on the mounted CDRom.
(3) I am using an Ativa CD-R. Copying and writing to the CD from Windows XP. This worked previously.
I have had the exact same experience way back before I tossed XP out the Window. In fact, I still have a CD-RW here somewhere which shows one particular filesystem if I mount it in Linux, but a different filesystem (and different files) if I stick it into a XP machine. The files I put on the disc from within XP are invisible in Linux.
Depending on *exactly* how you burned or wrote to the disc from XP can change how the files are seen (or not seen) from Linux. You'll have to do your own research for more info because I don't recall the specifics of what I am trying to explain, but it *may* have to do with A) the file system used from XP; B1) whether the disc is finalized or not B2) if it is multi-session or not.
What *might* help, if you haven't specifically tried this yet, is to blank & format a CD-RW from Linux with the UDF-v1.0.2 file system (or maybe a CD-R but not sure if it works the same; it should.) and use that disc to put stuff from XP onto (it will work like a floppy in both OS's) and then mount it in Linux and CP your files from it. If/when the disc gets full, start over with it (blank & format again).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.