LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-23-2005, 04:05 PM   #1
towlie
Member
 
Registered: Apr 2004
Location: U.S.
Distribution: slackware 10.0
Posts: 110

Rep: Reputation: 15
catting cd img onto hd


Well, maybe this is a dumb question, but I've searched
and just don't know where to start.

Using an x86 box with cd writers on primary ide slave and
on secondary ide master.

EDIT: Forgot to say I'm using scsi emulation,
which is why I tried sr0 and sr1.

Here's my failed attempt to get an image:
Code:
[root: music] ls -l /dev/hdb /dev/hdc /dev/sr0 /dev/sr1 /dev/topcd /dev/botcd
lrwxrwxrwx  1 root root       3 2005-04-23 14:50 /dev/botcd -> sr0
brw-rw----  1 root disk   3, 64 2002-06-09 14:27 /dev/hdb
brw-rw----  1 root disk  22,  0 2002-06-09 14:27 /dev/hdc
brw-rw----  1 root cdrom 11,  0 1999-04-12 23:24 /dev/sr0
brw-rw----  1 root cdrom 11,  1 1999-04-12 23:24 /dev/sr1
lrwxrwxrwx  1 root root       3 2005-04-23 14:50 /dev/topcd -> sr1
[root: music] cat /dev/topcd > test.raw
cat: /dev/topcd: Input/output error
[root: music] cat /dev/hdc > test.raw
cat: /dev/hdc: Input/output error
[root: music] cat /dev/sr1 > test.raw
cat: /dev/sr1: Input/output error
dd doesn't work either.

I've got no idea where to start, so could someone point
me in the right direction?


ON A MUCH MORE POSITIVE NOTE:
Just got my sound card working on slackware. That was the only
reason I still had win2k on my machine, so now I'll be removing
the last trace of M$ forever.

Thanks to everyone here at lq for all your help.

Last edited by towlie; 04-23-2005 at 04:10 PM.
 
Old 04-24-2005, 08:48 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
You want an image of a CD ?
Code:
mount /mnt/cdrom
mkisofs -o cd.iso /mnt/cdrom
 
Old 04-24-2005, 01:23 PM   #3
towlie
Member
 
Registered: Apr 2004
Location: U.S.
Distribution: slackware 10.0
Posts: 110

Original Poster
Rep: Reputation: 15
d'oh, I should have told you, these are audio cds I'm
trying to get images of, so they cant be mounted (right?).


Trying something else right now, I'll let you know if it works.

thanx
 
Old 04-24-2005, 01:39 PM   #4
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
So, try cdrdao
Code:
cdrdao scanbus
cdrdao read-cd --datafile audiocd.bin --device <X,X,X>
 
Old 04-24-2005, 04:12 PM   #5
towlie
Member
 
Registered: Apr 2004
Location: U.S.
Distribution: slackware 10.0
Posts: 110

Original Poster
Rep: Reputation: 15
Anyone need some coasters?

keefaz, thanks for your help.

Tried cdrdao, and ended up with a cd that had all
the audio but just on a single, 68-minute track.
Maybe i did an option wrong or something.

This finally worked:

Code:
cdparanoia -v -d /dev/whatever -B 1-15

cdrecord -dev=x,y,z -speed=32 -nopad -audio track01.cdda.wav ...... track15.cdda.wav

Well, I'm glad that worked, but does anyone know why catting
wouldn't work there. Isn't that the standard way to get
a disk image?
 
Old 04-24-2005, 04:17 PM   #6
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Take a look at cdrecord's man page specially the EXAMPLES section which has some examples (obviously... :P ) on how to copy a cd to another cd and how to rip and burn several tracks at once.
 
Old 04-24-2005, 04:36 PM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
For the cdrdao tool I forgot the TOC file, this file provides infos about the cd tracks
(like nero's cue files)
Code:
cdrdao read-cd --datafile audiocd.bin --device <X,X,X> cd.toc
 
Old 04-24-2005, 05:16 PM   #8
towlie
Member
 
Registered: Apr 2004
Location: U.S.
Distribution: slackware 10.0
Posts: 110

Original Poster
Rep: Reputation: 15
Thanks everyone, I've looked at man cdrecord many times, but
now that you said that, i saw this down in the ex section.

These 2 scripts worked for me:


acdrip:
PHP Code:
#!/usr/bin/php
<?php

$usage
"acdrip <top|bot>\n";
$dev'';
$comm'';


if(
count($argv) != 2) die($usage);

if(
$argv[1] == 'top'$dev'-D0,1,0';
else if(
$argv[1] == 'bot'$dev'-D0,0,0';
else die(
$usage);

$comm"cdda2wav -vall $dev -B -Owav";

system($comm);
print 
"\n";

?>


acdrec:
PHP Code:
#!/usr/bin/php
<?php

$usage
"acdrec <top|bot>\n";
$dev'';
$comm'';


if(
count($argv) != 2) die($usage);

if(
$argv[1] == 'top'$dev'-dev=0,1,0';
else if(
$argv[1] == 'bot'$dev'-dev=0,0,0';
else die(
$usage);

$comm"cdrecord -v $dev -dao *.wav";

system($comm);
print 
"\n";

?>

If you have multiple drives, that lets you rip from/burn to your
drive of choice, it'll fill the cwd with .wav files. Just replace the
dev options with the freaky parameters that work on your system.
 
Old 04-24-2005, 05:25 PM   #9
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Hey it looks cool in php
 
Old 04-24-2005, 05:33 PM   #10
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Oh by the way, regarding to why cat doesn't work, I guess it's because it finds EOF flag (End Of File) lines long before reaching the end of the CD, it should work if the CD doesn't contain it.
You could try using dd instead that will do raw reading or writing (same as cat but in a binary way).
 
Old 04-24-2005, 05:56 PM   #11
towlie
Member
 
Registered: Apr 2004
Location: U.S.
Distribution: slackware 10.0
Posts: 110

Original Poster
Rep: Reputation: 15
keefaz and gbonvehi, thanks for your replies.

yeah, i tried dd, but it wouldn't work (although I could've
been doing something wrong there too )

But here's why I think it's lower than that:
I even tried writing a dummy c program using
fopen("/dev/xxx", "r") just to see if I could get
a lock, but no success.

Dunno, just feels like one of those times when
you just know if you knew the right dev name,
everything would work perfectly.

If figure out how to get a true image, I'll post it,
but I'll probably just use this for a while as it
works smoothly for me.
 
  


Reply



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
Catting Sound to /dev/dsp player_2 *BSD 4 10-07-2005 08:12 AM
Catting files together is not working, what am I doing wrong? BajaNick Linux - General 5 02-13-2005 05:33 PM
Catting first line only. dakota rob Linux - Software 1 10-27-2004 08:40 AM
[php]Reading url [img] and [/img] hylke Programming 13 08-23-2004 01:58 PM
.img burner or way to boot from a .img American Psycho Linux - Software 4 03-24-2004 06:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:49 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration