POV-Ray : Newsgroups : povray.off-topic : Linux directory usage question : Re: Linux directory usage question Server Time
8 Oct 2024 21:59:31 EDT (-0400)
  Re: Linux directory usage question  
From: Darren New
Date: 16 Sep 2009 18:49:03
Message: <4ab16b5f$1@news.povray.org>
clipka wrote:
> Darren New schrieb:
>>> Then again, I've sometimes wondered what would happen if you had some 
>>> filesystem that split the disk into several seperate regions with 
>>> different block sizes, and allocated files accordingly. (I.e., put 
>>> the really huge files in the area with big blocks, and the tiny files 
>>> in some area with tiny block sizes.) I rather suspect you'd 
>>> permanently be running out of whichever size you happen to need the 
>>> most tho...
>>
>> And interesting thought. I've never seen that done.  Given that disks 
>> are broken into sectors all the same size, and given that the only 
>> reasons for allocating space in units larger than one sector are 
>> defragmentation and efficiency of storing pointers to clusters, 
>> there's no real good reason for it.
> 
> You are aware that modern file systems use block sizes /significantly/ 
> larger than the disk sector size?

Thats what I said.

> A disk sector is 512 byte in size virtually everywhere, while file 
> systems typically use block sizes one order of magnitude larger.
> 
> Why? Because it is actually more memory-efficient to /not/ use even the 
> smallest gaps - because that inflates the required management overhead, 
> severely reducing the total payload capacity when the files are 
> sufficiently /large/ on average.

I take it you didn't actually read what I wrote?

"The only reasons for allocating space larger than one sector are 
defragmentation and efficiency of storing pointers to clusters."

Incidentally, the management overhead isn't that high when the structure you 
use to store the location of files isn't O(n) in the number of clusters. 
NTFS, for example, stores file extents: an unfragmented file will occupy the 
same amount of space to describe its location regardless of file size.

> In the end, some compromise is used, based on the statistical 
> distribution of file sizes. A really /good/ system administrator might 
> tune the various volumes on his systems to have block sizes that match 
> the actual use.

Yep. Or you just buy a bigger drive. :-)

>> On the other hand, the Amiga formatted the floppy track every time it 
>> wrote the track, so you could probably actually fit more large files 
>> on a disk than small files, even if every small file was exactly one 
>> sector, by making the sectors physically larger on tracks where they 
>> store a big file.
> 
> That won't work for hard disk drives:

Hence my specification that it was only Amiga floppy drives, yes. Indeed, 
even other controllers wouldn't do it efficiently, requiring two rotations 
of the disk to first format then write it. The Amiga used the DSP hardware 
(if you want to call it that) to do the MFM encoding, so it could 
efficiently encode the track every time it wrote it without hardware 
dedicated just to that.


> provided he has kept 
> an eye on the SMART status of his drives).

Google says this doesn't work nearly as well as you might like it to. :-)


-- 
   Darren New, San Diego CA, USA (PST)
   I ordered stamps from Zazzle that read "Place Stamp Here".


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.