DriveSetup is Magical

I booted from a Haiku Beta RC USB key.
I ran the Installer and brought up DriveSetup. I tried to make a small FAT partition. It defaulted to 4GB so I went with it. I tried to partition the rest of the drive (a 500GB drive) for BeFS, but it always created a super-small partition no matter how many times I tried. Even after a reboot.

After some fussing between Haiku and Windows, I managed to create a 4GB EUFI partition and ~450GB of BeFS. I installed Haiku on to it.

But… I wanted to make the EUFI partition smaller, so I went to Windows and created a 64MB exFAT partition and deleted the BeFS partition.

I figure I can boot into Haiku and use DriveSetup to format the unallocated partition.

Except that Haiku still sees the old EUFI partition. Except now its 12GB in size. And the old Haiku install is on there, too. I can mount it. I can save files to it.

No matter how many times I reboot and try again, or re-scan the disks, it always shows the drive as having the old partition scheme.

I don’t see how this is possible, especially since I blanked out the disk and re-created the GPT and partitions.

Does the boot usb keep some kind of weird cache of what was on the drives the last time they were mounted?

Do you create a fat or ext partition and inizialised it with the bfs file system? Iirc you does not can create a bfs directly

I didn’t have any trouble getting a bfs partition going. My problem now is that I can’t get DriveSetup to see the actual layout of the disk. It keeps thinking it’s got the first partition scheme, when it doesn’t.

But I’m thinking of just giving up on this disk.

Could be that the old GPT partition info isn’t deleted, there are actually two copies, one at the start of the disk and one at the end (unlike the old MBR style which was only at the start of the disk). A tool like gparted can deal better with GPT partitions. https://gparted.org/ has downloadable USB and CD bootable disk images to run that tool.

I’d say always, always install windows first… and leave some space to install whatever else.

Then use Haiku to partition that space… installing the bootloader to the partition not the disk.

Then use EasyBCD to configure the windows bootloader to boot haiku, this avoids a ton of issues. Also remember to uncheck the Metro GUI otherwise you’ll have to wait for windows to actually boot every time before it gives you the boot options.

1 Like

Correct. You gotta zap the GPT table. dd’ing the first few bytes of the disk doesn’t work anymore.
We actually are aware of this and do so: https://git.haiku-os.org/haiku/commit/?id=hrev50656

Oh, i forgot about this one. Haiku’s DriveSetup partition slider has a minimum size, and on bigger disks the size is minimum size is insanely big. A sane setting would be a minimum partition size of 8 MiB

2 Likes

Couldn’t that be made logarithmic?

It could be, but then again, an 8 MiB minimum (as long as the disk is over 8MiB) is pretty sane

EDIT: Yeah, logarithmic would make sense here.

https://git.haiku-os.org/haiku/tree/src/apps/drivesetup/Support.cpp#n118 is the slider code

I admit I’m not very au fait with GPT and UEFI (due to my own laziness…). But on my machine the UEFI data is stored on a flash chip on the motherboard, not on the hard disk. I discovered this when my laptop needed a motherboard replacement and afterwards it wouldn’t boot (but the hard disks had not been replaced). AFAIK GPT partition information is stored on the disk, but I still wonder if this could be somehow be related…

So far I’ve used DriveSetup, gparted, and Windows’ Disk Manager. When I get time I’ll try and wipe out the entire thing and see where I can go from there.

Thanks!

Oh… You do realize you can just type in the size in MiB in the box right above “Partition Type”, right? :slight_smile:

1 Like

Sure. But it’s not an issue. The issue is wiping out everything on the drive, but DriveSetup still sees it the way it wants to, which isn’t how any other OS is looking at it.

Actually, it was an issue at one point where no matter what I put in the size box, the BeFS partition was going to be just as small as the EUFI partition. I didn’t see any way around that, other than creating a partition in Windows or parted and then formatting over it with DriveSetup.

If you want to go back to MBR from GPT, just click on the disk in question from DriveSetup, choose Disk -> Initialize -> Intel Partition Map.

That should wipe out the GPT signatures at the beginning and end of the disk and write out a legacy MBR>

As for this, Haiku really won’t resize partitions currently, GParted will, but i’m pretty sure it won’t resize our native BFS filesystem.

The Intel Partition Map option was always greyed out for me.

It’s not re-sizing. Imagine, if you will, you have a 500GB hard drive that’s brand new, out of the box, has no partition scheme on it at all.

Then, using DriveSetup, you create an EFI partition by just choosing the defaults and using FAT32 (or exFAT or FAT16; whichever it is). That gets done and it’s about 4GB. That leaves whatever is left (say, 476GB just to pull numbers out of the air). So, 480 - 4 = 476GB should be available.

You go through the motions of creating a new partition for BeFS. DriveSetup clearly says it’s going to be 476GB, yet, when you finish, you have a new 4GB BeFS partition.

That’s what I mean. And I could delete that partition and remake it, it was still going to be the same size.

And that’s why I switched to other operating systems to see if I could get it sorted. Except re-doing the partitioning in an other OS just meant that Haiku was going to see it how it was, and not how it should currently be.

At least, how I think it should be. If there’s three methods of doing something and two partition tables, then I have no clue what’s going on with it at this point. I’ll just need more to time to fuss with it.

It should be grayed out unless your selecting the parent disk… however, it could be possible you’ve run into an edge case we haven’t tested. Could you post a screenshot of your DriveSetup window when you get a moment?

Thanks!

This bug has been around for a while, i thought there was a ticket for it on track but maybe i’m wrong or just nobady saw it?
No matter what you do DriveSetup always creates a smaller sized partition than the values you actually enter(manually or with a slider), choosing Disk → Initialize → Intel Partition Map (even several times ) won’t help, sometimes you get lucky after several tries, but i often end up using another tool to create the partition though.
Just plug in a usb stick and try for yourself the above steps.

I’d be happy to. Not sure when I’ll get to it, though. Maybe this weekend i can get time.
If it turns out to be a bug, I can write it up. Right now I’m going on the assumption that it’s a “things that happen to me” problem.

There is some strangeness around that Slider in the Partititon setup window. It technically should go lower down to zero but doesn’t.

I opened a ticket #14575 (BSlider label value set issues at min.) – Haiku to track.