Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FreeBSD 9.0 - GPT boot problems?

233 views
Skip to first unread message

Torfinn Ingolfsen

unread,
Mar 24, 2012, 1:27:30 PM3/24/12
to freebsd...@freebsd.org
Hi,
I just installed FreeBSD 9.0-release / amd64 on a new machine (Acer Aspire X1470).
I installed from a usb memory stick (the default amd64 image), which I booted by pressing "F12" and selecting it from the boot menu on the machine.
I installed on a SSD (which replaced the hard drive originally in the machine), using the default scheme for 9.0 (GPT).
The installation was painless (many thanks to all who made it that way), but when I try to boot the machine from the SSD afterwards, I just get this message from the BIOS:
"ERROR: No boot disk has been detected or the disk has failed."
I tried selecting the SSD from the boot menu (via F12) instead (it shows up as "EFI: M4-CT128M4SSD2"), but got the same message.
I upgraded the BIOS from version P01-A3 to version P01-A4 (the newest available), still no dice.

If I use the usb stick I installed from, I can select the boot device, and actually boot from it, so there doesn't seem to be anything wrong with the SSD.
I tried:
kg-vm2# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
bootcode written to ada0

in case there was something wrong with the bootcode, but I still get the message "ERROR: No boot disk has been detected or the disk has failed."
gpart shows this:
root@kg-vm2# gpart show ada0
=> 34 250069613 ada0 GPT (119G)
34 128 1 freebsd-boot (64k)
162 119537664 2 freebsd-ufs (57G)
119537826 8388608 3 freebsd-swap (4.0G)
127926434 121634816 4 freebsd-ufs (58G)
249561250 508397 - free - (248M)
and root is on ada0p2, with swap on ada0p3:
root@kg-vm2# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/ada0p2 56G 2.3G 49G 4% /
devfs 1.0k 1.0k 0B 100% /dev
root@kg-vm2# swapinfo -h
Device 1K-blocks Used Avail Capacity
/dev/ada0p3 4194304 0B 4.0G 0%

Has anyone seen anything like this before?
Any hints on what I can do?

References:
1) http://sites.google.com/site/tingox/aspire_x1470_fbsd
--
Torfinn Ingolfsen <torfinn....@getmail.no>
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stabl...@freebsd.org"

Christian Laursen

unread,
Mar 24, 2012, 1:52:14 PM3/24/12
to freebsd...@freebsd.org
On 03/24/12 17:26, Torfinn Ingolfsen wrote:
> Hi,
> I just installed FreeBSD 9.0-release / amd64 on a new machine (Acer Aspire X1470).
> I installed from a usb memory stick (the default amd64 image), which I booted by pressing "F12" and selecting it from the boot menu on the machine.
> I installed on a SSD (which replaced the hard drive originally in the machine), using the default scheme for 9.0 (GPT).
> The installation was painless (many thanks to all who made it that way), but when I try to boot the machine from the SSD afterwards, I just get this message from the BIOS:
> "ERROR: No boot disk has been detected or the disk has failed."
> I tried selecting the SSD from the boot menu (via F12) instead (it shows up as "EFI: M4-CT128M4SSD2"), but got the same message.
> I upgraded the BIOS from version P01-A3 to version P01-A4 (the newest available), still no dice.

It sounds a bit like the BIOS thinks that since the disk uses GPT you
want to EFI boot. As far as I know the default bootcode in the PMBR is
meant for old style BIOS booting.

Is it possible to disable EFI in your BIOS? If that is the case, that's
probably the easiest solution.

I'm unsure of the current state of EFI boot in FreeBSD but a little bit
of searching did not look promising.

--
Christian Laursen

Torfinn Ingolfsen

unread,
Mar 24, 2012, 3:05:39 PM3/24/12
to freebsd...@freebsd.org
On Sat, 24 Mar 2012 18:50:13 +0100
Christian Laursen <x...@borderworlds.dk> wrote:

> It sounds a bit like the BIOS thinks that since the disk uses GPT you
> want to EFI boot.

That could very well be the case.

> As far as I know the default bootcode in the PMBR is
> meant for old style BIOS booting.

Hmm, I was hoping that the pmbr / gptboot would work "both ways".

> Is it possible to disable EFI in your BIOS? If that is the case, that's
> probably the easiest solution.

No, I haven't found any place to do that.
Before I installed FreeBSD on this SSD (before it was partitioned with gpart) it showed up in
the BIOS under "hard drive". (Other choices are "removable drive"
Now it shows up under "EFI device", and doesn't show up under "hard drive".

> I'm unsure of the current state of EFI boot in FreeBSD but a little bit
> of searching did not look promising.

Yes, after a bit of searching I agree with you.
If anyone knows of a EFI capable boot loader for FreeBSD, I'm willing to try it.
Rather that, than having to deal with grub, elilo or the other stuff.
--
Torfinn Ingolfsen <torfinn....@getmail.no>

Torfinn Ingolfsen

unread,
Apr 1, 2012, 5:15:53 PM4/1/12
to freebsd...@freebsd.org
On Sat, 24 Mar 2012 17:26:03 +0100
Torfinn Ingolfsen <torfinn....@getmail.no> wrote:

> Hi,
> I just installed FreeBSD 9.0-release / amd64 on a new machine (Acer Aspire X1470).
> I installed from a usb memory stick (the default amd64 image), which I booted by pressing "F12" and selecting it from the boot menu on the machine.
> I installed on a SSD (which replaced the hard drive originally in the machine), using the default scheme for 9.0 (GPT).
> The installation was painless (many thanks to all who made it that way), but when I try to boot the machine from the SSD afterwards, I just get this message from the BIOS:
> "ERROR: No boot disk has been detected or the disk has failed."
> I tried selecting the SSD from the boot menu (via F12) instead (it shows up as "EFI: M4-CT128M4SSD2"), but got the same message.
> I upgraded the BIOS from version P01-A3 to version P01-A4 (the newest available), still no dice.

Just an update:
today I connected another disk to the machine (I used a sata-to-usb adapter, but I think that doesn't matter), this disk is MBR-partitioned,
and the machine boots from this with no problems using the boot menu (via F12).
root@kg-vm2# gpart show -p da1
=> 63 117210177 da1 MBR (55G)
63 29350692 da1s1 freebsd (14G)
29350755 29360079 da1s2 freebsd [active] (14G)
58710834 58499406 - free - (27G)

The non-working disk looks like this:
root@kg-vm2# gpart show -p ada0
=> 34 250069613 ada0 GPT (119G)
34 128 ada0p1 freebsd-boot (64k)
162 119537664 ada0p2 freebsd-ufs (57G)
119537826 8388608 ada0p3 freebsd-swap (4.0G)
127926434 121634816 ada0p4 freebsd-ufs (58G)
249561250 508397 - free - (248M)


--
Torfinn

Kevin Oberman

unread,
Apr 1, 2012, 7:50:28 PM4/1/12
to Torfinn Ingolfsen, freebsd...@freebsd.org
Just for reference, my GPT disk boots fine on my ThinkPad with the following:
> gpart show /dev/ada1
=> 34 1465149101 ada1 GPT (698G)
34 6 - free - (3.0k)
40 128 1 freebsd-boot (64k)
168 2097152 2 freebsd-ufs (1.0G)
2097320 8388608 3 freebsd-swap (4.0G)
10485928 10217472 4 freebsd-ufs (4.9G)
20703400 1048576 5 freebsd-ufs (512M)
21751976 124539712 6 freebsd-ufs (59G)
146291688 31134928 - free - (14G)
177426616 1287722512 7 freebsd-ufs (614G)
1465149128 7 - free - (3.5k)

The disk has native 4K sectors, so the partitions are aligned
accordingly. That is why the free chunk at the beginning. the second
free chunk is due to my error which I'll get around to adding to p6
some day. I use traditional partitions (root, tmp, var, bin, and home)
and the home partition is GELI encrypted. (I I had hardware crypto
support, I'd encrypt everything.)

The disk does have the protective MBR installed, though it's not
really part of the GPT. (See the "GUID Partition Table" article on
Wikipedia for more information.)
--
R. Kevin Oberman, Network Engineer
E-mail: kob...@gmail.com

Torfinn Ingolfsen

unread,
Aug 3, 2012, 7:11:19 PM8/3/12
to freebsd...@freebsd.org
Just a short update on this machine (Acer Aspire X1470) and the GPT / UEFI situation.

Today I set up another partition, EFI system partition. The partyitions now looks like this:
root@kg-vm2# gpart show ada0
=> 34 250069613 ada0 GPT (119G)
34 128 1 freebsd-boot (64k)
162 119537664 2 freebsd-ufs (57G)
119537826 8388608 3 freebsd-swap (4.0G)
127926434 121634816 4 freebsd-ufs (58G)
249561250 204800 5 efi (100M)
249766050 303597 - free - (148M)

I formatted the partition like this:
root@kg-vm2# newfs_msdos -F32 /dev/ada0p5
newfs_msdos: trim 50 sectors to adjust to a multiple of 63
/dev/ada0p5: 204512 sectors in 12782 FAT32 clusters (8192 bytes/cluster)
BytesPerSec=512 SecPerClust=16 ResSectors=32 FATs=2 Media=0xf0 SecPerTrack=63 Heads=16 HiddenSecs=0 HugeSectors=204750 FATsecs=100 RootCluster=2 FSInfo=1 Backup=2

I have tried putting an EFI shell on it (I got the idea from this[1] page, I have tried both the 1.0 and 2.0 x64 shell), like this:
root@kg-vm2# mount -t msdosfs /dev/ada0p5 /mnt
root@kg-vm2# ls -l /mnt
total 848
drwxr-xr-x 1 root wheel 8192 Aug 3 14:30 EFI
drwxr-xr-x 1 root wheel 8192 Aug 3 16:21 boot
-rwxr-xr-x 1 root wheel 847232 Aug 3 14:56 shellx64.efi
root@kg-vm2# ls -l /mnt/boot
total 760
-rwxr-xr-x 1 root wheel 771072 Aug 3 16:23 bootx64.efi
root@kg-vm2# ls -l /mnt/EFI
total 16
drwxr-xr-x 1 root wheel 8192 Aug 3 14:30 FreeBSD
drwxr-xr-x 1 root wheel 8192 Aug 3 15:06 boot
root@kg-vm2# ls -l /mnt/EFI/boot
total 760
-rwxr-xr-x 1 root wheel 771072 Aug 3 15:29 bootx64.efi

but no dice - it is not working, it still prints "ERROR: No boot disk has been detected or the disk has failed."
when I try to boot from this disk.
How do I figure out where this UEFI firmware that Acer has put in this machine is getting it's boot manager and or boot loader from?
I tried running 'strings -f' on the BIOS file (sorry, UEFI firmware), that got me all the EFI error messages, but nothing useful.
Googling didn't help either.

References:
1) https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface

Kevin Oberman

unread,
Aug 4, 2012, 2:00:02 AM8/4/12
to Torfinn Ingolfsen, freebsd...@freebsd.org
It's not clear from your message, but did you use the gpart bootcode
command to write the protective MBR and the gptboot code as documented
in the gpart(8) man page?
--
R. Kevin Oberman, Network Engineer
E-mail: kob...@gmail.com

Thomas Mueller

unread,
Aug 4, 2012, 3:12:44 AM8/4/12
to freebsd...@freebsd.org, Torfinn Ingolfsen
> On Fri, Aug 3, 2012 at 3:09 PM, Torfinn Ingolfsen
> <torfinn....@getmail.no> wrote:
> > Just a short update on this machine (Acer Aspire X1470) and the GPT / UEFI situation.

> > Today I set up another partition, EFI system partition. The partyitions now looks like this:
> > root@kg-vm2# gpart show ada0
> > => 34 250069613 ada0 GPT (119G)
> > 34 128 1 freebsd-boot (64k)
> > 162 119537664 2 freebsd-ufs (57G)
> > 119537826 8388608 3 freebsd-swap (4.0G)
> > 127926434 121634816 4 freebsd-ufs (58G)
> > 249561250 204800 5 efi (100M)
> > 249766050 303597 - free - (148M)

> > I formatted the partition like this:
> > root@kg-vm2# newfs_msdos -F32 /dev/ada0p5
> > newfs_msdos: trim 50 sectors to adjust to a multiple of 63
> > /dev/ada0p5: 204512 sectors in 12782 FAT32 clusters (8192 bytes/cluster)
> > BytesPerSec=512 SecPerClust=16 ResSectors=32 FATs=2 Media=0xf0 SecPerTrack=63 Heads=16 HiddenSecs=0 HugeSectors=204750 FATsecs=100 RootCluster=2 FSInfo=1
> +Backup=2
The gpart bootcode command is quite apart from and unrelated to (as far as I can tell) the EFI partition.

I think the EFI partition is supposed to be the first partition on a GPT-partitioned disk.

I have installed FreeBSD to a USB stick, GPT-partitioned with three partitions: boot, root and swap.

I used gpart bootcode command to make the USB stick bootable, there was no EFI partition in this case.

This is good if FreeBSD is the only OS installed to a disk.

EFI partition is to allow sharing a hard drive with multiple OS installations.

Tom

Torfinn Ingolfsen

unread,
Aug 4, 2012, 10:20:42 AM8/4/12
to freebsd...@freebsd.org
On Fri, 03 Aug 2012 22:58:52 -0700
Kevin Oberman <kob...@gmail.com> wrote:

>
> It's not clear from your message, but did you use the gpart bootcode
> command to write the protective MBR and the gptboot code as documented
> in the gpart(8) man page?

Yes (this is why I wrote this message as a followup to the thread), all that was done in my first attempt, the problem is that the brain-dead firmware in this machine
sees a GPT-partitioned disk and decides for itself that GPT = (U)EFI, and thus looks only for the EFI system partition, it does not try to boot from the gptboot in the freebsd-boot partition.
If I use a MBR-partitoned drive, it boots ok.
And yes, the BIOS (sorry, UEFI firmware) is the latest that Acer has provided for this machine.

Just trying to make haeds and tails out of this UEFI thing, to see if it is a workable solution.
--
Torfinn Ingolfsen <torfinn....@getmail.no>

Torfinn Ingolfsen

unread,
Aug 4, 2012, 10:25:16 AM8/4/12
to freebsd...@freebsd.org
Yes, this is what I have found out too.

> I think the EFI partition is supposed to be the first partition on a GPT-partitioned disk.

This is not required by the specification as far as I can tell, but there are writings on the net saying that some implementations
requires this (MS Win7 for example).


> I have installed FreeBSD to a USB stick, GPT-partitioned with three partitions: boot, root and swap.

FWIW, I also use GPT-partitoned disks on many of my other machines; they work fine. It is (so far) only this machine which has this problem.

>
> EFI partition is to allow sharing a hard drive with multiple OS installations.

The EFI system partition is also the place where (U)EFI firmwae will look for boot loaders, in order to load operating systems.

YMMV.
--
Torfinn Ingolfsen <torfinn....@getmail.no>

Scot Hetzel

unread,
Aug 4, 2012, 3:14:42 PM8/4/12
to Torfinn Ingolfsen, freebsd...@freebsd.org
On Sat, Aug 4, 2012 at 9:23 AM, Torfinn Ingolfsen
<torfinn....@getmail.no> wrote:
>> The gpart bootcode command is quite apart from and unrelated to (as far as I can tell) the EFI partition.
>
> Yes, this is what I have found out too.
>
>> I think the EFI partition is supposed to be the first partition on a GPT-partitioned disk.
>
> This is not required by the specification as far as I can tell, but there are writings on the net saying that some implementations
> requires this (MS Win7 for example).
>
>
http://msdn.microsoft.com/en-us/windows/hardware/gg463525.aspx

Microsoft wants the GPT Disks partitions layouted as:

Extensible Firmware Interface System Partition (ESP) ~100MB

OEM Partition (optional)

Microsoft Reserved Partition (MSR) [Drive <16GB - MSR = 32MB, Drive
>= 16GB - MSR = 128MB]
- used to reserve space that is later broken in to smaller partition
for use by meta data (i.e. dynamic disks)

Data Partitions (FAT, NTFS, ...)

If these partitions (ESP, OEM and MSR) were mixed in with the Data
Partions, then you would be unable to grow the filesystems.

Scot
0 new messages