[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to check size before burning with growisofs



Hi,

> Hello. Is there a way to tell how much would be appended when I burn a
> multi-session disk with growisfs?

This is decided by the mkisofs compatible program that is used by
growisofs to produce the add-on image.

> Okay I found a way myself.

Interesting approach. It demands some human expertise, though.

Following is a method that is fully scriptable:

There is a mkisofs option -print-size which allows you to get
the size without producing the full image stream. It is to be used
together with the other intended mkisofs arguments.

growisofs supplies to mkisofs the options -M and -C which are needed
for composing the image. The other arguments, besides -o, stem from
your growisofs command line. -o is not needed for -print-size.

-M gives the file address of a random access readable ISO 9660 image
(i.e. a regular file or a block device). 
-C tells at which block to start reading the image and at which
block the image will be appended to the media.

With this information and the other options of your growisofs run
you can inquire the result size. Like:

   size=$(genisoimage -print-size \
          -C 1350000,1359056 -M /dev/sr0 -V YULIANSU_BKUP \
          -iso-level 2 -R -exclude-list .exclude.lst.backup -old-root / . )

This size is the number of 2048 byte blocks.

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

The only difficulty here is to learn the argument for -C.

cdrskin should be able to tell it for ISO 9660 images on any DVD type:

  cparam=$(cdrskin dev=/dev/sr0 --grow_overwriteable_iso -msinfo)
  echo $cparam

dvd+rw-mediainfo demands more post-processing:

  cparam_1=$(dvd+rw-mediainfo /dev/sr0 | fgrep Multi-session | \
             sed -e 's/.*@//')
  cparam_2=$(dvd+rw-mediainfo /dev/sr0 | fgrep Track'#'AA | \
             sed -e 's/.*@//')
  cparam="$cparam_1"",""$cparam_2"
  echo $cparam

cparam_2 is bogus here. Actually mkisofs does not care whether it is
plausible at all. One may use as well 0 :
   cparam="$cparam_1"",0"
The real number would be the start address of the track that is blank
   Track State:           blank
   Track Start Address:   354240*2KB
But that works only with DVD-R[W] and DVD+R, not with DVD+RW. So better
use "0" or the value from "Track#AA".

cdrecord will produce cparam_2 value 0 with DVD+RW, but should
be accurate with DVD-R and DVD+R:

   cparam=$(cdrecord dev=/dev/sr0 -msinfo)

wodim will always produce cparam_2 value 0 but the essential cparam_1
value should be ok:

   cparam=$(wodim dev=/dev/sr0 -msinfo)

All these methods should produce a usable -C argument for above
-print-size run.


Have a nice day :)

Thomas


Reply to: