# Problems installing FreeBSD 12 on Fujitsu Celsius W570 power



## silvius (Feb 20, 2019)

Hi everybody,

I've tried several times to get FreeBSD 12 running on a Fujitsu Siemens CELSIUS W570 power hardware.

The available links https://wiki.freebsd.org/UEFI and http://www.wonkity.com/~wblock/docs/html/disksetup.html helped me very much to do gpart(8) practice and try solving the problem, but without success in my situation.

The target for me is installing the OS on NVMe device (/dev/nvd0), this mainly because of the speed performance, but trying on HDD/SDD devices via SATA (/dev/ada0) is also not working.

The problem is that the BIOS firmware doesn’t detect the FreeBSD EFI partition and in the boot menu there is no UEFI compatible device, except the USB pendrive having the 12th release installation image.

I’ve also updated the BIOS firmware to the last version R1.19.0 (08/16/2018), but with no success for FreeBSD.

Other operating systems like Linux or Windows can be installed with UEFI enabled and working fine, but I really need FreeBSD on this machine.

As for BIOS settings I have the following:
 - SATA Mode: AHCI Mode
 - Lunch CMS: Enabled
 - Boot filter: UEFI and Legacy

As for other BIOS information I have the following:
 - Core version: Fujitsu 5.0.0.12
 - Mother board: D3517-A13
 - Compliancy: UEFI 2.5; PI 1.4

If anyone has a working FreeBSD on such hardware, or if somebody has any idea about how can I solve the problem, please give me a sign.

All the best,
Silvius


----------



## SirDice (Feb 20, 2019)

Enable CSM (CSM booting) and use a 'traditional' BIOS boot. The installer will also allow you to create a setup that allows both UEFI and CSM boots.

I have a couple of machines at home with UEFI but none of them seem to like FreeBSD's UEFI boot.


----------



## silvius (Feb 21, 2019)

SirDice said:


> Enable CSM (CSM booting) and use a 'traditional' BIOS boot. The installer will also allow you to create a setup that allows both UEFI and CSM boots.
> 
> I have a couple of machines at home with UEFI but none of them seem to like FreeBSD's UEFI boot.



I just noticed that the USB pendrive with the memstick image of release 12 is not booting in a 'traditional' way (e.g. 'BIOS Legacy only'). I get some errors on the screen ending with 'BTX halted' (see the picture attached).






Looking more into this issue, I have also found a very useful discussion here  PR 227954
To summarize up, somebody detected the boot problem and even provided a so called hybrid ISO which works ok on my system with traditional BIOS boot settings. *However, the image is not helping me much with the installation *because it's a mini memstick image under revision and I need a full installation image as stable release 12.

Is there a way to *officially download* a so called hybrid ISO image, containing the full installation image of the last release? as per last comment in the link above.. or some image only designed for BIOS Legacy only with last release?..

My last option is to burn the available ISO image to an external DVD and try a so called BIOS boot.


----------



## silvius (Feb 21, 2019)

I've just tried booting traditional way using an external DVD unit with the dvd image of FreeBSD 12 release and I still get the same problem with 'BTX halted'.

This happens with the following BIOS settings:

SecureBoot: *Disabled*
CSM booting: *Enabled*
Booting filter: *Legacy only*
SATA Mode: *AHCI Mode*

Can anybody confirm if the 12 release can traditionally boot on real hardware using the USB memstick image or the DVD iso burned?
Thank you for your time!


----------



## SirDice (Feb 21, 2019)

Well, it does boot. It crashes on the bootloader. If it didn't boot it would't even get that far. Which image are you trying?


----------



## silvius (Feb 21, 2019)

SirDice said:


> Well, it does boot. It crashes on the bootloader. If it didn't boot it would't even get that far. Which image are you trying?



*FreeBSD-12.0-RELEASE-amd64-dvd1.iso* burned on a real DVD or *FreeBSD-12.0-RELEASE-amd64-memstick.img*  on a USB. With both I get this on the screen.

I have to admit that with the image mini-image-by-emaste found at PR 227954 works fine booting from USB, but it is not a final release to go, and somebody pointed out in the last comment the following:


> The hybrid ISO image dd'd to USB flash works fine. Handbook should probably mention that the ISO can be used with USB flash. PR 227954



What I don't understand is what is a *hybrid ISO image?*.. and which one from the 12 release link is good to go as hybrid?
This is the link I am using to get the 12 release: https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/12.0/


----------



## SirDice (Feb 21, 2019)

silvius said:


> What I don't understand is what is a *hybrid ISO image?*


It's able to boot the "CD" way using El Torito and is capable of booting the harddisk way. That's why you "burn" an ISO image to a memory stick. 





						Hybrid disc - Wikipedia
					






					en.wikipedia.org
				






silvius said:


> and which one from the 12 release link is good to go as hybrid?


As far as I know all ISO images for 12.0-RELEASE are hybrids. Previous versions, like 11.2-RELEASE, are El Torito only. 

What is the exact CPU type of the machine? I see it can be can be bought different CPU options.


----------



## silvius (Feb 21, 2019)

The CPU is 3.8 GHz Intel Xeon E3-1275 V6


----------



## silvius (Feb 22, 2019)

Problem solved 

Here is the solution:

1. Write the official release on a USB device (*/dev/disk3* for my case):

`dd if=FreeBSD-12.0-RELEASE-amd64-memstick.img of=/dev/disk3 bs=1m conv=sync`

2. Change BIOS settings to "UEFI and Legacy"

3. Boot the USB device in UEFI mode and *try insist on installing the OS on a MBR partition table*. There should be at least a *freebsd-ufs* as root file system and a *freebsd-swap*

4. The installation is not going to boot properly, so better enter in the shell before rebooting, and use the following commands to manipulate the device in subject (*nvd0* in my case):

`gpart bootcode -b /boot/mbr nvd0
gpart bootcode -b /boot/boot nvd0s1
gpart set -a active -i 1 nvd0`

5. Write the development image found at PR 227954 on the USB device:

`dd if=mini-image-2018-05-28-amd64.img of=/dev/disk3 bs=1m conv=sync`

6. Change BIOS settings to "Legacy only"

7. Boot the USB device traditionally and once logged into the root shell, try use the following commands for *checking and replacing the bootloader* of the fresh install with the working bootloader from the USB:

`mount /dev/nvd0s1 /mnt
ls -asl /mnt/boot/loader
ls -asl /boot/loader
cp -p /boot/loader /mnt/boot/loader
reboot`

I am very happy it works!.. 
I hope this can help others too!..

I still don't know if this solution needs to be applied to other hardware too or is just necessary on my Fujitsu W570.
Maybe the thread title must be changed to "Problems installing FreeBSD 12 on traditional BIOS Legacy hardware (non-UEFI)". Please advice!

Best,
Silvius


----------



## Nemo1024 (Aug 15, 2019)

I have a somewhat related situation after upgrading from 11.0 to 12.0.
/boot and /root are on a zfs system
BIOS is set to Legacy+UEFI
After the upgrade I upgraded the zroot pool with `zpool upgrade` and installed the updated bootcode using `gpart` (as outlined here: https://forums.freebsd.org/threads/upgrading-zfs-pools.51429/).
`gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada6`

Here is the layout of the system disk, with the root zfs mirrored on the same drive:

`# gpart show
=>       40  468862048  ada6  GPT  (224G)
         40         24        - free -  (12K)
         64        512     1  freebsd-boot  (256K)
        576   33554432     2  freebsd-zfs  (16G)
   33555008   33554432     3  freebsd-zfs  (16G)
   67109440    2097152     4  freebsd-ufs  (1.0G)
   69206592  209715200     5  freebsd-ufs  (100G)
  278921792  189940296        - free -  (91G)`

When rebooting I get a similar "BTX halted" screen.

There is an interesting twist: I created a memstick from FreeBSD-12.0-RELEASE-amd64-memstick.img to try to get back into the , and as long as the memstick is inserted into the USB port, I manage to boot into the system, while removing the memstick gives me "BTC halted". It's as if the system starts to boot off /zroot/boot, but then proceeds to load some code from the USB memstick, and then proceeds to boot to /zroot

Here is the memstick, I see that is has the efi boot partition:

`=>       1  60549119  diskid/DISK-1C1B0D65F65EC270E962D110  MBR  (29G)
         1      1600                                     1  efi  (800K)
      1601   1904464                                     2  freebsd  [active]  (930M)
   1906065  58643055                                        - free -  (28G)`

I suspect that there were some UEFI/Legacy changes introduced between 11 and 12 that broke my boot.

This is a work-around, but I'd rather have a more permanent solution...

EDIT: Looking at the timestamps of the files in /boot, I see that mbr and pmbr are from 2016, while the rest of the files got the new timestamp after the upgrade process. Don't know if it's significant.


----------



## Nemo1024 (Aug 17, 2019)

Have spent almost a week trying to get the system to boot, I finally found a solution to the "BTX halted" problem.
This bug report pointed me in the right direction : https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239052
First of all, I updated the BIOS from year 2012 version to the latest year 2014 version. Then i disabled Legacy support in the BIOS, leaving only UEFI.
I then booted into the memory stick Live CD (after the changes to the BIOS, booting went staright to the kernel, not showing the FreeBSD boot menu).
As seen in my post above, I have quite a lot of free space left on the system drive.
After booting to LiveCD, I went ahead and created an efi partition in that free space. EFI does not need to be the first partition:
`gpart add -t efi -s 1M ada6`

`# gpart show ada6
=>       40  468862048  ada6  GPT  (224G)
         40         24        - free -  (12K)
         64        512     1  freebsd-boot  (256K)
        576   33554432     2  freebsd-zfs  (16G)
   33555008   33554432     3  freebsd-zfs  (16G)
   67109440    2097152     4  freebsd-ufs  (1.0G)
   69206592  209715200     5  freebsd-ufs  (100G)
  278921792       2048     6  efi  (1.0M)
  278923840  189938248        - free -  (91G)`

1 Megabyte is more then enough to copy the image from /boot of the memstick, which I did next:
`dd if=/boot/boot1.efifat of=/dev/ada6p6`

Followed by:
`reboot`

Removed the memstick and watched the system boot into zfs zroot system, also mounting my zstore in the process.
The only thing that's missing is the menu befor the boot to the kernel commences, but it's no big loss for now.


----------

