DVD+/-RW writing without packet writing (old)

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
User avatar
Headrush
Watchman
Watchman
Posts: 5597
Joined: Thu Nov 06, 2003 12:48 am
Location: Bizarro World

DVD+/-RW writing without packet writing (old)

Post by Headrush »

Seems to be a little confusion about the new packet writing features in some newer kernels.

Because the DVD+RW format allows a true UDF file system, you can write to them without using packet writing.
You do not need to apply any packet writing patches to the kernel to use this method of DVD+RW writing.

I'll explain how I have it running.
  1. Make sure to you compile UDF support into your kernel.
    File systems -> CD-ROM/DVD File Systems
  2. Edit you /etc/fstab and make sure you have two entries. One for accessing DVD in "normal" mode and one for accessing in writing mode.

    Code: Select all

    /dev/hdb                /mnt/dvdrw      udf             noauto,noatime,unhide,users,rw          0 0
    /dev/hdb                /mnt/cdrom      auto            noauto,noatime,ro,users                 0 0
    
    My burner device location is /dev/hdb. Change this to point to your burner location.
  3. Make sure you have the folder needed for the mount points.

    Code: Select all

    mkdir /mnt/cdrom
    mkdir /mnt/dvdrw
    
  4. To format a new disc

    Code: Select all

    dvd+rw-format /dev/hdb
    mkudffs /dev/hdb
    dvd+rw-format is from the dvd+rw-tools package and mkudffs is from the udftools package which you may need to emerge.
    The media must NOT be mounted when you perform these commands.
  5. Mount the writeable disc and change permissions.

    Code: Select all

    mount /dev/hdb /mnt/dvdrw
    chmod a+rw /mnt/dvdrw
    You only have to change the permissions the first time you mount the writeable disc.
  6. You should now be able to copy to the folder as any user now.
  7. Make sure to unmount the disc when done.
  8. For KDE users, make two device icons on your desktop. One for DVDROM access and one for DVD+RW access.
    (You can name them whatever you want)
    Under the device properties both will point to /dev/hdb, but the mount points will be different.
    In addition make sure to unclick the read-only property for the writer. You can now use the desktop icons to mount and unmount both.
  9. As mentioned by NeddySeagoon, Every rw mount costs a superblock write and the media life is only about 1000 writes. When the superblock is dead, the data is gone. So tried to minimize your number of mounts. Either mount only when you needed to write or leave mounted if you leave your system on.
The definitive reference that explains UDF/DVD+RW burning is at http://fy.chalmers.se/~appro/linux/DVD+RW/

Edit: This is probably outdated and/or requires changes due to the advances with media mounting included in the newest DEs.
Last edited by Headrush on Wed Dec 21, 2005 12:58 am, edited 14 times in total.
User avatar
NeddySeagoon
Administrator
Administrator
Posts: 56071
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

Post by NeddySeagoon »

jubenvi,

You should only mount your DVD+RW read/write when you want to write to it. Every rw mount costs a superblock write and the media life is only about 1000 writes.
When the superblock is dead, the data is gone.

There is a good reference here, if you have not found it.
http://fy.chalmers.se/~appro/linux/DVD+RW/
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
User avatar
Headrush
Watchman
Watchman
Posts: 5597
Joined: Thu Nov 06, 2003 12:48 am
Location: Bizarro World

Post by Headrush »

NeddySeagoon wrote:jubenvi,

You should only mount your DVD+RW read/write when you want to write to it. Every rw mount costs a superblock write and the media life is only about 1000 writes.
When the superblock is dead, the data is gone.
That is why I have the two mount points. Maybe I should add that.
NeddySeagoon wrote:There is a good reference here, if you have not found it.
http://fy.chalmers.se/~appro/linux/DVD+RW/
Ya, I've read that several times. I thought I would try to explain because it there stills seems to be some confusion. :-)
User avatar
NeddySeagoon
Administrator
Administrator
Posts: 56071
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

Post by NeddySeagoon »

jubenvi,

I saw your two mount points but they both contain the rw option.
You can mount the media read only as often as you like. There is a feature in the UDF filesystem that makes the media as 'dirty' on a rw mount. Thats what costs the write, even if nothing has changed.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
User avatar
Headrush
Watchman
Watchman
Posts: 5597
Joined: Thu Nov 06, 2003 12:48 am
Location: Bizarro World

Post by Headrush »

NeddySeagoon, that rw on /mnt/cdrom was a typo, good catch.

So only a read-write mount costs a superblock. Do you think that is clear enough in instructions?
User avatar
NeddySeagoon
Administrator
Administrator
Posts: 56071
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

Post by NeddySeagoon »

jubenvi,

Yep. Looks good to me now.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
User avatar
Cintra
Advocate
Advocate
Posts: 2111
Joined: Sat Apr 03, 2004 3:49 pm
Location: Norway

Post by Cintra »

Well guys. I learnt something new today! :-)

Thanks for the clear description.. its working fine on small stuff. Will be interesting to see how large files are handled..

regards

Edit.. is awfully slow unmounting UDF and mounting nonUDF. I have copied some music folders OK, but playback hangs now and then, whereas packet writing is without these drawbacks. What is your experience?
"I am not bound to please thee with my answers" W.S.
User avatar
Headrush
Watchman
Watchman
Posts: 5597
Joined: Thu Nov 06, 2003 12:48 am
Location: Bizarro World

Post by Headrush »

Cintra wrote:Edit.. is awfully slow unmounting UDF and mounting nonUDF. I have copied some music folders OK, but playback hangs now and then, whereas packet writing is without these drawbacks. What is your experience?
Could be the mount is slow due to the use of auto for filesystems in the fstab file. On my system it is as fast as before.

Probably slow on unmount because the burner is finishing writing its buffer/cache.
User avatar
NeddySeagoon
Administrator
Administrator
Posts: 56071
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

Post by NeddySeagoon »

Cintra,

The umount after a write can be slow because of the associated sync.
Depending on what else the system is doing, the actual write to the media can be delayed. Also, if the media is new, it must be formatted. This is not always the 'background' operation it is claimed to be, so you have to wait for a part format too.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
User avatar
Cintra
Advocate
Advocate
Posts: 2111
Joined: Sat Apr 03, 2004 3:49 pm
Location: Norway

Post by Cintra »

Thanks Neddy (makes me laugh every time I think of him)

I'm aware of the delays from playing a lot with InCD on XP.. anyway I'll play around with this UDF method a while. Something is not good tho'.

I apparently copied two music folders to my /mnt/udfwrite but after unmounting and finally mounting my 'ro' /mnt/nonUDF I find one of the folders contains no music files. the other does, but one of the tracks has been shortened to 10 seconds or so.. dead odd.

To test the music files I shouldn't have unmounted come to think of it. Playing them back wouldn't have affected the mount count wear issue.

mvh
"I am not bound to please thee with my answers" W.S.
User avatar
Cintra
Advocate
Advocate
Posts: 2111
Joined: Sat Apr 03, 2004 3:49 pm
Location: Norway

Post by Cintra »

jubenvi wrote:
Cintra wrote:Edit.. is awfully slow unmounting UDF and mounting nonUDF. I have copied some music folders OK, but playback hangs now and then, whereas packet writing is without these drawbacks. What is your experience?
Could be the mount is slow due to the use of auto for filesystems in the fstab file. On my system it is as fast as before.

Probably slow on unmount because the burner is finishing writing its buffer/cache.
What make of dvd burner do you have jubenvi?

And how do you prepare a dvd+rw for udf writing, which already has been used for packet writing?
"I am not bound to please thee with my answers" W.S.
User avatar
Headrush
Watchman
Watchman
Posts: 5597
Joined: Thu Nov 06, 2003 12:48 am
Location: Bizarro World

Post by Headrush »

Cintra wrote:What make of dvd burner do you have jubenvi?

And how do you prepare a dvd+rw for udf writing, which already has been used for packet writing?
Cintra, I'm using a Sony 500DRU. (I'm not out of town right now, but I'm pretty sure that is it. I check for sure later tonight)

I'm pretty sure I used the mkudffs command right over a disc that had data on it before. It was data burned with K3B and growisofs and not packet writing. I'll check later tonight and get back to you.

I have removed packet writing all together.

I predomintely use DVD+RW and only use CD-R for iso images when needed, so its just easier to save a couple hundred megs in a folder and burn to the DVD every so often. No need to fool around with packet writing, and dev entries and stuff like that.
User avatar
Cintra
Advocate
Advocate
Posts: 2111
Joined: Sat Apr 03, 2004 3:49 pm
Location: Norway

Post by Cintra »

Thanks for your reply jubenvi

I decided to order a NEC 3520A today, my old NEC 1100A being a bit outdated

I have also hashed packet writing for now, in case it was conflicting with the UDF writing alternative. But I still have trouble with the latter, the most frustrating being when its impossible to mount or unmount the device. Still more testing required.. ;-)

regards
"I am not bound to please thee with my answers" W.S.
User avatar
Headrush
Watchman
Watchman
Posts: 5597
Joined: Thu Nov 06, 2003 12:48 am
Location: Bizarro World

Post by Headrush »

Cintra wrote:But I still have trouble with the latter, the most frustrating being when its impossible to mount or unmount the device. Still more testing required.. ;-)

regards
How are you trying to unmount the disc? Command line or desktop device icon?

My drive is a Sony DRU-500A and it works fine.
Are there any errors when you unmount in dmesg or it just doesn't do it?
Does it just take a very long time to unmount or it doesn't unmount at all?
User avatar
Headrush
Watchman
Watchman
Posts: 5597
Joined: Thu Nov 06, 2003 12:48 am
Location: Bizarro World

Post by Headrush »

Cintra, I did some further tests and everything seems to work perfectly.

Worked properly with command line and desktop icons. I copied a 700MB video and immediately unmounted the disc. Took a minute or so to sync up, but worked fine and unmounted.

You are formating when the disc is unmounted?
Did you change the permissions of the mount directory after the first mount?

Good Luck.
User avatar
Cintra
Advocate
Advocate
Posts: 2111
Joined: Sat Apr 03, 2004 3:49 pm
Location: Norway

Post by Cintra »

Discovered a bunch of errors, including DMA not set on hdc, which is odd because in conf.d/hdparm I have:

Code: Select all

hda_args="-m8 -u1 -c1 -d1"
hdb_args="-m8 -u1 -c1 -d1"
hdc_args="-qd1"
hdd_args="-qd1"
and

Code: Select all

# hdparm -i /dev/hdc

/dev/hdc:

 Model=_NEC DVD+RW ND-1100A, FwRev=1.A1, SerialNo=
 Config={ Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=0kB, MaxMultSect=0
 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
 IORDY=yes, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 *udma2
 AdvancedPM=no
so I clearly need better settings for hdc... BuffSize=0kB ?

regards

EDIT: after re-setting dma the first folder copy was very fast. The next stalled and I found dma had been cleared again... very strange!
EDIT2: I'm running exhaustive media tests on XP at present, and it looks as though I have been unlucky enough to have used the only faulty media amongst my collection! :-(
Will now retry with new/tested media.
"I am not bound to please thee with my answers" W.S.
User avatar
Headrush
Watchman
Watchman
Posts: 5597
Joined: Thu Nov 06, 2003 12:48 am
Location: Bizarro World

Post by Headrush »

Cintra wrote:so I clearly need better settings for hdc... BuffSize=0kB ?
Cintra, I'm not sure that means much for removeable media.
My output is almost identical.

Code: Select all

hdparm -i /dev/hdb

/dev/hdb:

 Model=SONY DVD RW DRU-500A, FwRev=2.1a, SerialNo=DA4D3671
 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=0kB, MaxMultSect=0
 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
 IORDY=on/off, tPIO={min:180,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 *udma2
 AdvancedPM=no
 Drive conforms to: device does not report version:

 * signifies the current active mode
and everything works fine. That's weird that it is resetting your dma.

By the way, I am using gentoo-dev-sources-2.6.10-r1 and udftools-1.0.0b-r4
User avatar
Cintra
Advocate
Advocate
Posts: 2111
Joined: Sat Apr 03, 2004 3:49 pm
Location: Norway

Post by Cintra »

Thanks again jubenvi

I'm taking a rest until my new NEC turns up, since I'm getting nowhere fast, even with new Verbatim DVD+RW media.

btw, I have development-sources 2.6.10 & the same udftools as you.

regards
"I am not bound to please thee with my answers" W.S.
User avatar
fs_mariner
n00b
n00b
Posts: 45
Joined: Sat Jun 12, 2004 7:48 am

Great howto

Post by fs_mariner »

Thanks... wonderful information! For any beginners like me... I had to emerge udftools obviously to run mkudffs, following the guide.

Also, what kernel are you running? I get an error running mkudffs and after googling the error I found that some people are saying you need a udf packet-writing patch on your kernel. Does this sound right?

I'm running a vanilla 2.6.10 kernel.

bash-2.05b# mkudffs /dev/hdc
trying to change type of multiple extents


(No spinup even happens on my drive.)
Earth wanderer on the beautiful sailing vessels "spiritwind", "friendship", and "wavesofgrace"
User avatar
Cintra
Advocate
Advocate
Posts: 2111
Joined: Sat Apr 03, 2004 3:49 pm
Location: Norway

Post by Cintra »

Hei fs_mariner

the gentlemen above are better qualified ref UDF writing, with which I so far have had little success. On the other hand I do now have packet writing working well to dvd+rw on development-sources-2.6.10 with no patches at all. See the thread on packet writing at http://forums.gentoo.org/viewtopic.php? ... 11#1941111

regards

btw, I did see your error

Code: Select all

bash-2.05b# mkudffs /dev/hdc
trying to change type of multiple extents 
I believe it was just before I sorted out packet writing.
"I am not bound to please thee with my answers" W.S.
User avatar
andyknownasabu
Apprentice
Apprentice
Posts: 281
Joined: Thu Feb 06, 2003 3:21 pm
Location: Zurich, Switzerland

Post by andyknownasabu »

jubenvi wrote:
Cintra wrote:so I clearly need better settings for hdc... BuffSize=0kB ?
Cintra, I'm not sure that means much for removeable media.
My output is almost identical...
Well, I don't know if it really doesn't matter... I have quite the same output but k3b cannot tell how full the buffer is while burning a dvd. I don't think this is correct or wanted...
Last edited by andyknownasabu on Wed Jan 12, 2005 4:15 pm, edited 1 time in total.
Please, also have a look at:
Global Marshall Plan Initiative
http://www.globalmarshallplan.org/
User avatar
Headrush
Watchman
Watchman
Posts: 5597
Joined: Thu Nov 06, 2003 12:48 am
Location: Bizarro World

Post by Headrush »

andyknownasabu wrote:Well, I don't know if it really doesn't matter... I have quite the same output but k3b cannot tell how full the buffer is while burning a dvd. I don't think this is correct or wanted...
Can't be 100% sure, but I think it was on the K3b forum where I read the buffer feature doesn't work when burning some types of DVD with K3B. Has to do with how growisofs works or something to that effect.
()
l33t
l33t
Posts: 610
Joined: Mon Nov 25, 2002 4:10 pm

Re: Great howto

Post by () »

fs_mariner wrote:Also, what kernel are you running? I get an error running mkudffs and after googling the error I found that some people are saying you need a udf packet-writing patch on your kernel. Does this sound right?

I'm running a vanilla 2.6.10 kernel.

bash-2.05b# mkudffs /dev/hdc
trying to change type of multiple extents
I have the exact same problem, nitro-sources-2.6.10-r4 kernel and a NEC nd-3500 writer. From what I understood I shouldn't have to set up the device for packet writing (the solution I found by googling suggests this)?
to be concerned is good
User avatar
Headrush
Watchman
Watchman
Posts: 5597
Joined: Thu Nov 06, 2003 12:48 am
Location: Bizarro World

Re: Great howto

Post by Headrush »

fs_mariner wrote:Also, what kernel are you running? I get an error running mkudffs and after googling the error I found that some people are saying you need a udf packet-writing patch on your kernel. Does this sound right?
Packet writing and udf writing are two separate things.

It's all explained at http://fy.chalmers.se/~appro/linux/DVD+RW/

I can assure you 100% that you DO NOT need a packet writing patch to the kernel to write to DVD+RW media. I am doing it right now! :-)

I am using gentoo-dev-sources-2.6.10-r4
User avatar
Cintra
Advocate
Advocate
Posts: 2111
Joined: Sat Apr 03, 2004 3:49 pm
Location: Norway

Re: Great howto

Post by Cintra »

() wrote:
fs_mariner wrote:Also, what kernel are you running? I get an error running mkudffs and after googling the error I found that some people are saying you need a udf packet-writing patch on your kernel. Does this sound right?

I'm running a vanilla 2.6.10 kernel.

bash-2.05b# mkudffs /dev/hdc
trying to change type of multiple extents
I have the exact same problem, nitro-sources-2.6.10-r4 kernel and a NEC nd-3500 writer. From what I understood I shouldn't have to set up the device for packet writing (the solution I found by googling suggests this)?
You'll get the extents error if the disk is mounted when you run mkudffs.. btw, this thread is about dvd+rw without packet writing.

if you want packet writing see http://forums.gentoo.org/viewtopic.php? ... 11#1941111
I have it working fine on development-sources-2.6.10-r1 with no patches.

mvh
"I am not bound to please thee with my answers" W.S.
Post Reply