2001-04-17 12:25:55

by s-jaschke

[permalink] [raw]
Subject: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

Judging from the thread started Jan 1, 2001, by Andre Hedrick,
I thought IDE DVD-RAM just works out of the box and got a
Toshiba SD-W2002.

Problem: /dev/hdc cannot be read or written to when the drive contains
DVD-RAM media. The behavior is the same for the stock 2.4.3 kernel
and the SuSE-2.4.0 kernel. Strangely enough, the disk can be read,
but not written to, with the 2.2.18 kernel.

Diagnostics:
(1) The hardware is properly connected: mounting CD-ROMs and the SuSE-7.1
DVD-ROM works.
(2) The drive is recognized at boot time (2.4.3 kernel):
from "/var/log/boot.msg":
<4>ide_setup: idebus=33
<4>ide_setup: ide0=dma
<4>ide_setup: ide0=ata66
<4>ide: Assuming 33MHz system bus speed for PIO modes
<4>AMD7409: IDE controller on PCI bus 00 dev 39
<4>AMD7409: chipset revision 7
<4>AMD7409: not 100%% native mode: will probe irqs later
<4>AMD7409: ATA-66/100 forced bit set (WARNING)!!
<4> ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:pio
<4> ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, hdd:pio
<4>hda: IBM-DTLA-307030, ATA DISK drive
<4>hdc: TOSHIBA DVD-RAM SD-W2002, ATAPI CD/DVD-ROM drive
<4>ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
<4>ide1 at 0x170-0x177,0x376 on irq 15
<6>hda: 60036480 sectors (30739 MB) w/1916KiB Cache, CHS=3737/255/63, UDMA(66)
<4>hdc: ATAPI 24X DVD-ROM DVDAM drive, 8192kB Cache, DMA
<6>Uniform CD-ROM driver Revision: 3.12

# cat /proc/sys/dev/cdrom/info
CD-ROM information, Id: cdrom.c 3.12 2000/10/18

drive name: hdc
drive speed: 0
drive # of slots: 1
Can close tray: 1
Can open tray: 1
Can lock tray: 1
Can change speed: 1
Can select disk: 0
Can read multisession: 1
Can read MCN: 1
Reports media changed: 1
Can play audio: 1
Can write CD-R: 0
Can write CD-RW: 0
Can read DVD: 1
Can write DVD-R: 0
Can write DVD-RAM: 1

# cat /proc/ide/hdc/settings
name value min max mode
---- ----- --- --- ----
breada_readahead 4 0 127 rw
current_speed 34 0 69 rw
dsc_overlap 0 0 1 rw
file_readahead 0 0 2097151 rw
ide_scsi 0 0 1 rw
init_speed 34 0 69 rw
io_32bit 0 0 3 rw
keepsettings 0 0 1 rw
max_kb_per_request 127 1 127 rw
nice1 1 0 1 rw
number 2 0 3 rw
pio_mode write-only 0 255 w
slow 0 0 1 rw
unmaskirq 0 0 1 rw
using_dma 1 0 1 rw

(3) the DVD-RAM medium cannot be read from or written to:
# dd if=/dev/hdc of=/dev/null bs=2048 count=8
0+0 records in
0+0 records out
# dd if=/dev/null of=/dev/hdc bs=2048 count=8
0+0 records in
0+0 records out
# fdisk /dev/hdc
Unable to read /dev/hdc
# badblocks /dev/hdc
0
1
2
3
4
...
# mke2fs -v -b 2048 -m 0 /dev/hdc
mke2fs 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09
/dev/hdc: Memory allocation failed while setting up superblock
# mkudf --media-type=dvdram --blocksize=2048 /dev/hdc
7200 (CEST)/-120
mkudf: min blocks=1762

(Just to make sure, I tried 2 different DVD-RAM media.)
______________________________________________________________________________


I am somewhat clueless what to do next.
Are there any experiences with this or other IDE DVD-RAM drives?

Stefan J.


--
Stefan R. Jaschke <[email protected]>
http://www.jaschke-net.de


2001-04-18 10:40:19

by Jens Axboe

[permalink] [raw]
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

On Tue, Apr 17 2001, Stefan Jaschke wrote:
> Judging from the thread started Jan 1, 2001, by Andre Hedrick,
> I thought IDE DVD-RAM just works out of the box and got a
> Toshiba SD-W2002.
>
> Problem: /dev/hdc cannot be read or written to when the drive contains
> DVD-RAM media. The behavior is the same for the stock 2.4.3 kernel
> and the SuSE-2.4.0 kernel. Strangely enough, the disk can be read,
> but not written to, with the 2.2.18 kernel.

It should work, note that I recently spotted some quite severe bugs in
the pio write handling for ATAPI which I've almost fixed here now. It
seems you drive is in DMA mode though, so it shouldn't be affecting you.

Please send me strace info when reading/writing to the drive (or at
least attempting to), this looks very queer indeed.

--
Jens Axboe

2001-04-18 12:40:34

by Jens Axboe

[permalink] [raw]
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

On Wed, Apr 18 2001, Jens Axboe wrote:
> On Tue, Apr 17 2001, Stefan Jaschke wrote:
> > Judging from the thread started Jan 1, 2001, by Andre Hedrick,
> > I thought IDE DVD-RAM just works out of the box and got a
> > Toshiba SD-W2002.
> >
> > Problem: /dev/hdc cannot be read or written to when the drive contains
> > DVD-RAM media. The behavior is the same for the stock 2.4.3 kernel
> > and the SuSE-2.4.0 kernel. Strangely enough, the disk can be read,
> > but not written to, with the 2.2.18 kernel.
>
> It should work, note that I recently spotted some quite severe bugs in
> the pio write handling for ATAPI which I've almost fixed here now. It
> seems you drive is in DMA mode though, so it shouldn't be affecting you.

Attached patch for 2.4.4-pre4 which fixes all known DVD-RAM ATAPI bugs.
Both pio and dma mode work fine here, using ext2, on a 9.4gb HITACHI
DVD-RAM GF-2000 drive.

--
Jens Axboe


Attachments:
(No filename) (919.00 B)
cd-244p4-1 (14.50 kB)
Download all attachments

2001-04-18 22:13:01

by s-jaschke

[permalink] [raw]
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

On Wednesday 18 April 2001 14:39, Jens Axboe wrote:

> Please send me strace info when reading/writing to the drive (or at
> least attempting to), this looks very queer indeed.
>
> Attached patch for 2.4.4-pre4 which fixes all known DVD-RAM ATAPI bugs.
> Both pio and dma mode work fine here, using ext2, on a 9.4gb HITACHI
> DVD-RAM GF-2000 drive.

I'll try the patch asap.

Here is a quick strace (on the SuSE 2.4.0 kernel, since my SMC Etherpower
doesn't work with 2.4.3) of a read with DVD-RAM medium inserted:

# strace dd if=/dev/hdc of=/dev/null bs=2k count=3
<... loading libraries ...>
close(0) = 0
open("/dev/hdc", O_RDONLY|O_LARGEFILE) = 0
close(1) = 0
open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 1
rt_sigaction(SIGINT, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT, {0x80493d0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {0x80493d0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGPIPE, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGPIPE, {0x80493d0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGUSR1, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGUSR1, {0x8049440, [], 0x4000000}, NULL, 8) = 0
brk(0x8054000) = 0x8054000
read(0, "", 2048) = 0
write(2, "0+0 records in\n", 150+0 records in
) = 15
write(2, "0+0 records out\n", 160+0 records out
) = 16
close(0) = 0
close(1) = 0
_exit(0) = ?

--------------------------------

Writing works, the LED is blinking. (I didn't know the difference
between /dev/zero and /dev/null when I did the first post. Sorry.):

# strace dd if=/dev/zero of=/dev/hdc bs=2k count=3
<... loading libraries ...>
close(0) = 0
open("/dev/zero", O_RDONLY|O_LARGEFILE) = 0
close(1) = 0
open("/dev/hdc", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 1
rt_sigaction(SIGINT, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT, {0x80493d0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {0x80493d0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGPIPE, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGPIPE, {0x80493d0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGUSR1, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGUSR1, {0x8049440, [], 0x4000000}, NULL, 8) = 0
brk(0x8054000) = 0x8054000
read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2048) =
2048
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2048) =
2048
read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2048) =
2048
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2048) =
2048
read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2048) =
2048
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2048) =
2048
write(2, "3+0 records in\n", 153+0 records in
) = 15
write(2, "3+0 records out\n", 163+0 records out
) = 16
close(0) = 0
close(1) = 0
_exit(0) = ?
-------------------------------------

But mke2fs does not work:

# strace mke2fs -b 2048 /dev/hdc
... <libraries loaded> ...
write(2, "mke2fs 1.19, 13-Jul-2000 for EXT"..., 52mke2fs 1.19, 13-Jul-2000
for EXT2 FS 0.5b, 95/08/09
) = 52
stat64("/dev/hdc", {st_mode=S_IFBLK|0660, st_rdev=makedev(22, 0), ...}) = 0
open("/etc/mtab", O_RDONLY) = 3
brk(0x8050000) = 0x8050000
fstat64(3, {st_mode=S_IFREG|0644, st_size=234, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x40017000
read(3, "/dev/sda3 / ext2 rw 0 0\nproc /pr"..., 4096) = 234
read(3, "", 4096) = 0
close(3) = 0
munmap(0x40017000, 4096) = 0
open("/dev/hdc", O_RDONLY|O_LARGEFILE) = 3
ioctl(3, BLKGETSIZE, 0xbffff524) = 0
close(3) = 0
open("/dev/hdc", O_RDWR|O_LARGEFILE) = 3
time(NULL) = 987630857
old_mmap(NULL, 488173568, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = -1 ENOMEM (Cannot allocate memory)
brk(0x251df000) = 0x8050000
old_mmap(NULL, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE,
-1, 0) = 0x40159000
munmap(0x40159000, 684032) = 0
munmap(0x40300000, 364544) = 0
mprotect(0x40200000, 32768, PROT_READ|PROT_WRITE) = 0
old_mmap(NULL, 488173568, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = -1 ENOMEM (Cannot allocate memory)
old_mmap(NULL, 488173568, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = -1 ENOMEM (Cannot allocate memory)
close(3) = 0
write(2, "/dev/hdc", 8/dev/hdc) = 8
write(2, ": ", 2: ) = 2
write(2, "Memory allocation failed", 24Memory allocation failed) = 24
write(2, " ", 1 ) = 1
write(2, "while setting up superblock", 27while setting up superblock) = 27
) = 1
write(2, "\n", 1
) = 1
_exit(1) = ?
___________________________________

Another story: With the SuSE DVD-ROM in the drive, the
"dd if=/dev/hdc of=/dev/null bs=2k count=3" also just reads 0 bytes as above,
but the "mount -t iso9660 /dev/hdc /dvd" and then reading from
/dvd succeeds.

Stefan

2001-04-19 11:40:22

by s-jaschke

[permalink] [raw]
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

Hi Jens,

I applied your patch to 2.4.4-pre4. It compiled fine, but crashed during
boot (just right after the IDE init) with
-------------------
Uniform CD-ROM driver Revision: 3.12
Unable to handle kernel NULL pointer dereference at virtual address 00000000
printing eip: ...
Oops: 0000
...
-------------------

I looked up the eip. It's in
c01a5490 t cdrom_get_entry
c01a5490 t gcc2_compiled.
(Although I don't know what the second line on the same address means.)

Please let me know, if you need more info or I can help in any other way.

Thanks,
Stefan

2001-04-19 11:46:32

by Jens Axboe

[permalink] [raw]
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

On Thu, Apr 19 2001, Stefan Jaschke wrote:
> Hi Jens,
>
> I applied your patch to 2.4.4-pre4. It compiled fine, but crashed during
> boot (just right after the IDE init) with
> -------------------
> Uniform CD-ROM driver Revision: 3.12
> Unable to handle kernel NULL pointer dereference at virtual address 00000000
> printing eip: ...
> Oops: 0000
> ...
> -------------------

This should fix it.

--
Jens Axboe


Attachments:
(No filename) (415.00 B)
cd-get-entry-1 (743.00 B)
Download all attachments

2001-04-19 12:13:56

by s-jaschke

[permalink] [raw]
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

> > I applied your patch to 2.4.4-pre4. It compiled fine, but crashed during
> > boot (just right after the IDE init) with
>
> This should fix it.

It boots now. But I still cannot read a DVD-RAM disk (same behavior
as before):
# strace dd of=/dev/null if=/dev/hdc bs=2k count=3
open("/dev/hdc", O_RDONLY|O_LARGEFILE) = 0
close(1) = 0
open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 1
rt_sigaction(SIGINT, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT, {0x80493d0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {0x80493d0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGPIPE, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGPIPE, {0x80493d0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGUSR1, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGUSR1, {0x8049440, [], 0x4000000}, NULL, 8) = 0
brk(0x8054000) = 0x8054000
read(0, "", 2048) = 0
write(2, "0+0 records in\n", 150+0 records in
) = 15
write(2, "0+0 records out\n", 160+0 records out
) = 16
close(0) = 0
close(1) = 0
_exit(0) = ?
------------------
Nor mke2fs:

# strace mke2fs -b 2048 /dev/hdc
open("/dev/hdc", O_RDONLY|O_LARGEFILE) = 3
ioctl(3, BLKGETSIZE, 0xbffff524) = 0
close(3) = 0
open("/dev/hdc", O_RDWR|O_LARGEFILE) = 3
time(NULL) = 987682145
old_mmap(NULL, 472477696, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = -1 ENOMEM (Cannot allocate memory)
brk(0x242e7000) = 0x8050000
old_mmap(NULL, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE,
-1, 0) = 0x40159000
munmap(0x40159000, 684032) = 0
munmap(0x40300000, 364544) = 0
mprotect(0x40200000, 32768, PROT_READ|PROT_WRITE) = 0
old_mmap(NULL, 472477696, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = -1 ENOMEM (Cannot allocate memory)
old_mmap(NULL, 472477696, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = -1 ENOMEM (Cannot allocate memory)
close(3) = 0
write(2, "/dev/hdc", 8/dev/hdc) = 8
write(2, ": ", 2: ) = 2
write(2, "Memory allocation failed", 24Memory allocation failed) = 24
write(2, " ", 1 ) = 1
write(2, "while setting up superblock", 27while setting up superblock) = 27
) = 1
write(2, "\n", 1
) = 1
_exit(1) = ?

Cheers,
Stefan

2001-04-19 12:16:15

by Jens Axboe

[permalink] [raw]
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

On Thu, Apr 19 2001, Stefan Jaschke wrote:
> > > I applied your patch to 2.4.4-pre4. It compiled fine, but crashed during
> > > boot (just right after the IDE init) with
> >
> > This should fix it.
>
> It boots now. But I still cannot read a DVD-RAM disk (same behavior
> as before):

This is really strange, are you sure your drive is ok? Does mounting
dvd-rom and cd-rom's work fine?

--
Jens Axboe

2001-04-19 12:44:42

by s-jaschke

[permalink] [raw]
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

On Thursday 19 April 2001 14:15, Jens Axboe wrote:
> This is really strange, are you sure your drive is ok? Does mounting
> dvd-rom and cd-rom's work fine?

OK. I'll check again with 2.4.4-pre4+patches:
(1) Mounting the SuSE DVD-ROM (-t iso9660) from /dev/hdc on /dvd and
reading from /dvd works. Same for CD-ROMs. I don't have a formatted
DVD-RAM.
(2) Reading with "dd if=/dev/hdc ..."
(2.1) works with CD-ROM inserted
(2.2) fails with DVD-ROM inserted
(2.3) fails with DVD-RAM inserted
(3) Writing with "dd of=/dev/hdc ..." works (with DVD-RAM inserted).
(4) "mke2fs -b 2048 /dev/hdc" fails (with DVD-RAM inserted).

As if the drive gives the driver wrong information (like size=0)?

If nothing helps, I have to plug the drive into a Windows machine
to make sure it really works with Toshiba's own drivers. This would
be a major hassle, though. No place for Windows on my own machine.
Hence some amount of screwing... :-(


--
Stefan R. Jaschke <[email protected]>
http://www.jaschke-net.de

2001-04-19 13:04:04

by Jens Axboe

[permalink] [raw]
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

On Thu, Apr 19 2001, Stefan Jaschke wrote:
> On Thursday 19 April 2001 14:15, Jens Axboe wrote:
> > This is really strange, are you sure your drive is ok? Does mounting
> > dvd-rom and cd-rom's work fine?
>
> OK. I'll check again with 2.4.4-pre4+patches:
> (1) Mounting the SuSE DVD-ROM (-t iso9660) from /dev/hdc on /dvd and
> reading from /dvd works. Same for CD-ROMs. I don't have a formatted
> DVD-RAM.
> (2) Reading with "dd if=/dev/hdc ..."
> (2.1) works with CD-ROM inserted
> (2.2) fails with DVD-ROM inserted

dd fails with DVD-ROM inserted??? In the same way? Is this the SuSE DVD,
and not a movie DVD? Also, check dmesg for errors.

> (2.3) fails with DVD-RAM inserted
> (3) Writing with "dd of=/dev/hdc ..." works (with DVD-RAM inserted).
> (4) "mke2fs -b 2048 /dev/hdc" fails (with DVD-RAM inserted).

Side note -- use as big a block size as you can for a DVD-RAM hosted fs,
4kB is better than 2kB.

> As if the drive gives the driver wrong information (like size=0)?

Could be, try

cat /proc/ide/hdc/capacity

and see what that says.

But at least it looks like your drive is just fine.

> If nothing helps, I have to plug the drive into a Windows machine
> to make sure it really works with Toshiba's own drivers. This would
> be a major hassle, though. No place for Windows on my own machine.

Lets not go that far yet :)

> Hence some amount of screwing... :-(

And lets stick to hardware for now, ok? :-)

--
Jens Axboe

2001-04-19 21:32:35

by s-jaschke

[permalink] [raw]
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

On Thursday 19 April 2001 15:03, Jens Axboe wrote:
> On Thu, Apr 19 2001, Stefan Jaschke wrote:
> > OK. I'll check again with 2.4.4-pre4+patches:
> > (1) Mounting the SuSE DVD-ROM (-t iso9660) from /dev/hdc on /dvd and
> > reading from /dvd works. Same for CD-ROMs. I don't have a formatted
> > DVD-RAM.
> > (2) Reading with "dd if=/dev/hdc ..."
> > (2.1) works with CD-ROM inserted
> > (2.2) fails with DVD-ROM inserted
>
> dd fails with DVD-ROM inserted??? In the same way? Is this the SuSE DVD,
> and not a movie DVD? Also, check dmesg for errors.
> > (2.3) fails with DVD-RAM inserted

"dd if=/dev/hdc of=/dev/null bs=2k count=3" produces the same strace, whether
the DVD-RAM or the SuSE DVD-ROM is inserted. I interpret the fact that the
first read() returns 0 as some lower layer coming to the conclusion that
"/dev/hdc" has length 0.
The only line that appears in the system logs is
"VFS: Disk change detected on device ide1(22,0)"
when I change the disks.

> > (3) Writing with "dd of=/dev/hdc ..." works (with DVD-RAM inserted).
> > (4) "mke2fs -b 2048 /dev/hdc" fails (with DVD-RAM inserted).
I took a closer look at the strace of the "mke2fs ...". The first system call
that fails is
old_mmap(NULL, 504938496, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = -1 ENOMEM
It asks for 481MB, which I simply don't have. (128MB RAM, 256MB swap).
So, this may be unrelated to the kernel, just a quirk of mke2fs to ask for
that much memory.

> Could be, try
> cat /proc/ide/hdc/capacity
0 (with empty tray)
8946816 (with single-sided 4.7GB DVD-RAM)
4875840 (with single-sided 2.6GB DVD-RAM)
9106700 (with SuSE DVD-ROM)
1325240 (with SuSE CD-ROM)

Seem to be 512 Byte blocks. Looks OK.

> And lets stick to hardware for now, ok? :-)
This means "There is hope to get the drive working under Linux"?

Correct me if I am wrong in my interpretations.

There are two mysteries (for me at least) left:
(1) Why does mke2fs need 481MB memory?
(2) Why does the very first read() on /dev/hdc return EOF?

What would you suggest to try next?

Stefan

2001-04-21 16:47:54

by s-jaschke

[permalink] [raw]
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

Hi Jens,

I took some time to try to understand why "mke2fs -b 2048 /dev/hdc"
wants 500MB memory. Here is a first explanation:
# mke2fs -m 0 -n /dev/hdc
mke2fs 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
406650880 inodes, 813284544 blocks
0 blocks (0.00%) reserved for the super user
First data block=0
24820 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group

813284544 4k blocks would be 3.7 Terabyte.
(Strangely enough, calling mke2fs with any blocksize parameter results in a memory
allocation larger then my memory available.)

I took some more time to understand at what point the wrong size is introduced.
I got the source rpm, set CFLAGS to "-g", ran gdb, and nailed down the point:

(gdb) l
80 #endif
81 if (fd < 0)
82 return errno;
83
84 #ifdef BLKGETSIZE
85 if (ioctl(fd, BLKGETSIZE, &size) >= 0) {
86 close(fd);
87 *retblocks = size / (blocksize / 512);
88 return 0;
89 }
(gdb) n
86 close(fd);
(gdb) print size
$1 = -2083658236
(gdb) bt
#0 ext2fs_get_device_size (file=0xbffff911 "/dev/hdc", blocksize=1024,
retblocks=0xbffff534) at ../../../lib/ext2fs/getsize.c:86
#1 0x804aca3 in PRS (argc=4, argv=0xbffff75c) at ../../misc/mke2fs.c:993
#2 0x804af2e in main (argc=4, argv=0xbffff75c) at ../../misc/mke2fs.c:1081
#3 0x40044baf in __libc_start_main () from /lib/libc.so.6

I am afraid I'd need help to go deeper.

Cheers,
Stefan J.

--
Stefan R. Jaschke <[email protected]>
http://www.jaschke-net.de