Trying to install to HDD; Expand BeFS?

Previously, I was able to run Haiku on my machine from a USB drive, but I had some I/O issues, and it was advised that I use a real hard drive. Makes sense.

I was cleaning up my office and found an old spinning drive, and I figured I’d give it a try. I used dd to copy the USB thumb drive to this drive, rebooted, and I was able to use it. The problem is that the thumb drive was 32 GB, the HDD is 120 GB, and I couldn’t figure out how to expand the drive.

I decided to reinstall Haiku on the HDD. I ran in to a bunch of issues:

  • I created the BeFS and EFS partitions, and the bootloader would say that it could not find to drive to boot from. In Linux, using fdisk, it turns out the drive was MBR not GPT. I restarted and tried to legacy boot the drive, again the bootloader couldn’t find a partition to boot from.
  • I reinstalled, this time deciding to not use EFI. I created only a BeFS partition, installed, rebooted, bootloader could not find the drive to boot from.
  • I followed the instructions for installing from disk image to partition. This seemed to go well, and I was able to boot into Haiku using legacy boot! But now I have a new problem: df -h on the console says I have 600 MB, but Drive Setup reports 117 GB. I also followed the optional instruction in making the partition type eb in fdisk. I noticed now that in Linux, fdisk says the partition type for Haiku isn’t known, but previously, it said it was BeFS.

How can I get around this? What’s the best way to boot, and why am I having such problems with the bootloader? How can an existing BeFS partition be expanded to the size of the drive? Why the discrepancy in the screenshot?
Thank you.

screenshot1

Boot up that USB stick, use DriveSetup to format that entire 111.74GB partition as BFS (2KB sector size recommended, indices enabled).

Then reboot and run the installer on the USB stick to install to the volume you formatted in the previous step (it basically copies the USB stick’s files to the new Haiku volume and then makes it bootable).

But is that EFI or MBR boot stuff there? If it was working, leave it be, should be able to find the reformatted disk volume and boot from it. If not, maybe leave the disk unpartitioned and use the whole thing as a BFS volume. Oh, AHCI mode is best in your BIOS settings for the hard drive controller.

When using the installer, I was getting an partition which could not be found by the bootloader, and unfortunately, I don’t see a way to specify or know if a partition is GPT or MBR.

The screenshot was from the bios-booted Haiku, even though the EFI partition is present. I didn’t try it after using dd from Linux to apply the raw image to the partition.

I don’t understand how du and Drive Setup can be in disagreement.

There should be normally no disagreement… from what i know. So i guess the volumen is corrupted. Please open the terminal and run chkbfs /yourboootpartition :smiley:

You only had 600 Mb in your partition even though the MBR says otherwise as you dd’ed the image to the drive instead of installing it with the installer… basically there is a partition with a small image in it.

dd is dumb and doesn’t know how to copy files from one filesystem to another… so it doesn’t actually do what you want.

Is having only a 600 MB image supposed to be the final result of Installing a Haiku Image to a Disk Partition? Can the resulting filesystem on the hard drive be expanded?

Yes it is. The key is this " install Haiku from Linux on a spare hard disk partition", basically you can turn off swap on your Linux OS, dd Haiku to the swap partition and boot it… then install to the large a larger partition on the same disk without having separate media. Then when done just mkswap from Linux on your swap partition and reboot or swapon -a to turn your swap back on.

It is intended that you use that partition to install to another full partition… but the guide should probably clarify that.

1 Like

That can be a cause for confusion. If the BIOS boot loader is looking for a GPT partition, then it may pick up the dregs of an old one since it is stored both at the beginning and end of the disk, even if you redid the partitioning as MBR.

Any idea of what your BIOS wants to boot? Easiest to pick the partition scheme for the disk appropriately after you know that. Linux fdisk can be used to create it, hopefully it removes GTP stuff if you use MBR, if not, search for “delete gpt table”.

My machine boots either. The boot menu shows EFI and Legacy for all boot drives. It looks like I’m using EFI for Linux and Legacy for Windows 10. I created a new BeFS in fdisk with MBR, and will try to reinstall.

By the way, I have my system set up with GPT and UEFI boot for the main disk, and MBR/Legacy BIOS boot for the secondary disk with Haiku and MS-DOS (just for fun) on it.

I need to hit a key when rebooting to get the BIOS boot menu to show up, and pick that secondary disk to get it started. The boot menu mixes together UEFI boot targets (so you get several bootable things on drive P1) and legacy MBR disk boot (it just names the disk for MBR).

20190428%20Boot%20Menu

I just use the Windows bootloader for everything since it’s less headache.

I use EasyBCD to edit the windows bootloader entries and disable the graphical bootloader as it is very slow and requires a reboot to load into any OS other than Windows.

I tried again to use the installer to format and install directly on the HDD (/dev/disk/scsi/1/0/0/) and again the bootloader can’t find the partition. Back in Linux, I have an interesting result with fdisk:

Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x202e534f

Device Boot Start End Sectors Size Id Type
/dev/sda1 544826731 2459555038 1914728308 913G 61 SpeedStor
/dev/sda2 2037581312 3872946802 1835365491 875.2G 74 unknown
/dev/sda3 1634208883 3235739611 1601530729 763.7G 6b unknown
/dev/sda4 0 0 0 0B 65 Novell Netware 386

It seems the Haiku Installer tried to create partitions which exceed the space on the device!
Why is this so difficult?

I formatted the HDD as GPT with an EFI partition and BeFS partition. Again, the installer didn’t install correctly, and on reboot, there wasn’t a Haiku partition to boot from. Going back to Linux and using fdisk, I see that Drive Setup again made partitions which don’t compare with what was instructed:

Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x202e534f

Device Boot Start End Sectors Size Id Type
/dev/sda1 1 58610411 58610411 28G ee GPT

Also, the disklabel type says DOS when I created a GPT partition. It’s also interesting that when I create the partition with fdisk in Linux as eb, the Installer in Haiku shows it as greyed out, requiring that I muck with it with Drive Setup.

  • What does the installer require from the BeFS partition to make it useful for install?
  • Is there a bug in Drive Setup causing my headaches, or am I doing something wrong?

Booting the Haiku USB thumb drive as Legacy or EFI seems to yield the same results, except that Legacy boot allows Haiku to use my full desktop resolution (2560x1440 I think) instead of something looking like 800x600 with EFI. So Legacy mode would be best I think. Thoughts?

DOS? Is your fdisk smart enough to understand GPT? There’s also a protective dummy MBR header on GPT disks so that older software doesn’t try to overwrite the GPT partitions, which is what you see here. Maybe there’s an fdisk flag telling it to edit the GPT partition table.

I recommend that you set up all the GPT partitions using fdisk, then use DriveSetup to format the BFS partition, only format, not change the partitions. Then try installing. If that doesn’t work, use MBR partitioning (and wipe out the GPT remnants).

Interestingly enough, I tried again with the R1Beta instead of the Nightly, and the Beta was able to install a bootable partition. Sadly though, networking didn’t work (though it works with the Nightly).

I don’t want to mess too much with my drives, since I have an EFI Linux partition, MSB Windows partitions, and non-bootable NTFS data drives. I’d loose a lot if I managed to screw things up.

I just tried the latest nightly build in Virtual Box. I created a 10 GB virtual drive, asked DriveSetup to initialize the drive for BeFS and install Haiku. On reboot, there was a boot error, which might have been from Virtual Box. I ran the installer again, and DriveSetup showed the virtual disk as having a 2.5 GB BeFS partition, and the remaining 7.5 GB as free space.

It seems there’s a major regression with DriveSetup. I’ve never had so much difficulty with DriveSetup and getting Haiku running as I’ve had today.

And the virtual network in VirtualBox sometimes works, sometimes doesn’t. After Haiku was installed, the network didn’t work. I rebooted, and the network worked. I tried to install BePDF from HaikuDepot, and Haiku froze during install. I rebooted the VM, and now networking doesn’t work again. VBox is showing an Intel network adapter which I have bridged to my Ethernet network, and sometimes Haiku isn’t getting an IP from DHCP, yet seems to get DNS settings somehow.

Before someone else mentions it, yes, I know that Haiku comes in two flavours at the moment: beta and pre-alpha-testing. Neither are perfect or big-free. But recently it’s gone from the occasional odd bug to almost not usable. I was using an older nightly build when doing some software porting, and using it for hours on bare metal with zero OS problems.

I haven’t noticed those problems myself… and I typically run a Haiku nighly on Vbox.

Hello. Maybe is not the more elegant way, but you can try the following:

  1. Install the R1 Beta, and check if the partition boots correctly.
  2. Using a USB drive, boot a recent nightly.
  3. Install nightly (using Installer) and select the partition where the R1 Beta is. This will overwrite the packages with the Nightly version.

Hi,

It seems that there was a regression somewhere since beta1 and the Installer does not result in a bootable system anymore. We should fix that. It went unnoticed because people apparently rarely do a clean install.

1 Like

Works fine to install hrev 53021 and then update to the latest one.
Yesterday I went through the exact same thing as you, @rjzak.

Hopefully there’s a fix avaliable soon :slight_smile: