mbr vs ebr how to tell the difference

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
ITchimp
Member
Member
Posts: 134
Joined: Sat Aug 18, 2018 8:44 pm

mbr vs ebr how to tell the difference

Post by ITchimp »

I m studying the minix 3.1 book, how to tell the difference between mbr and ebr, they look pretty the same... how to tell them apart?

what is the point of having ebr in the first place?
User avatar
iansjack
Member
Member
Posts: 4683
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: mbr vs ebr how to tell the difference

Post by iansjack »

ITchimp
Member
Member
Posts: 134
Joined: Sat Aug 18, 2018 8:44 pm

Re: mbr vs ebr how to tell the difference

Post by ITchimp »

i still don't understand how to distinguish between ebr and a normal partition entry?
can I say that ebr's entry has the sector length of 1, iow, if first sector and last sector has the same value in chs notion or lba notion
it must be an ebr entry, is this correct?
Octocontrabass
Member
Member
Posts: 5501
Joined: Mon Mar 25, 2013 7:01 pm

Re: mbr vs ebr how to tell the difference

Post by Octocontrabass »

ITchimp wrote:how to tell them apart?
The first sector of the disk is the MBR. The first sector of the extended partition is the EBR.
ITchimp wrote:what is the point of having ebr in the first place?
It allows you to have more than four partitions.
ITchimp
Member
Member
Posts: 134
Joined: Sat Aug 18, 2018 8:44 pm

Re: mbr vs ebr how to tell the difference

Post by ITchimp »

how do you know a partition entry points to a normal partition or an extended partition?
how do you know an extended partition entry exist at all?
thewrongchristian
Member
Member
Posts: 422
Joined: Tue Apr 03, 2018 2:44 am

Re: mbr vs ebr how to tell the difference

Post by thewrongchristian »

ITchimp wrote:how do you know a partition entry points to a normal partition or an extended partition?
how do you know an extended partition entry exist at all?

Ref: https://wiki.osdev.org/Partition_Table# ... Partitions
The partition table may have one and only one entry that has the SystemID 0x5 (or 0xF). This describes an extended partition.
All the logical partitions are contained within a single MBR extended partition of type 0x5 (CHS) or 0xf (LBA).

So, you read the MBR, find one of the partitions is an extended partition by the partition type.

Then you process the logical partitions within that extended partition by walking the chain of the logical partitions, the extended boot record having the same format as a MBR, with two entries:
  • The first entry describing the logical partition itself, with LBA relative to the start of the extended partition.
  • The second entry pointing to the next EBR, so that EBR form a forward linked list.
Post Reply