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

Re: Announcing xorriso-0.2.6



Hi,

> Question: is this currently capable of updating a CD-R or DVD-R using
> multi-session as the basis for updating selected files?

Yes. xorriso does multi-session on nearly any media
(except the infamous fast-blanked DVD-RW).

You may overwrite existing files in the ISO image,
or delete them, or move them to another address path.
If you add directories then they get merged with
existing ones. So it might be desireable to delete
the old one first.

The according example from the man page:

   Manipulating an existing ISO image on the same media
       Load image from drive.  Remove (i.e. hide) directory  /sounds  and  its
       subordinates.      Rename     directory    /pictures/confidential    to
       /pictures/restricted.    Change   access   permissions   of   directory
       /pictures/restricted.   Add  new  directory  trees /sounds and /movies.
       Burn to the same media and eject.
       $ xorriso -dev /dev/sr2 \
        -rm_r /sounds -- \
        -mv \
          /pictures/confidential \
          /pictures/restricted \
          -- \
        -chmod go-rwx /pictures/restricted -- \
        -map /home/me/prepared_for_dvd/sounds_dummy /sounds \
        -map /home/me/prepared_for_dvd/movies /movies \
        -commit -eject all

But if you want to mirror some hard disk subtrees
by some trees on optical media, try this example:

   Incremental backup of a few directory trees
       This   does  the  following  to  directories  /open_source_project  and
       /personal_mail in the ISO image:  create  them  if  not  existing  yet,
       compare  them with their disk counterparts, add disk file objects which
       are missing yet, overwrite those  which  are  different  on  disk,  and
       delete  those which have vanished on disk.  But do not add or overwrite
       files matching *.o, *.swp.
       $ xorriso -dev /dev/sr0 \
        -volid PROJECTS_MAIL_"$(date '+%Y_%m_%d_%H%M%S')" \
        -not_leaf '*.o' -not_leaf '*.swp' \
        -update_r /home/thomas/open_source_projects /open_source_projects \
        -update_r /home/thomas/personal_mail /personal_mail \
        -commit -toc -eject all
       To be used several times on the same media, whenever an update  of  the
       two  disk  trees  to  the  media is desired. Begin with blank media and
       start a new blank media when the run fails due  to  lack  of  remaining
       space on the old one.
       This  makes  most  sense  with backups on non-erasable media like CD-R,
       DVD-R, DVD+R if the full backup leaves substantial  remaining  capacity
       on  media  and  if  the expected changes are much smaller than the full
       backup.  An update run will probably save no time but last longer  than
       a  full  backup.  Other good reasons may be given if read speed is much
       higher than write speed or if file size changes happen too often within
       the write time of a full backup.
       With  mount  option  "sbsector="  it  is possible to access the session
       trees which represent the older backup versions. With CD  media,  Linux
       mount accepts session numbers directly by its option "session=".
       Multi-session media and most overwriteable media written by xorriso can
       tell the sbsector of a session by xorriso option -toc.
       Sessions on multi-session media are separated by several MB  of  unused
       blocks.   So  with  small  sessions  the  payload  capacity  can become
       substantially lower than the overall media capacity. If  the  remaining
       space on media does not suffice for the next gap, the drive is supposed
       to close the media automatically.
       Better do not use your youngest backup for -update_r.   Have  at  least
       two  media  which  you  use  alternatingly.  So  only older backups get
       endangered by the new write  operation,  while  the  newest  backup  is
       stored safely on a different media.  Always have a blank media ready to
       perform a  full  backup  in  case  the  update  attempt  fails  due  to
       insufficient remaining capacity.


> Clearly I could write whole new media, that's not optimal from a time or
> storage space perspective, writing a new DVD for a 3-4kB file change is
> undesirable.

The waste of space on multi-session media is worst on CD-R[W]
and DVD-R[W] where session gaps can be up to 20 MB. On DVD+R
it is only 4 MB. Best it is with overwriteables: DVD-RAM, DVD+RW,
formatted DVD-RW. There the waste is between 0 and 62 KiB.

Another overhead is caused by the fact that with each session
a complete new directory structure is written.
The size depends on the number of file objects in the image
and usually is in the range of a single percent of the 
combined image size.

So the wish to write in granularity of few KiB will hardly
be fulfillable by xorriso.
My backups produce one base session of 200 MB and 20 small
update sessions on CD media, one base session of 800 MB and
40 update sessions on DVD-R, 50 on DVD+R and 60 on DVD+RW.
About 4500 blocks of each session hold the directory tree.
(One can measure by making two runs with only a small data
 file changed inbetween.)

Exanmple of a DVD-R:
 TOC layout   : Idx ,  sbsector ,       Size , Volume Id
 ISO session  :   1 ,         0 ,    870113s , UPDATE_HOME_2008_04_18_220030
 ISO session  :   2 ,    908176 ,     22632s , UPDATE_HOME_2008_04_20_133303
 ISO session  :   3 ,    938656 ,     19169s , UPDATE_HOME_2008_04_21_153459
 ...
 ISO session  :  41 ,   2233968 ,     60302s , UPDATE_HOME_2008_06_06_114440

DVD+-R multi-session info might be ignored or misunderstood
by DVD-ROM drives. In that case one has to help mount
to find the youngest session.
This problem does not apply to overwriteable media.


Have a nice day :)

Thomas


Reply to: