27115
![]() |
|
|
|
|
|||||||
| Installing & Upgrading Installing and upgrading FreeBSD. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have a dual boot set up with Arch linux. My disk setup is MBR/BIOS with the following scheme:
/dev/sda1 >> /boot (ext2, Arch Linux) /dev/sda5 >> / (ext4, Arch Linux) /dev/sda6 >> SWAP (Arch Linux) /dev/sda2 >> extended partition (Arch Linux) Because I am using MBR/BIOS, I can only have 4 primary partitions. This is "important" because I am later going to triple-boot with Windows7 for gaming. Anyway, I want to get FreeBSD 9.0-STABLE amd64 installed, but I'm having some issues. When I install FreeBSD I create a new slice (something like ad0s3a for / and ad0s3b for swap). Once I reboot, I can see that the FreeBSD (BSD label) is seen by Arch as /dev/sda3 so I have edited my GRUB2 .cfg file as such: Code:
menuentry "FreeBSD 9.0-STABLE" {
set root=(hd0,3)
chainloader +1
}
Code:
can't load 'kernel' Type '?' for a list of commands, 'help' for more detailed help. Code:
OK lsdev
cd devices:
disk devices:
disk0: BIOS drive C:
disk0s1: ext2fs
disk0s3a: FFS
disk0s3b: swap
disk0s5: ext2fs
disk0s7: Linux swap
pxe devices:
Code:
OK ls open '/' failed: input/output error Last edited by DutchDaemon; February 16th, 2012 at 11:27. |
|
#2
|
|||
|
|||
|
--EDIT--
I have checked out some other threads regards this issue. This one suggests changing the BIOS option from RAID to ATA. My BIOS is set to use AHCI, though it has both options for RAID and IDE. I could try out IDE, but I would really like to keep AHCI for performance reasons (and I only have 1 drive so RAID seems silly). Another post describes something about changing /boot/loader.conf settings after a freebsd-update that breaks booting. My system is a clean installation from 9.0-STABLE memstick so I don't think this is the issue. Besides that, I wouldn't know how to modify that configuration file because it doesn't seem to exist if I exit to shell right after installation. Last edited by DutchDaemon; February 16th, 2012 at 18:28. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816 |
|
#3
|
||||
|
||||
|
Why not install FreeBSD in a VirtualBox instead of having to reboot to a different OS?
|
|
#4
|
|||
|
|||
|
Quote:
Even though I am using GRUB2, it is chainloading to the BTX bootloader, correct? Does BTX have some limitation to how far into a disk the partition it wants to boot is? FreeBSD 9.0 begins at around ~1.5TB into my HDD. Perhaps this is why it cannot find the kernel? |
|
#5
|
|||
|
|||
|
You could try a direct kernel boot, instead of chainloading. But first check if you have set root properly. Drop into GRUB's
command line and call ls. Before making the entry permanent, you can edit the GRUB menu during boot and test it. |
|
#6
|
|||
|
|||
|
I think you have error in mounting FreeBSD partitions, best suggestion I can tell is to chose Single mode user (fourth choice from the FreeBSD boot menu), then type:
Code:
ls /dev Code:
mount /dev/ad0s1 /mnt ls /mnt/etc/fstab ls: /mnt/etc/fstab: No such file or directory umount /mnt mount /dev/ad0s2 /mnt ls /mnt/etc/fstab /mnt/etc/fstab cat /mnt/etc/fstab Code:
/dev/ad0p2 /etc ufs rw 2 2 Last edited by DutchDaemon; February 19th, 2012 at 03:25. |
|
#7
|
|||
|
|||
|
Try to use the msdos qualifier in the partition:
Code:
menuentry 'freebsd 9.0' {
set root=(hd0,msdos3)
chainloader +1
}
Last edited by DutchDaemon; March 3rd, 2012 at 22:17. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816 |
|
#8
|
|||
|
|||
|
Sorry to leave you all hanging
I had a problem with my motherboard and got a shiny new one from the RMA!Anyway, I'm thinking about trying the direct OS boot since FreeBSD is supported by GRUB2 Quote:
With my new setup things are largely the same. The output of ls is (from GRUB2) Code:
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) I'm trying to use the configuration that T-Daemon's link to the Ubuntu help pages provided Code:
menuentry "FreeBSD 8.0 direct" {
insmod ufs2
set root='(hd0,gpt3)'
search --no-floppy --fs-uuid --set 4c0029f407b3cd1d
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:ada0p3
}
I should note that I am now using an EFI/GPT scheme with the new motherboard. GRUB2 is installed to the EFI System Partition. I'm aware that FreeBSD bootloader does not fully support EFI booting yet, but that's why I'm trying to use GRUB2! The partitioning scheme is still largely the same. Also of note is that FreeBSD detects devices /dev/ada0 and /dev/ad4p3. These are the same partitions, but I believe the ada0 device is the AHCI driver, which I intend to use as stated before. Ok, so maybe folks can help me tweak the direct bootloader menu entry. I figure this is a starting point. If there is any more information about my partition scheme or devices that people want I can post it. Last edited by DutchDaemon; March 6th, 2012 at 00:28. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816 / [file], not [color] |
|
#9
|
|||
|
|||
|
I found that I need to include a new option to boot
Code:
menuentry "FreeBSD" {
insmod ufs2
set root='(hd0,gpt3)'
search --no-floppy --fs-uuid --set=root 4c0029f407b3cd1d
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:ada0p3
}
Last edited by DutchDaemon; March 6th, 2012 at 01:15. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816 / use [file], not [color] |
|
#10
|
|||
|
|||
|
You said you were using MBR BIOS, but it seems that your hard disk has GTP partitions. Very confusing because you already had /, swap and /boot and the extended partition. How did you add a FreeBSD slice? You already had 4 primary partitions.
Last edited by DutchDaemon; March 7th, 2012 at 00:11. |
|
#11
|
|||
|
|||
|
Quote:
The new partition scheme is basically /dev/sda1 --> fat32, EFI System Partition (this is where GRUB2 resides) /dev/sda2 --> btrfs, Arch linux / /dev/sda2 --> UFS2, FreeBSD 9.0 (FreeBSD sees this as /dev/ada0p3 with AHCI or /dev/ad4p3) Last edited by DutchDaemon; March 7th, 2012 at 00:12. |
|
#12
|
|||
|
|||
|
If I remember correctly, Grub2 settings and installations method are different for UEFI/GPT and MBR/DOS systems, and it seems that you try MBR/DOS method on EFI/GTP system?
|
|
#13
|
|||
|
|||
|
Quote:
Code:
# efibootmgr BootCurrent BootCurrent: 0003 Timeout: 1 seconds BootOrder: 0003,0004,0000,0001 Boot0000* SATA1:SAMSUNG HD204UI Boot0001* IBA GE Slot 0200 v1321 Boot0003* GRUB2 Boot0004* Built-in EFI Shell This is my current 40_custom file: Code:
menuentry "FreeBSD boot" {
insmod ufs2
set root='(hd0,gpt3)'
kfreebsd /boot/loader
}
menuentry "FreeBSD root" {
insmod ufs2
set root='(hd0,gpt4)'
search --no-floppy --fs-uuid --set=root 4f55953a783b1ac8
kfreebsd /boot/loader
}
menuentry "FreeBSD direct root" {
insmod ufs2
set root='(hd0,gpt4)'
search --no-floppy --fs-uuid --set=root 4f55953a783b1ac8
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:ad0p4
set KFreeBSD.vfs.root.mountfrom.options=rw
}
menuentry "FreeBSD direct boot" {
insmod ufs2
set root='(hd0,gpt3)'
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:ad0p3
set KFreeBSD.vfs.root.mountfrom.options=rw
}
menuentry "FreeBSD, way of shotgun boot" {
set root=(hd0,gpt3)
chainloader +1
}
menuentry "FreeBSD, way of shotgun root" {
set root=(hd0,gpt4)
chainloader +1
}
If I try booting from the next 3 GRUB goes directly to a black screen. If I try booting the last 2 (chainloader's) I get an error that says invalid EFI file path Last edited by DutchDaemon; March 7th, 2012 at 00:12. Reason: Added grub config, changed formatting |
|
#14
|
||||
|
||||
|
1. Separate issue but valid: Why do you have two different swaps? FreeBSD can use the linux-swap!
2. If you get to the BTX loader, Grub has done it's job basically (with some exceptions). You need to explore the BTX command prompt a little. "?" will give you list of commands. ls will list folders, etc. Read loader(8) Is your vfs.root.mountfrom setting in /boot/loader.conf correct? Find the correct path to the /boot/kernel/ with ls and at btx prompt and tell btx to boot: > boot /boot/kernelI can't be more help because I need more specifics of your problem from btx output.
__________________
branch:head - root on zfs - amd64 BLUES, ELWOOD ILLINOIS LICENSE : B263-1655-2187 CURRENTLY UNDER SUSPENSION WARRANTS OUTSTANDING : PARKG. 116 MOVING VIOLATIONS : 56 ARREST DRIVER ... IMPOUND VEHICLE Last edited by Beeblebrox; March 6th, 2012 at 17:10. |
|
#15
|
|||
|
|||
|
Quote:
I'd really like to try out directly booting the kernel from GRUB if possible as this method seems to bypass the FreeBSD bootloader with EFI issue. However, the only thing that I'm really adamant about is that I want to use GRUB2 (instead of some combination of rEFIt, eLILO, and whatever else) because it is what I am familiar with and the most flexible for me. I don't mind destroying and recreating partitions though... but I'd like to keep the linux ones as that is where I have moved my data during this process. Again, this should be all the relevant information (placing it here so people that are just coming in can more easily find the details): ************************************************** ************************************************** ************************************ Partition Scheme Code:
# gdisk -l /dev/sda GPT fdisk (gdisk) version 0.8.2 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Disk /dev/sda: 3907029168 sectors, 1.8 TiB Logical sector size: 512 bytes Disk identifier (GUID): 1188BEF2-7D18-467B-A5ED-0E7A37229F9E Partition table holds up to 128 entries First usable sector is 34, last usable sector is 3907029134 Partitions will be aligned on 128-sector boundaries Total free space is 341051509 sectors (162.6 GiB) Number Start (sector) End (sector) Size Code Name 1 4096 823295 400.0 MiB EF00 EFI System 2 823296 3146551295 1.5 TiB 8300 Linux filesystem 3 3146551296 3146551423 64.0 KiB A501 4 3146551424 3565981687 200.0 GiB A503 DAEMON Also note that GRUB can see /boot/loader and [file]/boot/kernel/kernel[file] on (hd0,gpt4). Code:
grub> ls (hd0) (hd0,gpt1) (hd0,gpt2) (hd0,gpt3) (hd0,gpt4) Code:
# efibootmgr BOOT BootCurrent: 0003 Timeout: 1 seconds BootOrder: 0003,0004,0000,0001 Boot0000* SATA1:SAMSUNG HD204UI Boot0001* IBA GE Slot 0200 v1321 Boot0003* GRUB2 Boot0004* Built-in EFI Shell Also note that it seems that the second menuentry is the only one that gets me to the BTX loader. The chainloader methods produce Invalid EFI file path and the direct kernel boot methods go directly to a blank screen that halts indefinitelyCode:
menuentry "FreeBSD boot" {
insmod ufs2
set root='(hd0,gpt3)'
kfreebsd /boot/loader
}
menuentry "FreeBSD root" {
insmod ufs2
set root='(hd0,gpt4)'
search --no-floppy --fs-uuid --set=root 4f55953a783b1ac8
kfreebsd /boot/loader
}
menuentry "FreeBSD direct root" {
insmod ufs2
set root='(hd0,gpt4)'
search --no-floppy --fs-uuid --set=root 4f55953a783b1ac8
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:ad0p4
set KFreeBSD.vfs.root.mountfrom.options=rw
}
menuentry "FreeBSD direct boot" {
insmod ufs2
set root='(hd0,gpt3)'
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:ad0p3
set KFreeBSD.vfs.root.mountfrom.options=rw
}
menuentry "FreeBSD, way of shotgun boot" {
set root=(hd0,gpt3)
chainloader +1
}
menuentry "FreeBSD, way of shotgun root" {
set root=(hd0,gpt4)
chainloader +1
}
I really want to use EFI/GPT on my new motherboard. I need to use GPT in order to deal with >4 Primary Partitions for my multiboot environment and I need to use EFI in order to be able to boot Windows 7 x86_64 from a GPT drive. I prefer to use GRUB as my bootloader and, if possible, I want to boot the FreeBSD kernel directly with GRUB instead of chainloading. Apparently, GRUB2 supports FreeBSD for this method. I have considered using a virtual machine for FreeBSD, but that is not what I want to do. Besides, I'm very curious why this is not working at this point! If anything, I need to have an answer for academic purposes! Last edited by badhat101; March 7th, 2012 at 01:28. Reason: adding code |
|
#16
|
|||
|
|||
|
If you use UEFI/GPT, you have to make seperate GPT partitions for FreeBSD boot, /, swap, /usr, etc.
However, you said that you made a slice. I have no idea how you did that. A slice (e.g. ad0s3a) is for MBR/DOS partition scheme as far as I know. So where is your FreeBSD boot partition that UEFI can recognize? Last edited by DutchDaemon; March 7th, 2012 at 02:12. |
|
#17
|
|||
|
|||
|
Quote:
Now, the installed made /dev/ada0p3 the "freebsd-boot" partition and /dev/ada0p4 is "freebsd-ufs" mounted on "/" I'm am not aware of any documentation that states that separate partitions are needed for /usr, /var, or any other directories. |
|
#18
|
|||
|
|||
|
I don't know if this works and it's ugly,
1. On your FreeBSD, run # gpart bootcode -b /boot/pmbr -g /boot/gptboot /dev/ada0this makes only FreeBSD bootable, right? 2. On your Linux (rescue CD if already installed), copy mbr to /ada0.mbr # dd if=/dev/ada0 of=/ada0.mbr bs=512 count=13. Install Grub2 on your Linux with Quote:
|
|
#19
|
|||
|
|||
|
I'm not sure what those commands are meant to accomplish. Clearly, GRUB2 can already see the FreeBSD partitions and I am not using MBR. I do not wish to destroy my partition table so why would I try those commands?
|
|
#20
|
|||
|
|||
|
It does not destroy your GPT partition table. It just writes in the protective mbr and the freebsd-boot partition. As far as I know, Grub2 for FreeBSD GPT system disk has no clean solution yet. If you come up with a better solution, let me know. Good luck!
|
|
#21
|
|||
|
|||
|
I think I found similar information in here (FreeBSD GPT howto).
And from here (rodbooks) The FreeBSD installer did not seem to have any issues recognizing the GPT table that was already in place. However, I did find it strange that it created a separate partition for the gptboot as both guides made it seem that the GPT /boot was not an actual partition and it really just resides in root. However, the Handbook (see section on Standard FreeBSD GPT Partitions) indicates that the "freebsd-boot" partition is a real partition for GPT that holds the bootcode (this would be the gptboot?), except that it does not seem to have a mountpoint according to the Handbook. Anyway, the installer did create this 64kB "freebsd-boot" partition, but exists after the linux partitions (which is 1.5TB into the drive). If I created a new partition scheme that was: Device----------------Mount Point-----------Name /dev/ad0p1---- /boot/efi--------- (EFI System Partition of 400MB) /dev/ad0p2------------------------- (FreeBSD "freebsd-boot" of 64kB) /dev/ad0p3---- /--------------------- (FreeBSD root of 200GB) /dev/ad0p4---- /--------------------- (Linux root of 1.5TB) Do you think that this would function? The only difference from my current scheme would be that the "freebsd-boot" partition would come immediately after the ESP. I am also curious if I could just tell EFI where to find a FreeBSD boot.efi, if any such such exists for FreeBSD. That way, I could avoid using GRUB altogether. Though, to be honest, I do enjoy using GRUB for its flexibility. |
|
#22
|
|||
|
|||
|
The problem of the current state of FreeBSD and Grub2 is, to my understanding, that there is no boot manager that can reside in the EFI System Partition. What this means is that if you need to boot only FreeBSD GPT disk, that's fine. You can even use Grub2 as you wish.
But if you want a multi-boot Grub2 setting, there is no easy and clean method for GPT system disk. Windows 7 and Linux have boot managers that reside in the EFI System Partition so you can multi-boot Windows and Linux GPT system disk easily with Grub2. That's my understanding and that's the reason to use kludge for multi-booting FreeBSD GPT disk with Grub2. |
|
#23
|
|||
|
|||
|
That's not the greatest news. I'll try the workaround you've suggested about messing with the pmbr and gptboot files.
As a side note, I almost thought for second that "kludge" might be the name of some crazy bootloader. Hah. My only remaining question is whether there is any ongoing effort to port the ia64 efi bootloader to the i386/amd64 platforms? I checked out Revision 206376 so I know there's some interest in this, but not anything for amd64 yet. This thread also seems to indicate interest. |
![]() |
| Tags |
| arch linux, bootloader, dual boot, grub2, kernel |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Solved] FreeBSD does not start on a triple boot with Grub2 | Halberdier | Installing & Upgrading | 7 | May 30th, 2012 23:06 |
| How to boot FreeBSD 9 installed in dedicated disk using Grub2. | Michael | Installing & Upgrading | 4 | February 4th, 2012 09:32 |
| Dual-boot issues (grub2, Linux) | dbbolton | Installing & Upgrading | 3 | March 20th, 2010 06:51 |
| [Solved] dual boot FreeBSD with linux using grub2 | favor | Installing & Upgrading | 22 | January 20th, 2010 14:26 |
| Error when start boot (cannot load kernel) | oil_bench | Installing & Upgrading | 0 | January 7th, 2010 00:39 |