Thanks for the 3 suggestions! Results of an hour's playing: As suggested it won't really work with inode-based systems - perhaps true, but it'll get a lot closer to data being layouted neatly on the filesystem.
I assume that when copying onto an empty filesystem, data gets put down in the order of files being copied (this may not be true but is the closest I can get). Assuming that, when listed with find, the output is in order of the files having been copied is true for ext2 but not for reiser. This through me off track a bit. rsync unfortunately doesn't do it, it does no reordering of files being copied. (If you know better Phil please speak up). Files are copied in the order in which they are encountered in the source directory. Running find shows the same order. That leaves the find|sort|cpio|cpio idea. As usual, cpio is a PITA. --preserve-modification-time does nothing for directories after this sort (and it's not difficult to see why :) ). This can be fixed by following up with a find -depth -type d|cpio|cpio (the -depth is the ticket - and must not use sort). The default archive format of cpio is useless as it can't hack copying from/to filesystems with more than 65536 inodes - i.e. every system today. Use -H newc --create. cpio doesn't restore group ownerships - doh. The whole thing must be run as root - blerrrgh. Then it seems to work though. Perhaps one could use a combination of using cpio to copy the data and rsync to restore permissions and time stamps. The iso9660 has a funny sort order btw - it's folded alphabetical (i.e. sort -f), but digits and punctuation come after the letters. I also want to explicitly point out that this requires the GNU version of cpio - I know for a fact that the Solaris 2.7 cpio can't even restore permissions (or something diabolical like this). Volker -- Volker Kuhlmann is possibly list0570 with the domain in header http://volker.dnsalias.net/ Please do not CC list postings to me.
