Solved freebsd11 boot from zfs part

sulit

New Member


Messages: 9

I install FreeBSD 11 on my laptop. My laptop has two OS, one is Windows 10, another is Debian. My parted table type is msdos, partition(or slice) 1,2 is NTFS, partition(or slice) 5,6 is Linux data, partition(or slice) 4 is BSD. BSD slice has two partitions, one is freebsd-zfs (100G), two is freebsd-swap. bootloader tool is Grub2 (grub2.02-beta3) in the linux, 40_custom as follow:

Code:
menuentry "FreeBSD11" {
    insmod zfs
    search --set=root --label root --hint hd0,msdos4
    kfreebsd /@/boot/kernel/kernel
    kfreebsd_module_elf /@/boot/kernel/opensolaris.ko
    kfreebsd_module_elf /@/boot/kernel/zfs.ko
    kfreebsd_module /@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
    set kFreeBSD.vfs.root.mountfrom=zfs:root
    set kFreeBSD.hw.psm.synaptics_support=1
}

grub2 note the zpool.cache don't exist, I can be in FreeBSD, but I drop in mountroot. FreeBSD note me no root mounted.
How to resolve it by myself? Thanks.
 

ANOKNUSA

Aspiring Daemon

Reaction score: 373
Messages: 675

Debian kFreeBSD is not affiliated with the FreeBSD project. You need to ask on the Debian forums.

EDIT: Oops, I read that wrong. Alright, what is the output of zpool get bootfs? My guess is that was set wrong. Really, though, there could be several reasons.
 
A

ASX

Guest


For a start I would suggest a grub menu entry like this:

Code:
insmod zfs
menuentry "FreeBSD" {
set root='(hd0,msdos4a)'   # disk 0, slice 4, partition a
kfreebsd /boot/loader
}
(note how the slice/partition are specified)

Basically turn the job on the FreeBSD loader, that should be already properly configured.
 

DavidMarec

Member

Reaction score: 18
Messages: 74

set kFreeBSD.vfs.root.mountfrom=zfs:root

The mount point should be fully defined here:

Code:
set kFreeBSD.vfs.root.mountfrom=zfs:myPool/myzfs/set/root

To set automatically the root var from zfs, you may try:

Code:
search --no-floppy -s -l yourPool
kfreebsd /your/root/zfsSet/@/boot/kernel/kernel
etc.
 

free-and-bsd

Daemon

Reaction score: 164
Messages: 1,000

Sorry, had to edit my original post as the info was irrelevant. What interests me now is: how come you have "parted type msdos" and then you have partitions (slices) "5,6"?? The question is, how many PARTITIONS do you have? With msdos (MBR) you can have up to 4... Then, if you're serious about your FreeBSD being installed on a "slice" and not a "partition", then which one is that?

...Secondly, you can drop into grub shell and issue ls command:
Code:
grub>insmod <partition type module you need>
grub>ls
Check if it will show your FreeBSD root. In case of success you'll have to add a corresponding line "insmod *" to your grub.cfg in order for grub to be able to see the partition.

But I was supposed to start by saying that with such advanced setups one must be ready to set up booting manually. Including the bootcode installation and all that. Just out of curiosity: do you successfully boot your Windows with GRUB2?
 
OP
sulit

sulit

New Member


Messages: 9

I hava resolve it, I parted all slice4 for zfs, and remove slice4's swap part, only left the zfs part, thanks for everyone who help me.
 
OP
sulit

sulit

New Member


Messages: 9

Sorry, had to edit my original post as the info was irrelevant. What interests me now is: how come you have "parted type msdos" and then you have partitions (slices) "5,6"?? The question is, how many PARTITIONS do you have? With msdos (MBR) you can have up to 4... Then, if you're serious about your FreeBSD being installed on a "slice" and not a "partition", then which one is that?

...Secondly, you can drop into grub shell and issue ls command:
Code:
grub>insmod <partition type module you need>
grub>ls
Check if it will show your FreeBSD root. In case of success you'll have to add a corresponding line "insmod *" to your grub.cfg in order for grub to be able to see the partition.

But I was supposed to start by saying that with such advanced setups one must be ready to set up booting manually. Including the bootcode installation and all that. Just out of curiosity: do you successfully boot your Windows with GRUB2?


the attach file is my "gpart list" file, my problem have been resolved, I parted the all slice 4 for zfs, don't use swap, it's ok now, thanks.
 

Attachments

  • part.txt
    2.5 KB · Views: 323
OP
sulit

sulit

New Member


Messages: 9

For a start I would suggest a grub menu entry like this:

Code:
insmod zfs
menuentry "FreeBSD" {
set root='(hd0,msdos4a)'   # disk 0, slice 4, partition a
kfreebsd /boot/loader
}
(note how the slice/partition are specified)

Basically turn the job on the FreeBSD loader, that should be already properly configured.


I will try it, i think your idea is right, thanks
 
Top