home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / bsd / 8638 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  3.6 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!tools!ws
  2. From: ws@tools.de (Wolfgang Solfrank)
  3. Newsgroups: comp.unix.bsd
  4. Subject: Re: Largest file size for 386BSD ?
  5. Date: 9 Nov 92 15:32:43
  6. Organization: TooLs GmbH, Bonn, Germany
  7. Lines: 65
  8. Message-ID: <WS.92Nov9153243@kurt.tools.de>
  9. References: <1992Nov6.031757.20766@ntuix.ntu.ac.sg>
  10.     <1992Nov6.173454.17896@fcom.cc.utah.edu>
  11. NNTP-Posting-Host: kurt.tools.de
  12. In-reply-to: terry@cs.weber.edu's message of 6 Nov 92 17:34:54 GMT
  13.  
  14. In article <1992Nov6.173454.17896@fcom.cc.utah.edu> terry@cs.weber.edu (A Wizard of Earth C) writes:
  15.    In article <1992Nov6.031757.20766@ntuix.ntu.ac.sg> eoahmad@ntuix.ntu.ac.sg (Othman Ahmad) writes:
  16.    >
  17.    >Original Unix has the largest file size of 4Gbyte, because it uses 24-bit
  18.    >pointer.(shouldn't it be 16Gbyte?)
  19.  
  20.    No, 4 Gig; think of identification of indirect blocks for a total of two
  21.    levels of indirection using a 24 bit value.
  22.  
  23. While the use of 24-bit pointers (actually block numbers) in some ancious
  24. version (V7 up to SysV) of Unix is correct, this limits the size of the
  25. partition and only indirectly the size of one file. The limit in the
  26. partition size thus implied is 2^24*1024 = 16GB as the logical block
  27. size on these partition in newer versions of SysV is 1K. Actually it could
  28. even be larger because the 24-bit block numbers are only used for the direct
  29. blocks. The indirect blocks use 32-bit block numbers which would extend the
  30. possible partition size to 4TeraByte (1TB = 1024GB).
  31.  
  32. This file system had 10 direct blocks, 1 sinlge-indirect, 1 double-indirect
  33. and 1 triple-indirect block per inode. This implies a theoretical limit
  34. to the file size of (10 + 256 + 256*256 + 256*256*256)*1024, about 16GB.
  35.  
  36.    >What is the size for 386bsd?
  37.    >If it still uses 24-bit pointers, then the largest size is still 4Gbyte.
  38.  
  39.    Yep.
  40.  
  41. In BSD filesystems the structure is a little different. The logical block size
  42. is 512 bytes and the block numbers in the inode (and anywhere else) are
  43. always 32-bit. Thus the maximum partition size is limited to 2^32*512 = 2TB.
  44.  
  45. The inode has 12 direct blocks and a similar structure of indirect blocks.
  46. But as indirect blocks are always in terms of filesystem blocks and not
  47. fragments, they can store, depending on filesystem block size, up to
  48. 8192/4 = 2048 block address per indirect block. This results in a theoretical
  49. limit to the file size of (12 + 2048 + 2048*2048 + 2048*2048*2048)*512,
  50. about 4TB.
  51.  
  52. Of course both filesystems' file (and partition) sizes are actually limited
  53. by the file size entry in the inode, which is 32-bit (there is room in the
  54. UFS inode for extending this to 64-bit), and by the fact that file offsets
  55. used by lseek are signed longs. This limits the actual file size to 2GB.
  56.  
  57.    >This will be an important issue because soon we'll have hundreds of gigabytes,
  58.    >instead of magabytes soon.
  59.    >    It took the jump from tens mega to hundreds in just 10 years.
  60.  
  61.    Get around the problem:
  62.  
  63.    1)    Multiple partitions not exceeding the 4 Gig limit.
  64.    2)    Larger terminal blocks.
  65.    3)    Additional indirection levels.
  66.    4)    Assumption of larger files = log-structure file systems (ala Sprite).
  67.  
  68.    I don't think it will be an issue that soon anyway.
  69.  
  70. As the limits to both the file size and the partition size implied by the
  71. filesystem is large enough for quite some time (especially in the case
  72. of the UFS, IMHO) the only change eventually required would be a modified
  73. version of lseek. This would be far more easy to add with backward compatibility
  74. if the now last parameter would be before the offset and not behind it in
  75. the call structure. The noew established version seems to require a new
  76. system call.
  77. --
  78. ws@tools.de     (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
  79.