Discussion:
EXTERNAL: Re: Problem with growisofs -- cannot write multisession DVDs without ejecting and reloading tray
(too old to reply)
Richardson, Eric J
2015-05-11 23:19:46 UTC
Permalink
Hello Jörg,

Thank you for responding! I would be happy to use cdrtools for writing, if I could figure out how. I tried, Lord how I tried. Unfortunately, I am having less success using mkisofs and cdrecord to make a multisession DVD than I had with growisofs.

I read your howto here:
http://cdrtools.sourceforge.net/private/man/README/README.multi

Using this, I figured that I make the initial iso (raw) image with this command:

mkisofs -R -o /tmp/file.raw file1file1file1_REDHAT.txt file2file2file2_REDHAT.txt file3file3file3_REDHAT.txt

So far, so good. I write the file with:

cdrecord -v speed=2 dev=1,0,0 -multi /tmp/file.raw

So far, so good. Let's try to mount that baby:

mount /dev/sr0 /media/
mount: you must specify the filesystem type

Fine. Try it with the filesystem type:

mount -o ro -t iso9660 /dev/sr0 /media/
mount: no medium found on /dev/sr0

Okay, that's not the end of the world. I would like to be able to mount it, but what I REALLY want to do is write a second session. Let's try the msinfo to get the data for the second session:

cdrecord -msinfo dev=2,0,0
cdrecord: Warning: Cannot read drive buffer.
cdrecord: Warning: The DMA speed test has been skipped.
0,93952

Great! Let's try a mkisofs now:

mkisofs -R -C 0,93952 -M /dev/sr0 -o /tmp/file.raw file4file4file4_REDHAT.txt file5file5file5_REDHAT.txt file6file6file6_REDHAT.txt
Setting input-charset to 'UTF-8' from locale.
mkisofs: Input/output error. test unit ready: scsi sendcmd: no error
CDB: 00 00 00 00 00 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 02 00 00 00 00 0A 00 00 00 00 3A 00 00 00
Sense Key: 0x2 Not Ready, Segment 0
Sense Code: 0x3A Qual 0x00 (medium not present) Fru 0x0
Sense flags: Blk 0 (not valid)
cmd finished after 0.002s timeout 20s
mkisofs: Success. Unable to open previous session image '/dev/sr0'.

There's no file.raw, so that's an odd definition of "success." Let's try it with /dev/dvd:

mkisofs -R -C 0,93952 -M /dev/dvd -o /tmp/file.raw file4file4file4_REDHAT.txt file5file5file5_REDHAT.txt file6file6file6_REDHAT.txt
Setting input-charset to 'UTF-8' from locale.
mkisofs: Short read on old image

Fine. Let's try it with dev=2,0,0:

mkisofs -R -C 0,93952 -M dev=2,0,0 -o /tmp/file.raw file4file4file4_REDHAT.txt file5file5file5_REDHAT.txt file6file6file6_REDHAT.txt
Setting input-charset to 'UTF-8' from locale.
mkisofs: Invalid argument. Invalid bus or target specifier in 'dev=2,0,0'. Cannot open SCSI driver.
mkisofs: Invalid argument. Unable to open previous session image 'dev=2,0,0'.

Clearly that is not how I specify the device. I cannot write the second session, and am dead in the water. Just for the sake of completeness, I will reload the tray.

After ejecting and re-inserting the media, I can now mount it, but only by specifying the filesystem type. After trying several variations on writing a new rawfile, I got this:

mkisofs -R -C 0,93952 -M /dev/dvd -o /tmp/file.raw file4file4file4_REDHAT.txt file5file5file5_REDHAT.txt file6file6file6_REDHAT.txt
Setting input-charset to 'UTF-8' from locale.
ISO-9660 image includes checksum signature for correct inode numbers.
SUSP signatures version 1 found
Rock Ridge signatures version 1 found
Rock Ridge id 'RRIP_1991A'
Total translation table size: 0
Total rockridge attributes bytes: 821
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
178 extents written (0 MB)

Super! Let's write the new rawfile to the disk:

cdrecord -v speed=2 dev=2,0,0 -multi /tmp/file.raw
cdrecord: No write mode specified.
cdrecord: Assuming -tao mode.
cdrecord: Future versions of cdrecord may have different drive dependent defaults.
Cdrecord-ProDVD-ProBD-Clone 3.01a27 (x86_64-unknown-linux-gnu) Copyright (C) 1995-2015 Joerg Schilling
TOC Type: 3 = CD-ROM XA mode 2
scsidev: '2,0,0'
scsibus: 2 target: 0 lun: 0
Linux sg driver version: 3.5.34
Using libscg version 'schily-0.9'.
SCSI buffer size: 64512
atapi: 1
Device type : Removable CD-ROM
Version : 5
Response Format: 2
Capabilities :
Vendor_info : 'TSSTcorp'
Identifikation : 'CDDVDW TS-H653B '
Revision : 'SI01'
Device seems to be: Generic mmc2 DVD-R/DVD-RW/DVD-RAM.
Current: DVD-R sequential recording
Profile: DVD-R/DL sequential recording
Profile: DVD-R/DL layer jump recording
Profile: DVD+R/DL
Profile: DVD+R
Profile: DVD+RW
Profile: DVD-RW sequential recording
Profile: DVD-RW restricted overwrite
Profile: DVD-RAM
Profile: DVD-R sequential recording (current)
Profile: DVD-ROM
Profile: CD-RW
Profile: CD-R
Profile: CD-ROM
Profile: Removable Disk
Using generic SCSI-3/mmc-2 DVD-R/DVD-RW/DVD-RAM driver (mmc_dvd).
Driver flags : NO-CD DVD MMC-3 SWABAUDIO BURNFREE
Supported modes: PACKET SAO LAYER_JUMP
Drive buf size : 1376256 = 1344 KB
cdrecord: Warning: Cannot read drive buffer.
cdrecord: Warning: The DMA speed test has been skipped.
FIFO size : 4194304 = 4096 KB
Track 01: data 0 MB padsize: 244 KB
Total size: 0 MB = 300 sectors
Current Secsize: 2048
WARNING: Phys disk size 304 differs from rzone size 0! Prerecorded disk?
WARNING: Phys start: 196608 Phys end 196911
WARNING: Drive returns zero media size. Using media size from ADIP.
Blocks total: 304 Blocks current: -93648 Blocks remaining: -93948
cdrecord: Data does not fit on current disk.

No dice. I believe cdrecord must work at least as well as growisofs -- i.e., I should be able to write a second session to the disk, if only after reloading the tray -- so I must be doing something wrong. But I can't for the life of me figure out what.

Thanks again for your help! If I AM doing something wrong, I would love to know. If not, please enjoy Tigger, who needs a bath but does not want one:



-Eric J. Richardson

-----Original Message-----
From: Joerg Schilling [mailto:***@fokus.fraunhofer.de]
Sent: Friday, May 08, 2015 8:56 AM
To: cdrtools-***@lists.sourceforge.net; Richardson, Eric J; ***@other.debian.org
Subject: EXTERNAL: Re: Problem with growisofs -- cannot write multisession DVDs without ejecting and reloading tray
http://fy.chalmers.se/~appro/linux/DVD+RW/
suggests I start here anyway.
Do you know that growisofs is unmaintained since 7 years?
http://negativo17.org/cdrtools/
Linux 2.6.32-504.8.1.el6.x86_64
mkisofs 3.01a27 (x86_64-unknown-linux-gnu) Copyright (C) 1993-1997
Eric Youngdale (C) 1997-2015 Joerg Schilling
front-ending to mkisofs: mkisofs 3.01a27 (x86_64-unknown-linux-gnu)
Copyright (C) 1993-1997 Eric Youngdale (C) 1997-2015 Joerg Schilling
Cdrecord-ProDVD-ProBD-Clone 3.01a27 (x86_64-unknown-linux-gnu)
Copyright (C) 1995-2015 Joerg Schilling
If you have a recent cdrtools installed, why don't you use it for writing?

Unlike growisofs, cdrtools is actively maintained.

If you have problems with cdrtools, this can be fixed....

You would need to send a bug report - I am not aware of problems in the recent version.

Jörg
--
EMail:***@schily.net (home) Jörg Schilling D-13353 Berlin
***@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/'
--
To UNSUBSCRIBE, email to cdwrite-***@other.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@other.debian.org
Archive: https://lists.debian.org/***@HDXDSP51.us.lmco.com
Richardson, Eric J
2015-05-12 19:20:02 UTC
Permalink
It seems that you are using the wrong devices.....
You started with dev=1,0,0, why did you try to use a different device later on?
Post by Richardson, Eric J
cdrecord -v speed=2 dev=1,0,0 -multi /tmp/file.raw
But the later ones I copied directly from the screen. I am not really switching devices; I just got the machines confused when I typed the first command.
Given the fact that you did not report about errors from the first write process, I assume that you used the right device.
Yes, I use dev=2,0,0 for the initial cdrecord. I got this number from cdrecord -scanbus. Using this device does not generate any errors.
Given the fact that you could not mount the device, I assume that you used the wrong UNIX device name.
I use /dev/sr0 to mount the device. I cannot mount the drive, using /dev/sr0 OR /dev/dvd, after the first write without manually reloading the tray. After I reload the tray, /dev/sr0 mounts just fine. I cannot perform the second write at all, as I said. From reading the man page, I think I am supposed to use the UNIX device name with the -M in mkisofs, but mkisofs does not like /dev/sr0. It did attempt to write when I used /dev/dvd, which is a link to /dev/sr1, but I don't know enough about Linux device names to know why. As I said in my first email, the attempt to write was unsuccessful.
If there is only on CD-ROM type device on your machine, cdrecord will use the right one without a need to specify dev= - read the man pages....
Yes, I read that in the man pages, but there is a second CD-ROM device that confuses things. The KVM that this machine is on attaches a "bonus" device via USB, which for some reason shows up as a CD drive at 0,0,0. This is why I specify the dev.


-Eric J. Richardson

-----Original Message-----
From: Joerg Schilling [mailto:***@fokus.fraunhofer.de]
Sent: Tuesday, May 12, 2015 3:50 AM
To: Richardson, Eric J; ***@other.debian.org; cdrtools-***@lists.sourceforge.net
Subject: Re: EXTERNAL: Re: Problem with growisofs -- cannot write multisession DVDs without ejecting and reloading tray
Hello Jörg,
Thank you for responding! I would be happy to use cdrtools for writing, if I could figure out how. I tried, Lord how I tried. Unfortunately, I am having less success using mkisofs and cdrecord to make a multisession DVD than I had with growisofs.
http://cdrtools.sourceforge.net/private/man/README/README.multi
mkisofs -R -o /tmp/file.raw file1file1file1_REDHAT.txt
file2file2file2_REDHAT.txt file3file3file3_REDHAT.txt
cdrecord -v speed=2 dev=1,0,0 -multi /tmp/file.raw
mount /dev/sr0 /media/
mount: you must specify the filesystem type
mount -o ro -t iso9660 /dev/sr0 /media/
mount: no medium found on /dev/sr0
cdrecord -msinfo dev=2,0,0
cdrecord: Warning: Cannot read drive buffer.
cdrecord: Warning: The DMA speed test has been skipped.
0,93952
mkisofs -R -C 0,93952 -M /dev/sr0 -o /tmp/file.raw
file4file4file4_REDHAT.txt file5file5file5_REDHAT.txt file6file6file6_REDHAT.txt Setting input-charset to 'UTF-8' from locale.
mkisofs: Input/output error. test unit ready: scsi sendcmd: no error
CDB: 00 00 00 00 00 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 02 00 00 00 00 0A 00 00 00 00 3A 00 00 00 Sense
Key: 0x2 Not Ready, Segment 0 Sense Code: 0x3A Qual 0x00 (medium not
present) Fru 0x0
It seems that you are using the wrong devices.....

You started with dev=1,0,0, why did you try to use a different device later on?

What if the correct UNIX device name for SCSI dev=1,0,0 on your machine?

I recommend you to start with a

cdrecord -scanbus

If there is only on CD-ROM type device on your machine, cdrecord will use the right one without a need to specify dev= - read the man pages....

If you like to access the block device (e.g. four mounting), you need to know the UNIX device name, I hope that you know the right names for your machine.

Given the fact that you did not report about errors from the first write process, I assume that you used the right device. Given the fact that you could not mount the device, I assume that you used the wrong UNIX device name.

Jörg
--
EMail:***@schily.net (home) Jörg Schilling D-13353 Berlin
***@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/'
--
To UNSUBSCRIBE, email to cdwrite-***@other.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@other.debian.org
Archive: https://lists.debian.org/***@HDXDSP51.us.lmco.com
Richardson, Eric J
2015-05-13 23:38:25 UTC
Permalink
Hi Thomas,

As always, thank you for your helpful responses.
The new session adds a new superblock, a new complete directory tree, and the content of data files which were newly added or overwritten by the session.
Ohhhh that makes sense. I was thinking that the entire DVD had one superblock at the beginning, and that couldn't be right, because how would it get updated?
But as said, mounting older sessions imight be desirable with incremental backups. E.g. if i want to mount the backup state of three days ago,
I hadn't thought of that as a possible use. We always date our backups and log files in the filename, so if we want an older one we just go to the file with the correct date.

A couple more questions:

I am trying to figure out if I can close a DVD without writing a new file to it. I searched the man page and came up with:

xorriso -dev /dev/sr1 -close on --

This looks like a good command -- it doesn't spit out errors as such -- but it doesn't do anything. I can still append data to the medium, so it didn't close the disk. But, if I write a file, as in:

xorriso -dev /dev/sr1 -close on -add closeme.txt --

Then the medium gets closed, and I can no longer write to it. Is this the only way to close the disk? That is, do I have to write some file if I arbitrarily decide it's time to close the disk?
The number of sessions on DVD-R is restricted to 99, on DVD+R the limit is 153.
This is very helpful to know, when combined with the number of tracks I have written. I figured out that:

xorriso -dev /dev/sr1 -status short

will give me the status that a normal write prints out without having to write anything, which is useful. It tells me how many sessions are on the disk, and how much space has been used (including padding), and how much space is left. My question is, is there a way to get the number of session left for the medium? Short of manually subtracting the number of sessions on the disk from 99, that is.

Thanks, and have a great day,

-Eric J. Richardson

-----Original Message-----
From: Thomas Schmitt [mailto:***@gmx.net]
Sent: Wednesday, May 13, 2015 12:23 AM
To: ***@other.debian.org
Cc: Richardson, Eric J
Subject: EXTERNAL: Re: Problem with growisofs -- cannot write multisession DVDs without ejecting and reloading tray

Hi,
OpenSolaris snv 134 always mounts the youngest session.
You'll have to forgive me, but I don't know what this means. Would
that mean that only the last files written can be seen, or all of them?
You see all files which you added (and did not delete later).

The capability to access older states is interesting with incremental backups.

ISO 9660 multi-session works like this:

The new session adds a new superblock, a new complete directory tree, and the content of data files which were newly added or overwritten by the session.

The older superblocks and directory trees still exist on the disc. They may point to older versions of files which got replaced by other content in further sessions, and they may contain files which were deleted from the directory tree of the younger sessions.

Operating systems by default use the youngest superblock and directory tree for mounting.

But as said, mounting older sessions imight be desirable with incremental backups. E.g. if i want to mount the backup state of three days ago, i put in my backup BD-R and do

xorriso -indev /dev/sr2 -toc

which tells me

TOC layout : Idx , sbsector , Size , Volume Id
ISO session : 1 , 0 , 1461973s , HOME_2015_01_05_130954
ISO session : 2 , 1462144 , 53613s , HOME_2015_01_06_114520
...
ISO session : 126 , 8364224 , 54847s , HOME_2015_05_10_113721
ISO session : 127 , 8419232 , 62170s , HOME_2015_05_11_120517
ISO session : 128 , 8481568 , 63170s , HOME_2015_05_12_135346
Media summary: 128 sessions, 8544896 data blocks, 16.3g data, 7177m free

If i then execute (on Linux)

mount -o sbsector=8364224 /dev/sr2 /mnt/iso

i get to see the backup state of may 10 2015, 11:37:21.

There is some convenience built in. The run

xorriso -mount_cmd /dev/sr2 volid '*_2015_05_10_*' /mnt/iso

on Linux makes this proposal of a mount command:

mount -t iso9660 -o nodev,noexec,nosuid,ro,sbsector=8364224 '/dev/sr2' '/mnt/iso'

On FreeBSD the proposal would rather look like
mount_cd9660 -o noexec,nosuid -s 8364224 '/dev/cd1' '/mnt/iso'

A privileged user may also do

xorriso -osirrox on -mount /dev/sr2 volid '*_2015_05_10_*' /mnt/iso

and have the proposed command executed directly by xorriso.
(One still has to umount manually, when done.)

My backup sessions got their volume ids with time stamp by xorriso command

-volid HOME_"$(date '+%Y_%m_%d_%H%M%S')"

when the backups were made. (See man page example "Incremental backup of a few directory trees".)
--
To UNSUBSCRIBE, email to cdwrite-***@other.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@other.debian.org
Archive: https://lists.debian.org/***@HDXDSP51.us.lmco.com
Richardson, Eric J
2015-05-14 23:39:17 UTC
Permalink
Hi Thomas,

Thank you for your responses. It is looking like we will go with xorriso, at least we will if I have anything to say about it. One last question, and then I will stop clogging up the list:

Can xorriso toggle the drive tray? That is, is there a xorriso equivalent of eject -T? Not that it matters: I can just use eject -T (on drives where this is an option). I was only curious, since the status doesn't seem to report whether the drive is open or closed.

Thank you for all your help,

-Eric J. Richardson

-----Original Message-----
From: Thomas Schmitt [mailto:***@gmx.net]
Sent: Thursday, May 14, 2015 12:47 AM
To: ***@other.debian.org
Cc: Richardson, Eric J
Subject: EXTERNAL: Re: Problem with growisofs -- cannot write multisession DVDs without ejecting and reloading tray

Hi,
Post by Richardson, Eric J
The new session adds a new superblock,
I was thinking that the entire DVD had one superblock at the
beginning, and that couldn't be right, because how would it get
updated?
This is the situation with overwritable media:
DVD+RW, DVD-RAM, BD-RE, formatted DVD-RW, formatted CD-RW,
data files, Linux block devices.

The new session gets written like with sequential media (CD-R, CD-RW, DVD-R, DVD+R, BD-R, unformatted DVD-RW) but the superblock at block offset 0 gets overwritten to lead the mounters to the youngest session.
xorriso by default creates the superblock of the first session at offset 32 and a copy at offset 0. This way the superblock at offset 32 survives the updates at offset 0 when more sessions get burned.
Post by Richardson, Eric J
I am trying to figure out if I can close a DVD without writing a new
file to it.
Interesting use case. I don't think that my stuff can do this. But i dimly remember that growisofs ...
man 1 growisofs, EXAMPLES:

"To finalize the multi-session DVD maintaining maximum compatibility:
growisofs -M /dev/dvd=/dev/zero
"
(I never tried this.)
Post by Richardson, Eric J
xorriso -dev /dev/sr1 -status short
Command -status will tell you the current settings of various xorriso commands, but nearly nothing about the medium state.

The info about the number of sessions is put out on stderr after a drive was aquired by -dev, -indev, or -outdev.

$ xorriso -outdev /dev/sr2 2>&1 | grep '^Media summary:'
Media summary: 129 sessions, 8597504 data blocks, 16.4g data, 7074m free

The command -toc puts out the line "Media summary:", too.
Its output goes to stdout. Its line "Media blocks :" gives exact sizes counted in units of 2048 bytes.

$ toc=$(xorriso -outdev /dev/sr2 -toc 2>/dev/null)
$ echo "$toc" | grep '^Media blocks :'
Media blocks : 8597504 readable , 3621888 writable , 12219392 overall
$ echo "$toc" | grep '^Media summary:'
Media summary: 129 sessions, 8597504 data blocks, 16.4g data, 7074m free
Post by Richardson, Eric J
is there a way to get the number of session left for the medium?
Short of manually subtracting the number of sessions on the disk from
99, that is.
Not yet. The numbers 99 and 153 are theoretical values.
The real number of remaining sessions depends on the size of those sessions and on the gaps between sessions.

With BD-R there is no limit announced in the MMC specs.
My oldest BD burner can put more than 300 on the medium before it fails quite miserably. My younger ones throw error after about 120 to 140 sessions. (I am awaiting the refusal of my current backup BD-R every day.) For professional purposes i would impose a limit of 100 sessions and then just begin with a new medium.


Have a nice day :)

Thomas
--
To UNSUBSCRIBE, email to cdwrite-***@other.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@other.debian.org
Archive: https://lists.debian.org/***@HDXDSP51.us.lmco.com
Loading...