Opened 9 years ago

Last modified 8 years ago

#6724 assigned bug

Creating a second active partition should unactive the first one

Reported by: starsseed Owned by: bebop
Priority: normal Milestone: R1
Component: Applications/DriveSetup Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: x86

Description

  1. Create an intel partition-map inside an empty disk
  2. Create a first primary partition with the <active> flag
  3. Create a second primary partition with the <active> flag

you will see 2 actives partitions.

hrev39010 (gcc4)

Attachments (2)

TwoActivePartitions.png (34.2 KB) - added by starsseed 9 years ago.
active_partition.patch (713 bytes) - added by bebop 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by starsseed

Attachment: TwoActivePartitions.png added

comment:1 Changed 9 years ago by starsseed

Component: - GeneralApplications/DriveSetup
Owner: changed from nobody to stippi

comment:2 Changed 9 years ago by anevilyak

Owner: changed from stippi to bebop
Status: newassigned

Changed 8 years ago by bebop

Attachment: active_partition.patch added

comment:3 Changed 8 years ago by bebop

When the MBR was being written, the active partition was properly handled. The problem was that the partition_data was not being updated correctly. This means if one was to restart the computer the correct values for the active partition would be displayed.

This patch is the quick and dirty fix to the problem. It sets all of the current primary partitions parameters to an empty string if the partition being created has the active flag set to true.

This works as the intel disk system only uses the parameters string for the active partition. Any comments on how this should/could be handled are welcome.

comment:4 in reply to:  3 Changed 8 years ago by bonefish

Replying to bebop:

When the MBR was being written, the active partition was properly handled. The problem was that the partition_data was not being updated correctly. This means if one was to restart the computer the correct values for the active partition would be displayed.

This patch is the quick and dirty fix to the problem. It sets all of the current primary partitions parameters to an empty string if the partition being created has the active flag set to true.

This works as the intel disk system only uses the parameters string for the active partition. Any comments on how this should/could be handled are welcome.

Actually that's not quite correct: https://dev.haiku-os.org/browser/haiku/trunk/src/add-ons/kernel/partitioning_systems/intel/intel.cpp?rev=34377#L220. Setting the string the same way would be more correct (refactoring that bit into a separate function would be a bonus :-)). Other than that the locking/marking partitions busy must be adjusted, since ATM _user_create_child_partition() does only mark the parent partition busy, not the also changed pre-existing children. This also holds true for other functions, like _user_set_partition_parameters(), BTW.

Note: See TracTickets for help on using tickets.