LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
Search this Thread
Old 05-09-2008, 07:11 PM   #1
mikelancey
LQ Newbie
 
Registered: May 2008
Location: Seattle
Distribution: RH8
Posts: 3

Rep: Reputation: 0
Question Why cannot copy from mnt/cdron to my RH8 dir?


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?
 
Old 05-09-2008, 07:51 PM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
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

SVA
 
Old 05-09-2008, 07:52 PM   #3
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
For starters, if you only want to copy a .jpg and .gif file from the cd, you should explicitly list the files you want to copy. Example:
Code:
cp /mnt/cdrom/name_of_file.jpg ../
cp /mnt/cdrom/name_of_file.gif ../
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.
 
Old 05-09-2008, 07:56 PM   #4
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
@ jonlake -- good point
For just 2 files, why not just copy them each by name. lol.
 
Old 05-12-2008, 07:20 PM   #5
mikelancey
LQ Newbie
 
Registered: May 2008
Location: Seattle
Distribution: RH8
Posts: 3

Original Poster
Rep: Reputation: 0
Thumbs up Thank you, here's what worked

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.
 
Old 06-05-2008, 04:39 PM   #6
mikelancey
LQ Newbie
 
Registered: May 2008
Location: Seattle
Distribution: RH8
Posts: 3

Original Poster
Rep: Reputation: 0
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'm stumped. CP --help offers nothing new. Suggestions?
 
Old 06-05-2008, 04:54 PM   #7
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
Type in mount from the command line and make sure your cdrom is in fact mounted. Other than that, check dmesg and see if it tells you anything.
 
Old 06-05-2008, 11:00 PM   #8
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by mikelancey View Post
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'm stumped. CP --help offers nothing new. Suggestions?
Note the bold part I highlighted.

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).

Let us know how whatever you try next goes.

Sasha
 
  


Reply

Tags
cp, mnt


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy files in subdirs to one dir Rotwang Linux - General 4 12-14-2007 01:30 PM
How can I copy an entire CD (from WinXP) to a dir on my Linux server? hmendoza Linux - General 2 04-04-2007 06:06 PM
how copy from floppy to dir? cauge Mandriva 6 12-09-2003 11:12 AM
mount -t //192.168.0.1/mnt /mnt/windows -o password='' generates error broadsoft Linux - Networking 3 08-07-2003 04:51 AM
copy 1 file to multiple dir script carpman Linux - General 14 02-07-2002 09:29 AM


All times are GMT -5. The time now is 09:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration