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

Calculating size of iso image



Dear Folks,

I am writing a Perl program
http://ictlab.tyict.vtc.edu.hk/ftp/tarball/make-path-lists.pl
to produce pathlists for feeding to growisofs, but have struck
problems in calculating the space required.

I began naively rounding each file size up to the first multiple of
2048, but this woefully underestimated the size required.  In
particular, with a command like this:
growisofs -J -R --graft-points --path-list ~/.dvdlist/pathlist-2004-07-09--15-50-39-001.lst,

after I had already rounded up to 4096 instead of 2048, I calculated
the required space to be:
4695896064 bytes / 2048 = 2292918 blocks (I think; sorry, not
verified; in any case, the calculation is not correct)

but here is the output of growisofs after a successful burn:
Total translation table size: 0
Total rockridge attributes bytes: 5050048
Total directory bytes: 8351744
Path table size(bytes): 3514
Max brk space used 2443000
2249218 extents written (4393 Mb)

Can anyone tell me how this size is calculated?

How is the size of the rockridge attributes calculated?
of the directories?
What is the "Path table"?
What is the "Max brk space"?
What exactly are "extents"; does that mean that the total data written
was 2249218 * 2048 = 4606398464 bytes?

At the moment, I am only fudging it by the add-hock method:

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
bytes (where ^ is the exponential operator of TeX or bc).

Does anyone know the real, correct method?
-- 
Nick Urbanik   RHCE                               nicku(at)vtc.edu.hk
Proud member of the Dept. of Information & Communications Technology,
Home of Visual Paradigm: Jolt Productivity Award winner, programmed
by our own graduates!      Tel: (852) 2436 8576  Fax: (852) 2436 8526
GPG: 7FFA CDC7 5A77 0558 DC7A 790A 16DF EC5B BB9D 2C24   ID: BB9D2C24

Attachment: pgpuaKO1pNmI3.pgp
Description: PGP signature


Reply to: