Date: Thu, 24 May 2007 16:43:08 +0300 From: Nikos Vassiliadis <nvass@teledomenet.gr> To: freebsd-questions@freebsd.org Subject: Re: can't read raw CD device Message-ID: <200705241643.08935.nvass@teledomenet.gr> In-Reply-To: <200705241259.l4OCxliV055742@whoweb.com> References: <200705241259.l4OCxliV055742@whoweb.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 24 May 2007 15:59, Incoming Mail List wrote: > Hello, > > I'm trying to understand why I cannot read my CD drive directly from a > 'c' program using the read(2) system call, or even using the dd(1) > command. As you will see, I have both the acd0 and cd0 devices since > I have atapicam configured in the kernel. > > I can mount cdrom media using mount() and access data via the cd9660 > file system, so I know the drive and the media are not the problem. > > #dd if=/dev/acd0 of=/dev/null count=20 > dd: /dev/acd0: Invalid argument > 0+0 records in > 0+0 records out > 0 bytes transferred in 0.000163 secs (0 bytes/sec) > > #dd if=/dev/cd0 of=/dev/null count=20 > dd: /dev/cd0: Invalid argument > 0+0 records in > 0+0 records out > 0 bytes transferred in 0.000179 secs (0 bytes/sec) You have to define the sector size explicitly, otherwise your read(2)s will fail. You can use a multiple of 2048. dd uses by default a 512 byte length buffer. root:0:~# dd if=/dev/acd0 bs=2048 count=10 of=/dev/null 10+0 records in 10+0 records out 20480 bytes transferred in 4.110981 secs (4982 bytes/sec) That's for the so-called "data" CDs, the block size you have to use for audio CDs is 2352. HTH, Nikos
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705241643.08935.nvass>