multisession DVD with growisofs: possible or impossible?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
dariusdor
Posts: 114
Joined: 2014-01-02 23:42

multisession DVD with growisofs: possible or impossible?

#1 Post by dariusdor »

The Background

Today I tried to burn a multisession DVD using the .deb version of growisofs.

First command, to burn first session:

Code: Select all

growisofs -speed=4 -Z /dev/sr1 \
 -r -udf -v -hide-rr-moved \
\
 -V "LABEL1" \
 -allow-limited-size \
 --graft-points \
 first_dir=first_dir
Second command, to burn second session:

Code: Select all

growisofs -speed=4 -M /dev/sr1 \
 -r -udf -v -hide-rr-moved \
\
 -V "LABEL2" \
 -allow-limited-size \
 --graft-points \
 second_dir=second_dir
Afterword, upon mounting, only the first session was visible, yet the volume label was that which had been specified on the second session.

Googling has revealed contradictory information: links saying that multisession is impossible for DVDs yet also links saying to use "-Z" for the first session and "-M" for the second session as per the growisofs man page.

My Actual Questions

One: is it actually possible to burn multi-session on DVDs?

Two: if so, what did I do wrong in my command-lines?

Thank you in advance.


p.s. Using Debian Jessie 64-bit, in case that makes a difference?
The really successful criminals never break laws. They make them.

peter_irich
Posts: 1409
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 12 times

Re: multisession DVD with growisofs: possible or impossible?

#2 Post by peter_irich »

For multisession DVD creating you must use growisofs in conjunction with genisoimage option "-C last_sess_start,next_sess_start",
see "man genisoimage" and take care on "-M" option.

Peter.

scdbackup
Posts: 24
Joined: 2014-02-19 09:29

Re: multisession DVD with growisofs: possible or impossible?

#3 Post by scdbackup »

Hi,

> One: is it actually possible to burn multi-session on DVDs?

Nearly all types can be used for that.
Exceptions are DVD-R DL and fastly blanked unformatted DVD-RW.

The sequential ones do it by hardware: DVD-R, DVD+R (DL),
unformatted DVD-RW.

growisofs emulates multi-session on overwritable ones:
DVD-RAM, DVD+RW, formatted DVD-RW.
This emulation adds the new files to the ISO and overwrites
the superblock (PVD). So there appears to be only one session
on the medium which bears the files of both sessions and the
volume ID of the last session.


> Two: if so, what did I do wrong in my command-lines?

I cannot judge the impact of -udf on multi-session.
But i know that growisofs does not overwrite the UDF anchor
block. So i assume that mounting as UDF still yields the
root directory of session 1.

Elsewise the commands look ok.

Did you try to force mounting as ISO 9660 (and not as UDF) ?

Code: Select all

mount -t iso9660 /dev/sr1 /mnt/... 
Do the files of session 2 appear then ?

What do you get from not mounted /dev/sr1 by

Code: Select all

xorriso -indev /dev/sr1 -toc 
(Are there two "ISO session" lines ending by "LABEL1" and
"LABEL2" ?)


Further you can try burning without -udf or with my program
xorriso:

Code: Select all

xorriso -outdev /dev/sr1 -speed 4 -blank as_needed \
        -volid "LABEL1" \
        -map first_dir /first_dir \
        -find / -exec mkisofs_r --

xorriso -dev /dev/sr1 -speed 4 \
        -volid "LABEL2" \
        -map second_dir /second_dir \
        -find / -exec mkisofs_r -- 
(Sequence of xorriso arguments matter. Do not put -find
before -map here.)

UDF filesystems are not produced by xorriso.
So -udf and the (weird) -allow-limited-size cannot be
expressed. In return you get ISO level 3 by default.
I.e. no problem with large files at least when mounted on
contemporary Linux or MS-Windows.

The -find command of xorriso changes the access permissions
of the data files like mkisofs option -r does.


Have a nice day :)

Thomas

dariusdor
Posts: 114
Joined: 2014-01-02 23:42

Re: multisession DVD with growisofs: possible or impossible?

#4 Post by dariusdor »

Poop, I reused the dvd (rewritable, for testing) before I saw your post. It will be a while before I can try again. Thank you for the info, though. :)
The really successful criminals never break laws. They make them.

dariusdor
Posts: 114
Joined: 2014-01-02 23:42

Re: multisession DVD with growisofs: possible or impossible?

#5 Post by dariusdor »

Allrighty, mananged to try some stuff based on the new info from the replies (thank you again). :)
  • If I burn two sessions as I did before, and then mount the DVD with the "-t iso9660" option, files/dirs of both sessions are visible. Fascinating! This would never had occurred to me. :p
  • The wodim thing always returns "0,0". Root or non root, burned with UDF or without. This makes the -C option of genisoimage and/or growisofs unusuable.
  • the "xorriso -indev /dev/sr1 -toc" command yeilds results that seem to only see one session:

    Code: Select all

    bob@azura:~$ xorriso -indev /dev/sr1 -toc
    xorriso 1.3.2 : RockRidge filesystem manipulator, libburnia project.
    
    xorriso : NOTE : Loading ISO image tree from LBA 0
    xorriso : UPDATE : 200 nodes read in 1 seconds
    xorriso : UPDATE : 1359 nodes read in 1 seconds
    Drive current: -indev '/dev/sr1'
    Media current: DVD+RW
    Media status : is written , is appendable
    Media summary: 1 session, 74981 data blocks,  146m data, 4336m free
    Volume id    : 'FWAA2'
    Drive current: -indev '/dev/sr1'
    Drive type   : vendor 'HL-DT-ST' product 'DVDRAM SP60NB50' revision '1.00'
    Media current: DVD+RW
    Media product: RICOHJPN/W11/49 , Ricoh Company Limited
    Media status : is written , is appendable
    Media blocks : 75008 readable , 2220096 writable , 2295104 overall
    TOC layout   : Idx ,  sbsector ,       Size , Volume Id
    ISO session  :   1 ,         0 ,     74981s , FWAA2
    Media summary: 1 session, 74981 data blocks,  146m data, 4336m free
    Media nwa    : 75008s
    bob@azura:~$
  • Burning as I had been doing before, but with the UDF options taken out yeilds a correct multi-session DVD with all files/dirs visible. This is using -Z for the first session and -M for the second. This is without any -C option.
The conclusing seems to be that burning without UDF (but with the rock ridge extensions of -r) is a solution.

What I will need to investigate is the iso level 3 with intent to be able to burn files larger than 4 gig. Up until recent replies, I had thought UDF was the only way to correctly get huge files. The long-term goal here is to be able to burn Blu Ray as multi-session, because a full 25 gig burn can take a long time. :o
The really successful criminals never break laws. They make them.

scdbackup
Posts: 24
Joined: 2014-02-19 09:29

Re: multisession DVD with growisofs: possible or impossible?

#6 Post by scdbackup »

Hi,
mount the DVD with the "-t iso9660" option, files/dirs of
both sessions are visible.
Fascinating! This would never had occurred to me. :p
That's why those filesystems are called hybrids. They have more than one superblock, each leading to
an own directory tree. The data file content is shared between those trees.

The wodim thing always returns "0,0".
That's because you use DVD+RW, which is a medium type that does no multi-session by hardware. growisofs (and xorriso) overwrite the ISO 9660 superblock that corresponds to -C 0,x in order to force the mounting operating systems into reading the youngest ISO 9660 directory tree. They take the Next Writable Address (the second parameter of -C) from the inspection of the previous superblock, which they overwrite at the end of the burn process.

wodim actually is not really suitable for DVD.
cdrecord may meanwhile do multi-session on sequential media (i did not follow its DVD
evolution since 2006).
If you want a cdrecord-ish command line interface with DVD and BD, use (my) cdrskin or xorrecord.

This makes the -C option of genisoimage and/or growisofs unusuable.
growisofs knows what to do and how to let genisoimage, mkisofs, or xorrisofs produce the correct offset.

the "xorriso -indev /dev/sr1 -toc" command yeilds results that seem to only see one session
That's because growisofs starts the first session at -C 0,0 and overwrites its superblock after every new session.

xorriso (in its personality as itself) starts at the equivalent of -C 0,32 and writes a copy of that superblock to the address that matches -C 0,0. The following sessions do not overwrite the -C 0,32 superblock. This superblock can tell xorriso where the session ends and thus where the superblock of the next session is stored. So it can hop along that list up to the last session.

A DVD+RW started by xorriso may then yield

Code: Select all

ISO session  :   1 ,        32 ,    847268s , HOME_Z_2014_12_19_224055
ISO session  :   2 ,    847328 ,     19065s , HOME_Z_2014_12_21_232632
...
ISO session  :  14 ,   1214976 ,     40614s , HOME_Z_2015_01_04_221807
Media summary: 14 sessions, 1255322 data blocks, 2452m data, 2030m free
Burning as I had been doing before, but with the UDF options taken out yeilds a correct multi-session DVD with all files/dirs visible. This is using -Z for the first session and -M for the second. This is without any -C option.
man growisofs states that growisofs will construct -C for you.

Ok. We learn that growisofs does no UDF multi-session emulation on overwritables (DVD-RAM, DVD+RW, formatted DVD-RW, BD-RE).

On sequential media (DVD-R, DVD+R, unformatted DVD-RW) this may be different. The operating system might then find the UDF anchor in the newest session and thus see the newest directory tree.
BD-R might be peculiar because growisofs insists in writing them in Pseudo Overwrite mode. That could create a situation like on DVD+RW.

The conclusing seems to be that burning without UDF (but with the rock ridge extensions of -r) is a solution.
Actually the problem was Linux eagerness of mounting UDF. But i am no fan of UDF anyway. So i wholeheartedly support your conclusion. ISO 9660 and Rock Ridge are best.

What I will need to investigate is the iso level 3 with intent to be able to burn files larger than 4 gig.
FreeBSD, NetBSD, (probably OpenBSD too), and Solaris fail miserably on large files in ISO 9660, i fear.
Not easy to fix them, for various reasons: fubar, not enough courage to apply my fix, (dunno), dead.

The long-term goal here is to be able to burn Blu Ray as multi-session.
Should be no problem with growisofs or xorriso.
(Except the bug https://bugs.debian.org/cgi-bin/bugrepo ... bug=713016 which can be worked around by formatting the BD-R before the first growisofs session or by use of growisofs option

Code: Select all

-use-the-force-luke=spare:none
on unformatted BD-R.)

because a full 25 gig burn can take a long time.
Especially if slow checkreading is enabled on formatted media.
One way to avoid this is xorriso command

Code: Select all

-stream_recording on
.


Have a nice day :)

Thomas

Post Reply