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

Re: Archiving content of a directory on a DVD-R.



Hi,

peter@easthope.ca wrote:
>   printf "Insert blank DVD-R."; read t ;
>   tar -vcpzf - * | xorriso -indev /dev/sr0 -add -- -commit ;

Writing the tar stream to DVD-R is a classical use case of cdrecord or wodim.
So:

  tar -vcpzf - * | xorriso -as cdrecord -v dev=/dev/sr0 -eject fs=16m -

This will not create a filesystem around the tar archive. So the planned
xorriso runs with command -indev would then go on strike:

>   xorriso -indev /dev/sr0 -du / -- -toc 2>&1 ;
>   xorriso -indev /dev/sr0 -eject ;

Retrieval is then just a matter of tar and the Linux sr driver:

  tar xvzf /dev/sr0

Of course, this will not give you quick access to single files and even
getting a list of content will last several minutes, if the tar archive
fills most of the DVD:

  tar tvzf /dev/sr0

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

If you want to make use of xorriso's capability to create a mountable ISO
filesystem with a copy of your directory, then you do not need tar.

  xorriso -for_backup -outdev /dev/sr0 -map . / \
          -close on -commit \
          -toc -check_md5 failure -- \
          -eject all

This run acquires /dev/sr0 by command "-outdev". Command "-map . /" maps
the directory tree of the current rd disk directory to the /-directory tree
of the ISO 9660 filesystem on the DVD-R. 
By command "-for_backup" it will record MD5 checksums for the whole
filesystem and for each single data files in the filesystem.

Command "-close on" causes the DVD-R to become unwritable after the burn
run is completed. (If you omit it then the DVD stays appendable for more
sessions.) Command "-commit" performs the burn run.

Command "-toc" will afterwards print an overview of the result after the
new ISO filesystem was assesd by xorriso.
Command "-check_md5 failure --" reads the freshly written blocks and compare
their MD5 with the recorded checksum in the ISO. In case of mismatch it
will throw an event of severity "failure", which will abort the xorriso run.
If not aborted, the drive will be told by "-eject all" to eject the tray.
(It needs to have a motor for that, of course.)

Retrieval:

If not your friendly desktop mounts the DVD automatically on insertion:

  mount /dev/sr0 /mnt/iso

Then use normal file tools like "ls", "cp", or a desktop file manager to
copy the files to hard disk or just to let your application read them from
the mounted directory directly.

Verifying of the medium after a while on the shelf:

  xorriso -for_backup -indev /dev/sr0 -check_media --


Have a nice day :)

Thomas


Reply to: