Bug 206509 - Separate /var partition on UEFI
Summary: Separate /var partition on UEFI
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 10.2-STABLE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Steven Hartland
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-22 23:09 UTC by eu9gu4
Modified: 2016-01-27 01:31 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eu9gu4 2016-01-22 23:09:34 UTC
Installed 10.2 on a SSD in a UEFI machine. Booting nice, everything was OK until I made a separate partition that I was intending for /var.

gpart add -a 4k -s 8G -t freebsd-ufs -l bsdvar ada4

After this step I rebooted and everything was still OK. Then I did

newfs -U -j -L bsdvar ada4p4

After this step FreeBSD does not boot:

FreeBSD EFI boot block
loader path: /boot/loader.efi
File /boot/loader.efi not found
panic: load failed

If I boot now into my Linux system and delete the newly created BSD partition, FreeBSD boots fine again.

My drives setup is this (after creating the separate FreeBSD partition):

ada4 - 1TB HDD connected to 1st SATA port, sda1 in Linux
ada5 - 420GB SSD connected to 2nd SATA port, sda2 in Linux

ada4p1 - 16GB EFI system partition (boots all my other systems)
ada4p2 - 96GB Gentoo Linux alternate system
ada4p3 - 500GB transfer partition
ada4p4 - 8GB new created FreeBSD partition intended for /var

ada5p1 - 192GB Windows 10 partition
ada5p2 - 1GB Windows diag partition
ada5p3 - 1GB Microsoft Reserved Partition
ada5p4 - 96 GB Gentoo Linux main system
ada5p5 - 800kB EFI system partition created by FreeBSD install
ada5p6 - 64GB FreeBSD UFS partition

There are a few other hard drives in the system, fully occupied with zfs and
btrfs data file systems that are not touched by FreeBSD.

Before getting the SSD, I used to have a FreeBSD 10.2 system installed on ada4
(1st SATA disk), with separate partitions for /var, /usr/src and /usr/ports, working just fine.

I'd really like to have my FreeBSD system up and running again, so any help will be very appreciated.

Eugen
Comment 1 eu9gu4 2016-01-22 23:13:20 UTC
Sorry for the drive description:

ada4 is sda in Linux, with sda1,2,3... partitions
ada5 is sdb in Linux, with sdb1,2,3... partitions
Comment 2 Steven Hartland freebsd_committer 2016-01-23 13:56:07 UTC
UEFI support has had a major work in HEAD, so would appreciate it if you could confirm if this is fixed there.
Comment 3 Steven Hartland freebsd_committer 2016-01-23 16:26:24 UTC
To test this on the new version you should just need to update boot1 on your efi fat partition which can easily be done with gpart.

If you can't build head lmk and I can upload a 10.2 efi fat image for you as that's what we are using here, backported from head.

I do intend to start MFC'ing the EFI changes to 10 shortly in the hope of getting it all in before 10.3 code freeze but that all depends on getting enough test coverage from people like yourselves so that we're comfortable with the changes.
Comment 4 eu9gu4 2016-01-23 23:59:42 UTC
(In reply to Steven Hartland from comment #3)

Installed CURRENT and rebuilt kernel and world.

Was able to use separate /var, /usr/src and /usr/ports partitions.

Will start tomorrow to build my system from ports, but the base system seems to be working fine.

I'd love to have these changes pushed to 10.3-STABLE so I can use that instead instead of HEAD.

Let me know if you need any more of my feedback after building ports.

Thanks for your input.

One last question: how do I build the loader that is put by the installer on the EFI FAT partition?

/e
Comment 5 Steven Hartland freebsd_committer 2016-01-24 00:54:29 UTC
(In reply to eu9gu4 from comment #4)
Really appreciate that feedback thx
Comment 6 Steven Hartland freebsd_committer 2016-01-24 10:52:08 UTC
The target is the efi target so:
make buildenv
cd sys/boot/efi
make
make install # if you want to install it to /boot
exit

You can then use gpart bootcode .... to install it to your efi partition
Comment 7 eu9gu4 2016-01-24 13:44:14 UTC
Thanks.

Please let me know if you manage to get the EFI changes into 10.3 STABLE.
Gave up on using CURRENT, the system crashes on almost every move I make.

/e
Comment 8 Steven Hartland freebsd_committer 2016-01-24 14:14:43 UTC
You should be able to just use heads boot1 and loader.efi on 10.x
Comment 9 eu9gu4 2016-01-24 19:38:59 UTC
(In reply to Steven Hartland from comment #8)

I tried: reinstalled 10.2, updated /usr/src and then replaced sys/boot/efi with the one from head. Rebuilding the system fails in... sys/boot/efi.

Don't have the knowledge to dig further and make it work.

I'll wait patiently for release of 10.3... maybe it gets fixed there.

Thanks.

/e
Comment 10 Steven Hartland freebsd_committer 2016-01-24 20:23:44 UTC
Don't replace it on source, just build a full head version then replace the three built files:
* boot1.efi
* boot1.efifat (don't forget to install using gpart)
* loader.efi

Obviously before installing taking a backup if you need the data is always a good idea.
Comment 11 eu9gu4 2016-01-25 01:16:33 UTC
(In reply to Steven Hartland from comment #10)

I believe we can close this bug now when everything is clarified. Leave that to you. Thanks.
Comment 12 eu9gu4 2016-01-27 00:14:05 UTC
(In reply to Steven Hartland from comment #10)

Hi Steven,

Do you know more than what's shown here

http://wiki.freebsd.org/SecureBoot

on the status of SecureBoot on FreeBSD?

I am using this for quite some time in Linux.
It would be nice to boot FreeBSD under a SecureBoot UEFI setting.

/e
Comment 13 Steven Hartland freebsd_committer 2016-01-27 01:31:26 UTC
I don't know anything about secure boot I'm afraid.