Opened 14 years ago

Last modified 5 years ago

#6287 new enhancement

partition-type inconsistency

Reported by: starsseed Owned by: stippi
Priority: normal Milestone: R1
Component: Applications/DriveSetup Version: R1/alpha2
Keywords: MBR file-system partition-type Cc:
Blocked By: Blocking:
Platform: All

Description

DriveSetup allows to initialize a partition with a file-system that is not consistent with the partition type.
If you install a BFS file system onto a partition which type is NTFS, Windows(1) offers to initialize the partition with a NTFS file system (which will overwrite Haiku).
If the partition type is correct (BFS), windows doesn't allow any modification.

So :
either let DriveSetup change the partition type in the MBR according to the file-system initialised,
or make DriveSetup filter the file system types according to the partition type.

See: http://www.haiku-os.org/community/forum/windows_7_trying_fix_haiku_partition

(1) I dont know about linux behaviour but I don't want much to risk it.

Change History (4)

comment:1 by bebop, 14 years ago

While I understand that this is frustrating, I think that the behavior that you are describing is correct behavior. Partitions and file systems are completely separate from each other. Even in Linux, for instance, you could create an NTFS partition, then format it ext4.

However, if other developers feel that partition types should be kept inline with file system type, I would be willing to implement that feature. Otherwise, just remember to tell Windows that you are not an idiot and do not want to format that partition ntfs, and/or partition the hard drive correctly.

comment:2 by pulkomandy, 9 years ago

If you create the partition in DriveSetup, it allows you to set the "type" and defaults to BFS which seems fine. However, there isn't a way to change the partition type after the fact (unless you delete and recreate the partition). When creating a filesystem, filtering is not needed, however a warning message ("the fs you selected does not match the partition type" or so) could be useful.

comment:3 by bebop, 9 years ago

Obviously I have not worked on this code for a while, so take my comments with a grain of salt. Adding a warning to the file system creation would require that every file system add a check on creation. This seems like extra work for the file system that does not really belong there. The file system should not really know much about what partition it resides on, and adding that check has the potential to expose a lot of detail about the underlying disk systems and partition, all of which are supposed to be abstracted at that level. As I stated in the first comment, it does not really matter what partition type you create a file system on.

I do agree though that we should be able to edit the partition type post facto. There is iirc a ParametersEditor class that you can write a BView to be called from the API that would allow editing that sort of information. I am not sure what shape that code is in though, so doing some plumbing before getting to that point might be required.

So I guess I am a -1 on adding a message unless we can find a way to do it that does not make the file system creation overly complicated. I am a +1 on having a decent ParametersEditor system and adding functionality to the partition to allow it to be changed after it is created.

It is possible I will have some time over the holidays to take a look at this. Any input is appreciated.

comment:4 by alpopa, 5 years ago

I also faced the problem with wrong partition type. Although in BIOS/MBR setup it may seem completely irrelevant, in EFI/GPT setup Haiku bootloader prevent booting from the Haiku partition unless it has appropriate partition type and regardless of the filesystem it uses. It is particularly true on Mac's hardware. As soon as the partition type was changed to Haiku (with gdisk from Linux) it boots fine.

Even deleting the partition with DriveSetup and then creating on its place a partition for Haiku, it is added to GPT table as the last one, leaving the deleted partition entry empty. This can create confusion because the partition table entries are sorted differently than physical partition layout on disk. gdisk has the option to sort entries in partition table according to physical partition layout of disk, DriveSetp doesn't have this option.

So, without complicated partition management, it would be useful to:

  • Either to allow user to choose "Haiku partition type" besides "BFS filesystem";
  • Or to change the partition type during initializing some partition with BFS. In this case a confirmation dialog may be used.

(Related tickets are #4235, #5968)

Note: See TracTickets for help on using tickets.