Re: Calculating size of iso image
> have struck problems in calculating the space required.
Who doesn't ?
Currently i am undecided wether it is better to use
mkisofs -print-size
or the size obtained by function stat() plus 1400 bytes.
(This number was found by try and error when i had to replace
du -sk as size measurer for afio.)
Regrettably the size of an mksiofs output tree is not the sum
of the sizes of its subtrees. Usually it is smaller but i had
occasions when the backup became slightly larger than planned.
I advise my users to leave 10 % reserve with the volume size.
Both methods i mention above are exact enough to fit into that.
> I began naively rounding each file size up to the first multiple of
> 2048,
It looks like quite a fixed size attribute record is associated with each
single data file. Maybe one should read the specs ... but in
real life the effect of growing files or newly added files
during the backup is much more annoying.
With 50+ CDs of speed 4 you have to expect 2 workdays for a backup.
In that time there can happen much on a disk.
> after I had already rounded up to 4096 instead of 2048, I calculated
> the required space to be:
> 4695896064 bytes / 2048 = 2292918 blocks
> ...
> 2249218 extents written (4393 Mb)
Luckily it is normal that a reasonable estimation is
underbid by mkisofs. With a fixed add of 1400 i can
get pretty near to the final outcome without underestimating
it too often and too much.
> stat each file and directory
> round the size of each up to 4096, add to the running total
> stop adding files to the pathlist when I reach 4.7 * 10^9 - 4 * 10^6
You are aware that mkisofs does accept whole directories ?
It is not necessary to mention every single file.
> Does anyone know the real, correct method?
I would be curious too. If the formula is deterministic (for
what i got no experimental proof ;)) then i would like to
incorporate it into my program.
Have a nice day :)
Thomas
Reply to: