Operating System - HP-UX
1825554 Members
3170 Online
109681 Solutions
New Discussion

copy a cd's contents to local disk

 
SOLVED
Go to solution
Tim Killinger
Regular Advisor

copy a cd's contents to local disk

Dummy question, but easy ... I'm a UNIX newbie....:(

what commands do I use to mount a cd then copy it's directory structure to a local disk. I have a 2 cd set.....

Thanks!
10 REPLIES 10
Pete Randall
Outstanding Contributor
Solution

Re: copy a cd's contents to local disk

Tim,

First, find the device file for you cd drive:

$ ioscan -kfnCdisk
Class I H/W Path Driver S/W State H/W Type Description
============================================================================
disk 0 8/0/19/0.5.0 sdisk CLAIMED DEVICE SEAGATE ST34520WS
/dev/dsk/c1t5d0 /dev/rdsk/c1t5d0
disk 1 8/0/19/0.6.0 sdisk CLAIMED DEVICE QUANTUM VIKING2-4WS
/dev/dsk/c1t6d0 /dev/rdsk/c1t6d0
disk 2 8/16/5.2.0 sdisk CLAIMED DEVICE TOSHIBA CD-ROM XM-5701TA
/dev/dsk/c2t2d0 /dev/rdsk/c2t2d0


Second, insert the disk and issue the mount command:

$ mount /dev/dsk/c2t2d0 /cdrom

(you need to be root)


Third, depending on what's on the cd, you should be able to just cp the files:

cp /cdrom/* /WhereYouWantitToGo


Hope this helps,
Pete

Pete
Jeff Schussele
Honored Contributor

Re: copy a cd's contents to local disk

Hi Tim,

Depending on the CD format you may need mount options like:

mount -F cdfs -o cdcase /dev/dsk/cxtydz /mnt_point

You'll know if you need them if when you mount w/o them either
A) ALL filenames are uppercase & they shouldn't be
B) The filnames are "strange" - have trailing characters that don't look right

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Patrick Wallek
Honored Contributor

Re: copy a cd's contents to local disk

To add to Pete's post:

When you do the copy you probably will want to add the '-Rp' to the cp command. So it would be:

# cp -Rp /cdrom/* /dir/to/copy/to
MANOJ SRIVASTAVA
Honored Contributor

Re: copy a cd's contents to local disk

Hi Tim


Copying is simple like you do betwenn any directories but the key is the mounting. For this you need to knwo the device file for the cd , ioscan -fnC disk | grep CD or DVD to get teh device file .

Then mount using

mount -F cdfs -o cdcase /dev/dsk/cxtydz /cdrom


then use cp to copy from /cdrom to where you want to copy to .

to contuine for the next cd you need to umoun the first cd and then mount the second cd and repeat the cd process . Inc ase you are making copies for the CD , a better option would be to use the CD burner to amek copies.


Manoj Srivastava
Sridhar Bhaskarla
Honored Contributor

Re: copy a cd's contents to local disk

Hi,

In addition to the above replies, since you have a 2-cd set,

1. Mount the first CD. Copy the contents as indicated above.
2. Unmount the cd. Make sure you are not in that directory.

umount /cdrom

3. Replace CD1 with CD 2. Mount it again. Copy the contents. Unmount and take it out.

If you don't unmount, you cannot chnage the CD.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Tim Killinger
Regular Advisor

Re: copy a cd's contents to local disk

well the ioscan confirms that my device file is c2ticgsva1:/stand> ioscan -kfnCdisk
Class I H/W Path Driver S/W State H/W Type Descriptio
n
================================================================================
==
disk 0 0/0/1/1.2.0 sdisk CLAIMED DEVICE HP 18.2GMA
N3184MC
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 1 0/0/2/0.2.0 sdisk CLAIMED DEVICE HP 18.2GMA
N3184MC
/dev/dsk/c2t2d0 /dev/rdsk/c2t2d0
disk 2 0/0/2/1.2.0 sdisk CLAIMED DEVICE HP DV
D-ROM 3052d0....


but when I mount;

# mount /dev/dsk/c2t2d0 /cdrom
/dev/dsk/c2t2d0: unrecognized file system

I feel pretty dumb... (/cdrom exists)
Patrick Wallek
Honored Contributor

Re: copy a cd's contents to local disk

You are trying to mount a hard disk drive. The device file you want is the one BELOW the line that contains "HP DVD-ROM".

Try that one and you will probably have better luck.
Tim Killinger
Regular Advisor

Re: copy a cd's contents to local disk

OK, so the device file is c3t2d0....

# ioscan -kfnCdisk
Class I H/W Path Driver S/W State H/W Type Descriptio
n
================================================================================
==
disk 0 0/0/1/1.2.0 sdisk CLAIMED DEVICE HP 18.2GMA
N3184MC
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 1 0/0/2/0.2.0 sdisk CLAIMED DEVICE HP 18.2GMA
N3184MC
/dev/dsk/c2t2d0 /dev/rdsk/c2t2d0
disk 2 0/0/2/1.2.0 sdisk CLAIMED DEVICE HP DV
D-ROM 305
/dev/dsk/c3t2d0 /dev/rdsk/c3t2d0
disk 3 0/4/0/0.8.0.110.0.0.0 sdisk CLAIMED DEVICE HP A6
188A
/dev/dsk/c4t0d0 /dev/rdsk/c4t0d0
disk 5 0/4/0/0.8.0.110.0.0.1 sdisk CLAIMED DEVICE HP A6
188A

mount now says:

# mount /dev/dsk/c3t2d0 /cdrom
mount: /dev/dsk/c3t2d0 on /cdrom : Device busy

and I don't have to umount to eject CD...

is it mounted to someone else? (don't think it can be)
Pete Randall
Outstanding Contributor

Re: copy a cd's contents to local disk

Tim,

What's your $PWD? Are you in /cdrom, perhaps? If not, try fuser to see if someone else is.

Pete

Pete
Patrick Wallek
Honored Contributor

Re: copy a cd's contents to local disk

What directory are you currently in?

If you happen to be in the /cdrom directory when you try to do a mount, you will get this error.

# pwd
/cdrom

If you do the above and it returns /cdrom, then do a:

# cd /

Then try doing your mount command.

If you want to see if it is already mounted do a:

# cd /cdrom

# ls

If it returns nothing, then chances are it is not already mounted.

Be sure to do a:

# cd /

to get out of the /cdrom directory before trying to do a mount command. Also, be sure to do the above before you try to

# umount /cdrom

to unmount the cd, or else you will get the same error.