Hi,

> for a DVD (but not a CD), I think just cat without isosize
> would work as well.

Only for DVD-R[W] written with write type DAO and even that depends
on the burn program used. DVD have a natural chunk size of 32 KiB.
Only DAO respects your wish if you send smaller chunks.

Overwritable media (DVD-RAM, DVD+RW, BD-RE, formatted DVD-RW) in
most cases yield their full capacity when being read.


> files in
> ISO 9660 filesystems were written in sequence and should not cause much
> seeking.

One should think so. At least if data of tree neighbors have similar
block addresses. (Which is not the case in current Debian ISOs but seems
not to be the reason for the miserable performance of cp -r.)


> Any idea how they did manage that?

Well, in part "they" is me as software heir of Vreixo Formoso Lopes
who implented a mapping from directory tree to data content which is
deterministic but quite chaotic. A red-black tree is involved which
tries to find identical input files.

In GNU xorriso-1.3.8 as used by debian-cd, this red-black tree is
traversed for data content mapping. Since 1.4.2, the ISO 9660 name tree,
which is alphabetically sorted by specification, gives the sequence for
this mapping.
Only pitfall is that ISO 9660 names are uppercase and possibly mangled
versions of the Rock Ridge names, which mount(8) uses by default.
So some hopping might still be needed when walking the mounted file
tree alphabetically.

But as demonstrated, the more reasonable mapping does not significantly
improve the performance of cp -r.


> rsync would speed things up since it establishes a list of all the
> files to copy before starting

Let's try with the non-chaoticly repacked ISO.
Being first time user of rsync i have to guess and RTFM.

  # mount /dev/sr1 /mnt/iso

  $ time rsync --no-p --no-g --no-o --chmod=ugo=rwX -r \
               /mnt/iso /dvdbuffer/debian_dvd_1_unpacked
  skipping non-regular file "iso/debian"
  ...

Noise is very promising. Few clonking.
  
  real    6m43.584s

That's 404 seconds. Not too bad, compared to 333 seconds for sequentially
copying the ISO to hard disk.

My rsync options still hate softlinks. But i guess this is not significant
for performance measurement.

rsync on the original DVD 1 needs 730 seconds. With much clonking.
cp -r needed 1048 seconds, osirrox without sort_lba needed 661 seconds.

So:
cp -r must be doing something that does not go well with the ISO 9660
driver of Linux.


Have a nice day :)

Thomas

Reply via email to