Hi all,
Starting off the New Year with a puzzle.
The goal is to calculate the maximum size file that will fit on a CD, DVD or BD. The process I thought would work starts with getting the number of writable blocks from xorriso's -toc output. Using a blank CD-RW for the test case, this shows 359847 writable sectors. Experimenting with the -print_size process below, I subtracted 70 and wrote 359776 blocks (736821248 bytes) to test.dat using dd and created a test.iso with:
# xorriso -outdev test.iso -compliance no_emul_toc -padding 0 -map test.dat /test
Then did the following to confirm that the iso would fit with the expected 5 blocks to spare:
# xorriso -outdev stdio:/dev/null -compliance no_emul_toc -padding 0 -map test.iso /x -print_size -rollback 2>/dev/null
Image size : 359842s
But trying to write the iso image to the media failed where 112 blocks more were required then available:
# xorriso -as cdrecord -v dev=/dev/sr0 test.iso
GNU xorriso 1.5.4.pl02 : RockRidge filesystem manipulator, libburnia project.
Drive current: -outdev '/dev/sr0'
Media current: CD-RW
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 703m free
xorriso : FAILURE : Image size 359959s exceeds free space on media 359847s
It's a full stop until I get a better understanding of where those 112 extra blocks came from and how I can compensate when doing full sized writes to all 3 media types.
Any suggestions or insights would be greatly appreciated.
Thanks and happy 2022! :)
-Tom