bug-grub
[Top][All Lists]
Advanced

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

Re: Problem with ISO9660 and files stored on multiple extents


From: Thomas Schmitt
Subject: Re: Problem with ISO9660 and files stored on multiple extents
Date: Thu, 16 Feb 2017 12:35:23 +0100

Hi,

Carlo Caione wrote:
> > I think that the problem
> > here is that endless.squash has been stored in two extents in the
> > ISO9660 and GRUB doesn't deal fine with that (also according to this
> > comment
> > http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/fs/iso9660.c#n960

Andrei Borzenkov wrote:
> This comment could be stale and misleading.

The code of read_node() in iso9660.c looks ready for multi-extent (aka ISO
level 3).

I have a very densely compressed test ISO for large file support
   http://scdbackup.webframe.org/large.iso.bz2
which bunzip2 inflates from 4.5 KiB to 4+ GiB.

grub-fstest 2.02~beta2-36 of my Debian Sid VM works fine with this ISO.
The comment in line 960 of iso9660.c would be outdated therefore.

The ISO contains a data file
  -rw-r--r--    1 1000     1000     4329375744 May  6  2014 '/my/large_file'
which consists of two extents
  $ xorriso -indev large.iso -find /my/large_file -exec report_lba
  ...
  Report layout: xt , Startlba ,   Blocks , Filesize , ISO image path
  File data lba:  0 ,       56 ,  2097151 , 4329375744 , '/my/large_file'
  File data lba:  1 ,  2097207 ,    16802 , 4329375744 , '/my/large_file'

The file is all zeros. For the given question, i write a few recognizable
bytes into its extents:
  echo Extent1Start | dd conv=notrunc bs=2048 seek=56 count=1 of=large.iso
  echo Extent2Start | dd conv=notrunc bs=2048 seek=2097207 count=1 of=large.iso
  echo RandomTargetInExtent2 | dd conv=notrunc bs=2048 seek=2113916 count=1 
of=large.iso

(2113916 - 56 ) * 2048 = 4329185280 will be used as random access address in
one of my tests. 


Now for grub-fstest. Reading all bytes:

  $ grub-fstest large.iso cat /my/large_file | wc
        3       3 4329375744

  $ grub-fstest large.iso cat /my/large_file | od -c
  0000000   E   x   t   e   n   t   1   S   t   a   r   t  \n  \0  \0  \0
  0000020  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
  *
  37777774000   E   x   t   e   n   t   2   S   t   a   r   t  \n  \0  \0  \0
  37777774020  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
  *
  40202420000   R   a   n   d   o   m   T   a   r   g   e   t   I   n   E   x
  40202420020   t   e   n   t   2  \n  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
  40202420040  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
  *
  40203204000

(Octal 37777774000 is 2048 bytes below 4 GiB. That's the highest block
aligned count which can be expressed in a single extent.)

Random access into the second extent:

  $ grub-fstest --skip=4329185280 --length=16384 large.iso cat /my/large_file | 
wc
        1       1   16384

  $ grub-fstest --skip=4329185280 --length=16384 large.iso cat /my/large_file | 
od -c
  0000000   R   a   n   d   o   m   T   a   r   g   e   t   I   n   E   x
  0000020   t   e   n   t   2  \n  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
  0000040  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
  *
  0040000


Have a nice day :)

Thomas
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]