# DVD-RW Packet Writing

## PenguinPowered

I just got a new DVD-RW drive, and I am wondering how to do packet writing to make my blank DVD-RWs look like portable hard disks?  I am using kernel version 2.4.26 (Gentoo sources 2004.3).  Thanks for any help.

----------

## Swoosh

Is there a reason for you using the 2.4.26 kernel?

If not, use 2.6.10 which has support for packet writing already. Otherwise you could patch your kernel.

Look at this guide https://forums.gentoo.org/viewtopic.php?t=173263. This should work for DVD-RW too.

----------

## PenguinPowered

I think I have to use kernel version 2.4.x since my modem, as Conexant, does not work fully with kernel version 2.6.x.  I tried the drivers, but you have to pay to download full ones.  The freeware drivers only work at 14.4.  So, for now, I'm sticking with the old drivers to be sure.

----------

## PenguinPowered

Hmm, I followed the guide, but it won't work.  When I try to mount it says "mount: /dev/pktcdvd0 is not a valid block device".  And, when I try to run the init script, it says: "

 *Quote:*   

> 
> 
> modprobe: Can't locate module pktcdvd
> 
>  * Enabling CD-RW packet writing on /dev/cdroms/cdrom1...
> ...

 

----------

## NeddySeagoon

PenguinPowered,

What does

```
ls -al /dev/pktcdvd0
```

 show ?

There is a mailing list here packet-writing@suse.com and lots of useful info here http://fy.chalmers.se/~appro/linux/DVD+RW/

I like a UDF on DVD+RW best because there is no messing with packet writing.

----------

## PenguinPowered

bash-2.05b$ ll /dev/pktcdvd0

brw-r--r--  1 root root 97, 0 Dec 31 10:12 /dev/pktcdvd0

But the /dev/pktcdvd0 is highlighted in black

----------

## NeddySeagoon

PenguinPowered,

Thats right. Have you formatted and made a UDF filesystem on your disk?

I have used this patch under 2.4 and 26 kernels but always with the CD-RW configured as emulated scsi.

----------

## PenguinPowered

I enabled scsi emulation by doing this in lilo.conf:

 *Quote:*   

> append="hdd=ide-scsi max_scsi_luns=1"

 

Hmm, I tried it with a formatted disc, and I get this error when I try to mount it:

 *Quote:*   

> localhost root # mount /mnt/dvdrw/
> 
> mount: /dev/pktcdvd0 is not a valid block device

 

but, when I do ls -al /dev/pktcdvd0, it's no longer highlighted, it's just plain black text.  The end result is still the same when I try to run the cdrw script:

 *Quote:*   

> localhost root # /etc/init.d/cdrw start
> 
>  * Re-caching dependency info (mtimes differ)...
> 
> modprobe: Can't locate module pktcdvd
> ...

 

Thanks for the help, so far.  I know I'm getting close.

----------

## NeddySeagoon

PenguinPowered,

The 

```
append="hdd=ide-scsi max_scsi_luns=1"
```

stops the IDE subsystem attaching the burner when the kernel starts. You also need kernel support for ide-scsi, scsi-generic and SCSI CD-ROMs.

Your dmesg should show something like 

```
ide-scsi is deprecated for cd burning! Use ide-cd and give dev=/dev/hdX as device

scsi2 : SCSI host adapter emulation for IDE ATAPI devices

  Vendor: SONY      Model: DVD RW DW-D22A    Rev: BYS1

  Type:   CD-ROM                             ANSI SCSI revision: 02

sr0: scsi3-mmc drive: 48x/48x writer cd/rw xa/form2 cdda tray

Uniform CD-ROM driver Revision: 3.20

Attached scsi CD-ROM sr0 at scsi2, channel 0, id 0, lun 0

```

if the drive is being found as ide-scsi.

scsi0 and scsi1 on my box are SATA hard drives

----------

## Cintra

Hei PenguinPowered

I'm having the same error as you with

```

# mount /mnt/dvdrw/

mount: /dev/pktcdvd0 is not a valid block device

```

see thread on 

https://forums.gentoo.org/viewtopic.php?p=1933024#1933024

I found that the cdrw script errors during bootup with

```

Jan  1 22:33:29 p4pe rc-scripts: ERROR:  "/etc/init.d/cdrw" has syntax errors in it; not executing...

```

I'm using the cdrw script from the packet writing wiki and have checked it out three times. Just thought I'd let you know, I'm trying to find an OK script.

regards

----------

## PenguinPowered

Hmm, I have all of those built into the kernel, and it seems to do the emulation OK.  This is from my dmesg:

```
hdc: HITACHI DVD-ROM GD-5000, ATAPI CD/DVD-ROM drive

hdd: _NEC DVD_RW ND-3500AG, ATAPI CD/DVD-ROM drive

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

ide1 at 0x170-0x177,0x376 on irq 15

hda: attached ide-disk driver.

hda: host protected area => 1

hda: 53464320 sectors (27374 MB) w/1961KiB Cache, CHS=3328/255/63, UDMA(33)

hdc: attached ide-cdrom driver.

hdc: ATAPI 40X DVD-ROM drive, 512kB Cache, DMA

Uniform CD-ROM driver Revision: 3.12

hdd: attached ide-scsi driver.

Partition check:

 /dev/ide/host0/bus0/target0/lun0: p1 p2 p3 p4

SCSI subsystem driver Revision: 1.00

scsi0 : SCSI host adapter emulation for IDE ATAPI devices

  Vendor: _NEC      Model: DVD_RW ND-3500AG  Rev: 2.16

  Type:   CD-ROM                             ANSI SCSI revision: 02

Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0

sr0: scsi3-mmc drive: 48x/48x writer cd/rw xa/form2 cdda tray

```

  But, I still get the same error:

```
localhost root # mount /mnt/dvdrw/

mount: /dev/pktcdvd0 is not a valid block device

```

.

To Cintra: Hmm, I just copied and pasted the cdrw code on the wiki, and it seems to run correctly.  The error I'm getting isn't a compilation error, just that packet writing can't be enabled on the device.  If you want, I posted my cdrw file on my website http://www.siue.edu/~tyork/cdrw

----------

## NeddySeagoon

PenguinPowered,

I just have the bare tools, no scripts or anything and I'm getting the same error. Its the first time I have used a kernel with the packet writing patch. gentoo-dev-sources 2.6.10-r1

----------

## dsd

did you create a filesystem on the packet device? no need for any other scripts, just do:

emerge =udftools-1.0.0b-r4

pktsetup devname /dev/hdc

mkudffs /dev/pktcdvd/devname

mount -t udf -o rw,noatime /dev/pktcdvd/devname /mnt/cdrom

note that the pktsetup stage is needed on every bootup. and use the appropriate /dev device instead of /dev/hdc (the one for your cd writer)

----------

## PenguinPowered

Thanks.  I'm away from home now, so I'll have to wait until morning to try that.

----------

## Cintra

my problem is solved.. 

I copied the cdrw script again from wiki page dated Jan 2nd and did:

```
# chown root.daemon /etc/init.d/cdrw

# chmod 0770 /etc/init.d/cdrw

# mknod /dev/pktcdvd0 b 97 0

#  /etc/init.d/cdrw start

 * Re-caching dependency info (mtimes differ)...

 * Enabling CD-RW packet writing on /dev/hdc ...                                                            [ ok ]
```

and I was in business again...

regards

----------

## Swoosh

 *Cintra wrote:*   

> my problem is solved.. 
> 
> 

 

I'm interested in getting packet writing setup.

What media are you using? And which kernel?

----------

## NeddySeagoon

Swoosh,

The patch is in gentoo-dev-sources 2.6.10-r1.

It only works on RW media at the moment. Thats CD-RW, DVD-RW and DVD+RW. However DVD+RW is a real random access disk, you you can just put a UDF filesystem on it and use it like a hard drive.

See http://fy.chalmers.se/~appro/linux/DVD+RW/

----------

## Cintra

 *Swoosh wrote:*   

>  *Cintra wrote:*   my problem is solved.. 
> 
>  
> 
> I'm interested in getting packet writing setup.
> ...

 

Hei Swoosh

I'm using development-sources 2.6.10 and have tested with Verbatim DataLifePlus Hi-speed 8x-10x 700MB CD-RW media on a NEC ND-1100A and  similar Verbatim 2.4x certified DVD+RW media. 

However since writing the above post I ran a tough test - copying the portage folder to DVD+RW.. this started off well, but Konqueror's progress indicator stalled frequently, as writing continued, but at the 75% completion mark progress indication stalled completely. Writing continued for around 90 minutes when I saw Kdiskfree indicating 88MB free space on the dvd... not quite sure what caused that as only 2.7GB of my 3.7GB portage partition is used!

Eventually, the NEC's writing indicators stopped blinking, but I was unable to unmount or eject the media. So, success with this rather tough test was not 100%.. tho' it did appear to have copied the folder with its 17000 sub-folders and 88000 files OK. 

Packet writing on Linux has certainly come quite a long way, and casual drag & drop, which is what I used on XP, works fine. 

regards

----------

