Sign in to follow this  
jwells

Is a Partition a Physically Contiguous Space?

Recommended Posts

If I have a new 100GB hard drive and partition it into four 25GB partitions, and then install an OS on each partition, will the files for each OS be laid out in a physically discrete manner, as if you divided a pie into four slices. Or will the files for any one OS be spread out all over the hard drive but somehow identified as belonging to a particular partition. That is to say, is a partition a physically continguous space?

If physically contiguous, then how does a partition program, like Disk Director, add a new partition if the existing partition is the entire hard drive and the existing files are spread out all over the place (beginning, middle and end of the disk). It seems that the program would have to first consolidate all the existing files into one section to make room for a new parititon. Yet, I don't believe this is what Disk Director does.

The reason I ask is that I'm trying to decide between a 75GB or 150 GB raptor for my operating system drive. It will have XP, Vista and Ubuntu, and perhaps a copy of each. My understanding is that smaller HDD's find data faster because there is less physical space to search. However, if you have smallish parititions, does that mean seeks for any one partiular OS be limited to one smallish area on the hard drive, or will it still have to search the entire HDD.

All comments would be welcome. Thanks.

Share this post


Link to post
Share on other sites

Data is written to hard disk drives in one long spiral, from the outside in. If you divide a 100 GB disk into 25 GB chunks, each partition (in the order you created them) will occupy a ring of platter corresponding to 25% of the disk area. Partitions are physically contiguous in the sense that a continuous chunk of the spiral is allocated to that partition.

Partitions force a given amount of data into a limited radial area of the disk; potentially, this can result in lower seek times than having the data spread across the platter.

The other thing to consider in your decision is that a 25 GB partition on a 150 GB drive will typically occupy half the area of a 25 GB partition on a 75 GB drive (2 platters vs. 1, with the outermost track of each platter surface in turn being written before the next track on each surface in turn). So seeks will be quicker just because of the increased capacity. That's how very large (500 - 1000 GB) 7200 RPM drives can approach the performance of the mechanically much faster Raptors.

I'd get the 150 GB anyway, or 6 OS installs on one disk will be a tight squeeze. Vista alone requires something like 15 GB to install. If by "copy" of each OS you only mean "partition image", then it's not quite so bad.

Share this post


Link to post
Share on other sites

Doesn't have to be a contiguous space. Imagine you have 4 partitions, then use Disk Mangler to blow away 2 and 4 and create a new single partition from all the free space. Those third party partition programs seem to work far too quickly to move anything around as well, for super-fragmented partitions.

I'd suggest creating partitions once and then not messing with them again by resizing or deleting--only formatting or ghosting.

Share this post


Link to post
Share on other sites
Doesn't have to be a contiguous space.

Yes, it does. And there's a difference between physical and logical space. The HDD maps logical to physical and although it's kinda continuous, it's not exactly how Spod explained it.

Share this post


Link to post
Share on other sites

Thanks much for all your responses. But I don't see how partitions are necessarily separate contiguous blocks of space. Imagine a one partition hard drive with files spread all over the place (beginning, middle and end). If you use Disk Director to create a new partition, it does so very quickly, implying that it is not consolidating files to create additional contiguous free space.

On another matter, is the Raptor worth getting for an OS drive, i.e., will the system seem more responsive than if I used a 150GB 7200 Samsung Spinpoint T? Or will I simply be able to impress my friends with great benchmarks? Short of SCSI, any better suggestion for the OS drive?

Share this post


Link to post
Share on other sites
Thanks much for all your responses. But I don't see how partitions are necessarily separate contiguous blocks of space.

They just are. :)

Imagine a one partition hard drive with files spread all over the place (beginning, middle and end). If you use Disk Director to create a new partition, it does so very quickly, implying that it is not consolidating files to create additional contiguous free space.

There's probably another very logical explanation for that.

Share this post


Link to post
Share on other sites
Doesn't have to be a contiguous space.

Yes, it does. And there's a difference between physical and logical space. The HDD maps logical to physical and although it's kinda continuous, it's not exactly how Spod explained it.

The question at hand (and the thread title) is "Is a Partition a Physically Contiguous Space?" and the answer is simply no, it doesn't have to be.

Sure, it can be considered to logically be "contiguous" by definition (and seen that way by the OS, just like how two obviously separate drives in RAID0 may be seen as one contiguous partition), but it does not physically need to be. How else can you explain a new partition made from two noncontiguous ones that were deleted? Or the saw-toothed STR pattern that results from multiple platter drives that don't use up one platter before going to the next? How about the remapping that goes on to hide bad sectors (unlike the wear-leveling algorithm on a flash drive, it's so much slower that you can see a big dip in STR when it seeks over to the spare sectors) that relocates blocks from the same partition everywhere? Seems to me it's the firmware of a drive is what determines where things physically go and keeps track of where everything is.

If there is "probably another very logical explanation for that" I'd sure like to hear it.

Share this post


Link to post
Share on other sites
Doesn't have to be a contiguous space.

Yes, it does. And there's a difference between physical and logical space. The HDD maps logical to physical and although it's kinda continuous, it's not exactly how Spod explained it.

The question at hand (and the thread title) is "Is a Partition a Physically Contiguous Space?" and the answer is simply no, it doesn't have to be.

Sure, it can be considered to logically be "contiguous" by definition (and seen that way by the OS, just like how two obviously separate drives in RAID0 may be seen as one contiguous partition), but it does not physically need to be. How else can you explain a new partition made from two noncontiguous ones that were deleted?

The HDD itself doesn't know anything about partitions. So if the OS sees it that way, that's the way partitions are laid out.

I've never seen a partition manager join two distinct free spaces into a single partition without moving the partitions in between.

Or the saw-toothed STR pattern that results from multiple platter drives that don't use up one platter before going to the next?

Drives used to use one track and then move to the next platter, not the other way around.

But now they use multiple tracks from one platter and then move to the next platter.

How about the remapping that goes on to hide bad sectors (unlike the wear-leveling algorithm on a flash drive, it's so much slower that you can see a big dip in STR when it seeks over to the spare sectors) that relocates blocks from the same partition everywhere? Seems to me it's the firmware of a drive is what determines where things physically go and keeps track of where everything is.

If there is "probably another very logical explanation for that" I'd sure like to hear it.

The remapping is indeed an exception but it's not relevant for partitions.

Share this post


Link to post
Share on other sites

Primary partitions are contiguous. Extended partitions are physically contiguous. Logical drives within an Extended partition need not be contiguous, but "usually" are by default.

This may/does not apply to "Whole Disk" dynamic/advanced partitioning schemes.

Frank

Share this post


Link to post
Share on other sites
Logical drives within an Extended partition need not be contiguous, but "usually" are by default.

I've never read about that. Where can I read more about that option?

I'm having trouble finding docs that tell you how to do it. wikipedia has a good description of the spec here, but makes no mention....

http://en.wikipedia.org/wiki/Extended_Boot_Record

Searching. Google turns up a bunch of useless crap.

Frank

Share this post


Link to post
Share on other sites
Guest 888
Drives used to use one track and then move to the next platter, not the other way around.

But now they use multiple tracks from one platter and then move to the next platter.

/a bit off-topic talk/

Yes, you're right! However it's interesting to note that Hitachi is the only one to read two tracks only and then move to the next platter. Other manufacturers read much more tracks in row before switcing heads. May-be here is one reason for Hitachi's exceptionally good performance...

Share this post


Link to post
Share on other sites
I'm having trouble finding docs that tell you how to do it. wikipedia has a good description of the spec here, but makes no mention....

http://en.wikipedia.org/wiki/Extended_Boot_Record

With only an start and end I don't see any way to use multiple extents/runs for a single partition.

Looking at the doc, you are correct. I am still under the impression that it can be done though, as believe I've seen it on proprietary setups. I believe the scenario was where you have a disk with sectors 1-1000, logical drive A with sectors 250-750, and logical drive B with sectors 1 - 1000. Logical drive B received sectors 1-249 and 751-1000 (leaving 250-750 untouched).

I'll look for docs later this afternoon.

Frank

Share this post


Link to post
Share on other sites
Drives used to use one track and then move to the next platter, not the other way around.

But now they use multiple tracks from one platter and then move to the next platter.

/a bit off-topic talk/

Yes, you're right! However it's interesting to note that Hitachi is the only one to read two tracks only and then move to the next platter. Other manufacturers read much more tracks in row before switcing heads. May-be here is one reason for Hitachi's exceptionally good performance...

I didn't know that! I appreciate the info. When did they start doing that, and why?

Is that to minimise settle time when switching from head to head, alligning with the microscopically different pattern of tracks on each platter? I thought that was insignificant compared to having to seek back across several tracks when you switch to the next platter (as the drives will now have to do), but has that changed in recent years?

Yes, it's a little off topic, but not far off.

OP, feel free to bring us back into line if you want!

Share this post


Link to post
Share on other sites
I didn't know that! I appreciate the info. When did they start doing that, and why?

Is that to minimise settle time when switching from head to head, alligning with the microscopically different pattern of tracks on each platter? I thought that was insignificant compared to having to seek back across several tracks when you switch to the next platter (as the drives will now have to do), but has that changed in recent years?

Yes, it's a little off topic, but not far off.

OP, feel free to bring us back into line if you want!

Probably because track to track seeks are faster than a head switch. If enough tracks are combined, seeking back is only done infrequently so it matters less.

Share this post


Link to post
Share on other sites
Drives used to use one track and then move to the next platter, not the other way around.
Mind if I ask who said it was the other way around?

My point was only that a partition may be physically scattered on different platters and even drives, but the OS still sees it as a "virtually" contiguous logical partition (there's that word again). It's the drive firmware that determines where things actually go when creating a partition, and it does not even report that information to the OS (the C, H, and S values reported to the kernel to calculate geometry are themselves convenient artificial fictions on large disks). And that would be true no matter which location assigning scheme came first ;)

Some may consider firmware to be part of the hardware but it's really the lowest software layer, even if much of it is bypassed after the OS loads. It is the job of a software layer to hide the true nature of the hardware level from the user and other software levels (including partition managers), which allows e.g. hardware changes without breaking OS compatibility. That's why BIOS overlays work--they are supposed to lie to both lower and higher software levels... :blink:

Share this post


Link to post
Share on other sites
Drives used to use one track and then move to the next platter, not the other way around.
Mind if I ask who said it was the other way around?

You did: "Or the saw-toothed STR pattern that results from multiple platter drives that don't use up one platter before going to the next?"

In the past drives used one cylinder (not platter) before using the next cylinder.

My point was only that a partition may be physically scattered on different platters and even drives, but the OS still sees it as a "virtually" contiguous logical partition (there's that word again). It's the drive firmware that determines where things actually go when creating a partition,

A partition is basically guaranteed to be spread over all platters (or did you mean cylinders again).

Your last sentence is a bit weird, as drive firmware doesn't deal with partitions at all.

Share this post


Link to post
Share on other sites

Hmm, all I was trying to point out was the saw toothed pattern can only be explained from a clearly non-sequential physical arrangement, and said nothing at all about this arrangement being older or newer. Interesting that you could infer that somehow?

A partition is basically guaranteed to be spread over all platters (or did you mean cylinders again).

Your last sentence is a bit weird, as drive firmware doesn't deal with partitions at all.

The title is "Is a Partition a Physically Contiguous Space?" My definition of physical here is some place you can point to on the surface (because the OP was concerned about fragmentation causing a performance hit from the head physically seeking, which is why I've been talking about platters). I suspect this may be the hangup because even if a partition cannot be logically fragmented by definition... I've given examples of how it may physically reside in different places (from remapping, etc that no partition manager can even be aware exists). The partition manager works at a higher level software layer. Perhaps "physical" may then also refer to the physics of all those electrons carrying out software commands?

As you said, "there's a difference between physical and logical" but logical has not mapped with physical since "cylinders" became arbitrary numbers that no longer correlate with actual drive geometry (unlike the old days when you could really low-level format a drive). By that viewpoint, partitions should not even physically exist at all anymore because they are now based on imaginary parameters. It's not that the firmware is involved with creating the partitions, but that the firmware is what lies (misrepresents) to the partition manager this geometry information.The partition manager cannot know where the parts of the partition physically are because the firmware handles all this behind the curtain, and it all depends on how it's programmed. You could partition and defragment a flash drive too, but that sure won't guarantee data occupies sequential memory cells, and the partition manager will be none the wiser.

I stand by my recommendation not to resize or tamper with partitions that contain data, because a partition that takes hours to defragment may be "moved" and reordered in seconds. This alone strongly suggests to me that no physical but only virtual moving is going on (hey! maybe that's what "another very logical explanation" means) :) .

Share this post


Link to post
Share on other sites
Hmm, all I was trying to point out was the saw toothed pattern can only be explained from a clearly non-sequential physical arrangement, and said nothing at all about this arrangement being older or newer. Interesting that you could infer that somehow?

By "saw toothed pattern", are you referring to the fuzzy pattern caused by adaptive formatting?

http://www.hitachigst.com/tech/techlib.nsf...ormattingWP.pdf

From X-bit Labs:

"The graphs of the Hitachi drives from the Travelstar 80GN and 5K80 families display the effects of Adaptive Formatting technology: the transfer line is fluctuating with certain amplitude."

http://www.xbitlabs.com/articles/storage/d...25-7200_10.html

Share this post


Link to post
Share on other sites

Adaptive zoning, adaptive zone layout, or variable zone layout all refer to variations of a theme, and serve to illustrate how the firmware was placed in charge of physical locality even before we went to imaginary drive parameters. This is from 1994 when embedded servo drives first came out:

Data layout. A SCSI disk appears to its client computer as a linear vector of addressable blocks, each

typically 256-1,024 bytes in size. These blocks must be mapped to physical sectors on the disk, which are

the fixed-size data-layout units on the platters. Separating the logical and physical views of the disk in this

way means that the disk can hide bad sectors and do some low-level performance optimizations, but it

complicates the task of higher level software that is trying to second-guess the controller (for example, the

4.2 BSD Unix fast file system).

Back in the age of dinosaurs when logical was directly mapped to physical sectors, LLF was under user control and we could even DEBUG the BIOS of the disk controller card to select an interleave ratio, then FDISK it up to the whopping 32MB maximum partition size before high-level format. Picking one too high resulted in less performance than was possible, while going too low caused slipped revolutions that would really kill performance on a 3600rpm drive. Fortunately Spinrite allowed testing various interleave ratios quickly, which was good because dropping the interleave ratio could provide an enormous speed boost.

Of course by ~1990 or so, all the best drives had 1:1 interleave and afterwards the introduction of the integrated drive controller eliminated the ability for user LLF or adjustment of skew or other such low-level functions entirely, hiding them away behind a firmware layer (unless the drive manufacturer specifically provides some utility to adjust e.g. AAM or Server vs. Desktop modes). This effectively hides from the OS any information about physical location so there is basically no way for the OS to know where things physically go. Nor should it care because the firmware allows the drive to function as if the logical arrangement were the actual one, so the imaginary drive parameters provided by the firmware may simply be taken at face value. The orderly geometry information seen by partition managers is merely an illusion.

Share this post


Link to post
Share on other sites
Hmm, all I was trying to point out was the saw toothed pattern can only be explained from a clearly non-sequential physical arrangement, and said nothing at all about this arrangement being older or newer. Interesting that you could infer that somehow?

That's not the point and I didn't infer that from your posts.

A partition is basically guaranteed to be spread over all platters (or did you mean cylinders again).

Your last sentence is a bit weird, as drive firmware doesn't deal with partitions at all.

The title is "Is a Partition a Physically Contiguous Space?" My definition of physical here is some place you can point to on the surface (because the OP was concerned about fragmentation causing a performance hit from the head physically seeking, which is why I've been talking about platters). I suspect this may be the hangup because even if a partition cannot be logically fragmented by definition... I've given examples of how it may physically reside in different places (from remapping, etc that no partition manager can even be aware exists). The partition manager works at a higher level software layer. Perhaps "physical" may then also refer to the physics of all those electrons carrying out software commands?

As you said, "there's a difference between physical and logical" but logical has not mapped with physical since "cylinders" became arbitrary numbers that no longer correlate with actual drive geometry (unlike the old days when you could really low-level format a drive). By that viewpoint, partitions should not even physically exist at all anymore because they are now based on imaginary parameters. It's not that the firmware is involved with creating the partitions, but that the firmware is what lies (misrepresents) to the partition manager this geometry information.The partition manager cannot know where the parts of the partition physically are because the firmware handles all this behind the curtain, and it all depends on how it's programmed. You could partition and defragment a flash drive too, but that sure won't guarantee data occupies sequential memory cells, and the partition manager will be none the wiser.

That's all true.

I stand by my recommendation not to resize or tamper with partitions that contain data, because a partition that takes hours to defragment may be "moved" and reordered in seconds. This alone strongly suggests to me that no physical but only virtual moving is going on (hey! maybe that's what "another very logical explanation" means) :) .

So which layer would do that virtual moving? Surely not the drive firmware, as it doesn't know about partitions.

Share this post


Link to post
Share on other sites
Adaptive zoning, adaptive zone layout, or variable zone layout all refer to variations of a theme, and serve to illustrate how the firmware was placed in charge of physical locality even before we went to imaginary drive parameters.

To my knowledge zones have always been tied to the physical (radial) position of data on the disks, and never to logical or imaginary parameters.

From the patent you cited which describes (and shows in FIG. 1) the concept of zones very well: "the zones on the two-disk stack are vertically aligned and the boundaries of the zones [are] defined radially by the distances indicated by R1-R4 based on the distance from center C of the disk."

The purpose of zone bit recording was (and still is) to compensate for the different recording characteristics that can be achieved at different physical (not imaginary) locations of the disk: the outer diameter locations have different and generally (if not universally) better recording characteristics than the inner diameter locations (hence the location of track 0). If you map zones to imaginary drive parameters, you no longer have the benefit achieved by zone bit recording (or by today's adaptive variant).

Personally, I have never seen a partition that is not logically and physically contiguous (I am not considering spare sectors which, in the old days, were often at a single special non-contiguous physical location on the disk or disks). But that doesn't mean that they don't or haven't existed.

Share this post


Link to post
Share on other sites
If physically contiguous, then how does a partition program, like Disk Director, add a new partition if the existing partition is the entire hard drive and the existing files are spread out all over the place (beginning, middle and end of the disk). It seems that the program would have to first consolidate all the existing files into one section to make room for a new parititon. Yet, I don't believe this is what Disk Director does.

Yes, if you want to add a partition to a hard drive where the existing partition is the entire hard drive, then a partition program (I have Partition Magic) would effectively do exactly as you say. I've never seen what Disk Director does (if it doesn't do this), but I know there have been "dynamic drive overlay" utilities (such as disk compression programs) that reside as a layer between the drive and file system. I haven't heard of them being used for partitioning, but I guess I can't think of any reason why it wouldn't be possible.

Share this post


Link to post
Share on other sites

Absolutely, the zones are mapped to physical locations, since the firmware does not use the imaginary parameters. Why should it, for it knows where everything physically is? The imaginary parameters are only the fiction that is fed to the OS as representing the physical arrangement of the drive. That is, the presented drive arrangement may be emulated in software, whether by drive overlay or firmware, and each sawtooth represents a change in physical location (different zone) that does not necessarily correspond to changes on the logical side, where everything appears as if it were orderly and sequential.

I am not saying that all drives do this, only that it is perfectly possible to program one to do so, since neither the partition manager nor user may actually know what is going on at the hardware level. Seems to me that only someone with special equipment at a data recovery company could know where things are stored physically so I'm unsure how you two have "seen" partitions are physically contiguous at all...

The burden of proof is not on me for just pointing out that a partition may be moved logically but not physically (only remapped on the fly-a "logical" explanation), but on Olaf for declaring partitions must always be physically contiguous as a matter of faith:

They just are. :)
The firmware handles bits and need not know about partitions any more than a chess program needs to know the name of the game it plays in order to play it. It will do whatever it is programmed to do. The question is: do you trust the human programmers and their motives? Maybe I'm cynical but I've had to RMA a number of drives recently when performance dropped off dramatically to <5MB/s from all the bad sectors, yet the company's drive utility and SMART reported drive health was A-OK. Clearly the motive was to reduce RMAs from drives that are still "working." It is not in a third-party repartitioning software company's own interest either to tell you that use of their product may reduce performance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this