POV-Ray : Newsgroups : povray.off-topic : Formatting speeds redux : Re: Formatting speeds redux Server Time
7 Sep 2024 13:22:27 EDT (-0400)
  Re: Formatting speeds redux  
From: Darren New
Date: 7 Jul 2008 14:59:57
Message: <487267ad$1@news.povray.org>
Orchid XP v8 wrote:
> The information I heard is that "small" files are stored in-line inside 
> the directory structure to prevent additional seeks (and wasted 
> half-blocks). The source I got that from wasn't highly technical, so 
> this might be a simplification.

The "directory structure" includes more than the directories.

There's a "master file table", which holds all the metadata for each 
file, such as its names, what directories it's in, how big it is, the 
pointer to the ACL, what clusters it's stored on, when it was created, 
where it's backed up, what streams it has and where, the encryption 
information, and so on. The MFT is basically an array of file objects, 
and each file object is an array of file properties. One of those file 
properties *can* be the data of the file.

Then there are directories, which store the names and pointers into the 
master file table as B-trees.

If you're familiar with old UNIX style file systems, the "master file 
table" holds the equivalent of the i-nodes, and the directories hold the 
equivalent of the directories.

Having lots of files in a directory leaves it the same size regardless 
of how much data is in the files, because the directories just refer to 
offsets in the master file table.

(Now you understand the three passes of chkdsk. :-)

The reason the formatting is fast is the master file table is just a 
file, as is the free space map and ACL lists (and boot sector, for that 
matter), and they're all dynamically allocated as needed just like any 
other file, so it's a pretty constant amount of data written during a 
format.

Ext2 pre-allocates all the i-nodes, and hence must actually clear them 
(i.e., mark them as not in use). And (presumedly) for speed, it spreads 
these i-nodes out across the disk, so there are thousands of seeks to 
format a 750G disk.

-- 
Darren New / San Diego, CA, USA (PST)
  Helpful housekeeping hints:
   Check your feather pillows for holes
    before putting them in the washing machine.


Post a reply to this message

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