Bug 161677 - gpart(8) Probably bug in gptboot
Summary: gpart(8) Probably bug in gptboot
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-15 10:30 UTC by yerenkow
Modified: 2018-05-23 23:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yerenkow 2011-10-15 10:30:05 UTC
When working with disk images, I have problems with boot them.
Booting went fine until screen with boot choices, and with FreeBSD logo, after choicing any, finished with message:
Can't work out which disk we are booting from.
Guessed BIOS device 0xffffffff not found by probes, defaulting to disk0:

panic: free: guard1 fail @ 0x3f2880b8 from sys/boot/i386/loader/../../common/module.c:1004

If I trying to boot in VirtualBox, then all the same, except that there's no last message, about panic, VirtBox just hangs.

Fix: 

Use mbr probably? :)
How-To-Repeat: This is my way to make it:

touch $imagefile
truncate -s 4G $imagefile
mdconfig -af $imagefile -u $u
gpart create -s gpt /dev/md$u
gpart add -s 64k -t freebsd-boot -i 1 md$u
gpart add -t freebsd-ufs -s 2G -i 2 md$u
gpart add -t freebsd-swap -i 3 md$u
newfs -Uj /dev/md${u}p2
mount -o rw,noatime /dev/md${u}p2 $mountdir
.
make installworld DESTDIR=$mountdir
make distribution DESTDIR=$mountdir
make installkernel DESTDIR=$mountdir
gpart bootcode -b $mountdir/boot/pmbr md$u
gpart bootcode -p $mountdir/boot/gptboot -i 1 md$u


That's it, we created image;
Now any one to test:
1. VBoxManage convertfromraw $imagefile $imagevdi --format VDI -- and test in VirtualBox;
2. dd if=/$imagefile of=/dev/da* bs=1M  -- write to some USB disk, and boot from it.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2011-10-16 23:50:18 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-geom

over to maintainer
Comment 2 Andriy Gapon freebsd_committer freebsd_triage 2011-10-17 08:53:45 UTC
This looks like an issue with BIOS emulation in Virtualbox, actually.
I think I've already seen some commits that hack our boot code to play better
with Virtualbox.  Try to build the boot blocks that you use for those images
with -DVIRTUALBOX option.

-- 
Andriy Gapon
Comment 3 yerenkow 2011-10-17 08:59:58 UTC
2011/10/17 Andriy Gapon <avg@freebsd.org>

>
> This looks like an issue with BIOS emulation in Virtualbox, actually.
> I think I've already seen some commits that hack our boot code to play
> better
> with Virtualbox.  Try to build the boot blocks that you use for those
> images
> with -DVIRTUALBOX option.
>

Don't think so;
I got same error if I dd it to USB flash and try to boot on two different
laptops.
The only workaround I've found yet - is not use amd64 :)


>
> --
> Andriy Gapon
>



-- 
Regards,
Alexander Yerenkow
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:23 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped