A question about disk partition layouts..

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

A question about disk partition layouts..

Post by Brynet-Inc »

I'm wondering, Why is their a 63 LBA gap between partitions?

Is there any historical significance to it? Why all the wasted space? ;)

I haven't created many topics lately.. So I thought, "What the heck, I'll ask." 8)

EDIT: 32256/512 = 63 - Apologies.
Last edited by Brynet-Inc on Sun Mar 16, 2008 7:37 am, edited 1 time in total.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
elderK
Member
Member
Posts: 190
Joined: Mon Dec 11, 2006 10:54 am
Location: Dunedin, New Zealand
Contact:

Post by elderK »

Aye, I wonder about this too.
On the bright side, it means I can install my Kernel and all of it's userspace onto a Filesystem, without actually taking any space up in the Filesystem. :P

(Yay for living in no-mans land! :P)

~Z
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Re: A question about disk partition layouts..

Post by Ready4Dis »

Brynet-Inc wrote:I'm wondering, Why is their a 64 LBA(32k) gap between partitions?

Is there any historical significance to it? Why all the wasted space? ;)

I haven't created many topics lately.. So I thought, "What the heck, I'll ask." 8)
It possibly just got aligned on a boundary of sorts. Or possibly the boot manager in use requires the space for booting, so it reserves it outside of a partition so that it won't be written to.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Whoops, s/their/there - apologies for my illiteracy.

As for Ready4Dis, I wasn't asking about a specific instance, all disk partitioning utilities put a gap between partitions.
Layout of a DOS formatted disk is:

Code: Select all

ID type 0x06
Start CHS = 0/1/1
End CHS = 406/15/63

LBA Start 63, size 410193

ID type 0x05
Start CHS = 406/0/1
End CHS = 1013/15/63

LBA Start 410256, size 611856
As you can see, there is a gap between partitions.. and it's entirely full of zeros - is it a legacy CHS limit of some sort?

EDIT: It seems I was wrong, it's only a 32256 byte gap.. 63 LBA - Whoops * 2.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post by bewing »

It all depends on your partitioning software. I have seen the gap you are talking about on m$ FDISK partitioned stuff. And yes, the software is trying to keep 1980's era disks partitioned on head/sector boundaries. The technique is utterly obsolete.

And I strongly suspect a typo in your CHS numbers. You are showing a 63 sector OVERLAP between the two partitions -- not a gap. I think you mean "End CHS = 405/15/63"
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

bewing wrote:And I strongly suspect a typo in your CHS numbers. You are showing a 63 sector OVERLAP between the two partitions -- not a gap. I think you mean "End CHS = 405/15/63"
Apologies:
Brynet-Inc wrote:ID type 0x05
Start CHS = 407/0/1
End CHS = 1013/15/63
The starting cylinder was 407, not 406 or 405.

So I believe the gap remains, and there is no partition overlapping bewing.

No big deal I guess, was simply curious.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post by JAAman »

bewing is correct:

in the old days, it was common practice to start a partition on a cyl boundary (the first sector in the partition was always sector 1), some of the reasons, included easy calculating of disk offsets, and improved performance, partitions started simply aligning on a 63 sector boundary (the maximum sectors/cyl in the traditional CHS scheme)


however:
this space (at least the one at the beginning of the disk) should always be maintained for compatibility reasons, as a lot of disk managers and virus scanners use it (boot managers are often loaded from the 'in-between' space between the MBR and the first partition, some virus scanners also load themselves here, as do certain disk compression programs)
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post by bewing »

If the first partition ends at:

End CHS = 406/15/63

And the next partition starts at:

Start CHS = 407/0/1

Then they are contiguous. There is no gap. Those are sequential CHS addresses. (Sectors go from 1 to 63, Heads go from 0 to 15.)
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

bewing wrote:If the first partition ends at:

End CHS = 406/15/63

And the next partition starts at:

Start CHS = 407/0/1

Then they are contiguous. There is no gap. Those are sequential CHS addresses. (Sectors go from 1 to 63, Heads go from 0 to 15.)
Look, There is a gap between partitions.. ;)

Heck - check your own drive if you don't believe me.. :roll:
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Post by egos »

Brynet-Inc wrote:Look, There is a gap between partitions.. ;)

Heck - check your own drive if you don't believe me.. :roll:
Where's gap? I don't see it!

..., 406/15(last logical surface number: 0...15)/63, 407/0/1(first logical sector number on the surface track: 1...63), ...
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

It seems obvious the reason for the gap is legacy CHS related, regardless of that.. a physical gap exists between partitions if you'll take the time to look.

I believe JAAman's explanation clears things up, I was only curious about the gap - I'm not very used to MBR-style partitioning.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Post Reply