Care to be more specific? What exactly is the part that's not working? Post #16 solves the issue by adding:Bump. Any ideas on this issue?
kfreebsd_module (loop)/boot/mfsroot.gz type=mfs_root
title FreeBSD 8.3 64-bit
find --set-root /FreeBSD-8.3-RELEASE-amd64-bootonly.iso
map /FreeBSD-8.3-RELEASE-amd64-bootonly.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)
HiBeeblebrox said:Care to be more specific? What exactly is the part that's not working? Post #16 solves the issue by adding:
Use an ISO version that has mfsroot.gz included. You are not limited to the bootonly.iso.Code:kfreebsd_module (loop)/boot/mfsroot.gz type=mfs_root
kfreebsd (loop)/boot/kernel/kernel -v
kfreebsd_loadenv (loop)/boot/device.hints
kfreebsd_module (loop)/data/base.ufs.uzip type=mfs_root
set kFreeBSD.vfs.root.mountfrom="ufs:/dev/md0"
set kFreeBSD.xconsole=YES
Yes you can boot that or any other FreeBSD ISO from a Grub2 USB stick. The way I do it is have 2 partitions of the USB stick. The first one is ~1G large (for the ISO) and the second is for Grub2 boot/grub dir and ISO images that ARE bootable with Grub2 via loopback feature.How to boot FreeBSD 10.1 ISO from Grub2 USB stick? Anyone help?
menuentry "FreeBSD *RELEASE" {
set root=(hd0,msods1)
kfreebsd /boot/loader
}
#grub-install --boot-directory=$mountpoint_of_your_2nd_usb-partition/boot /dev/daN
# set iso= ...
loopback loop=${iso}
kfreebsd (loop)/boot/kernel/kernel -v
kfreebsd_module ${iso} type=mfs_root
set kFreeBSD.vfs.root.mountfrom="cd9660:/dev/md0"
Just got this working in qemu with the following code:
Code:# set iso= ... loopback loop=${iso} kfreebsd (loop)/boot/kernel/kernel -v kfreebsd_module ${iso} type=mfs_root set kFreeBSD.vfs.root.mountfrom="cd9660:/dev/md0"
Yes you can boot that or any other FreeBSD ISO from a Grub2 USB stick. The way I do it is have 2 partitions of the USB stick. The first one is ~1G large (for the ISO) and the second is for Grub2 boot/grub dir and ISO images that ARE bootable with Grub2 via loopback feature.
Now the 1st partition is used to write a FreeBSD*disc1.iso to it using the dd method. Whenever you need a new ISO you just remove/recreate the partition using gpart commands, then write the needed ISO to it. Yea, because I'm not sure writing with dd over the old one created the same way will work... AFAIK writing image over partition with dd makes the rest of the partition unusable.
Only DON'T try to use any *memstick.img for that, it's completely useless! Use normal CD iso.
Then you boot it from Grub2 menu like this (don't need to change that for each new ISO):
Code:menuentry "FreeBSD *RELEASE" { set root=(hd0,msods1) kfreebsd /boot/loader }
gpart add -s 1G da0
I need to add a partition type. What should that be? freebsd?That's not always true: MS Windows recognizes only the 1st partition of a USB flash drive.This solution is still better than writing a *memstick.img to a whole USB drive, thus leaving the drive unusable for other goals. The 2-partitioned setup allows to always use the 2nd partition for whatever you want.
First of all, unless I'm mistaken the partition table on my USB is not GPT but MBR type. Though I dont' remember now.I'm trying to create a USB stick capable of booting a FreeBSD ISO and thought I'd try following the instructions here but am getting lost...
Assuming I have 16GB USB stick, I need to reserve a 1GB partition for a FreeBSD*disc1.iso. Usinggpart add -s 1G da0
I need to add a partition type. What should that be? freebsd?
Then I need to dd https://download.freebsd.org/ftp/re...AGES/11.0/FreeBSD-11.0-RELEASE-i386-disc1.iso
to /dev/da0s1
How to create the second partition and install Grub2 on it?
First of all, I think I did it under Linux (sorry for the disappointment!) Sysresccd using gparted. Create MBR, create vfat partition on your drive. Leave ~1Gb space BEFORE the partition you're creating. Format this one to vfat (in FreeBSD it will be msdosfs). Google for FreeBSD instructions to the same effect...Do you set up the USB drive completely using FreeBSD? How do you install and configure Grub2 on the second partition?
#grub-install --boot-directory=/$mountpoint/boot /dev/sda (or whatever your device is called)
gpart destroy -F da0
gpart create -s mbr da0
gpart add -t freebsd -s 1g da0
gpart add -t fat32 -s 1g da0
newfs_msdos -F32 /dev/da0s2
newfs_msdos: trim 8 sectors to adjust to a multiple of 63
newfs_msdos: 65502 clusters too few clusters for FAT32, need 65525
Well definitely you WON'T be able to install grub from that. Still, I'm not sure which version of GRUB that pkg supplies... I'm using the latest GIT version for my needs.After some experimenting, I created a 1GB FAT16 partition, followed by a 1GB FAT32 partition, and that one formatted without the previous error, so I guess I can try installing GRUB on the third partition. Should I install the FreeBSD grub2 pkg?
Well definitely you WON'T be able to install grub from that. Still, I'm not sure which version of GRUB that pkg supplies... I'm using the latest GIT version for my needs.
gpart destroy -F da0
gpart create -s mbr da0
gpart add -t fat32 -b 7g da0
newfs_msdos -F 32 -c 4 /dev/da0s1
gpart add -t freebsd -s 1g da0
gpart add -t freebsd -s 1g da0
gpart add -t freebsd -s 1g da0
fetch https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/11.0/FreeBSD-11.0-RELEASE-amd64-disc1.iso
fetch http://mfsbsd.vx.sk/files/iso/11/amd64/mfsbsd-mini-11.0-RELEASE-amd64.iso
fetch https://nyifiles.pfsense.org/mirror/downloads/pfSense-CE-2.3.3-RELEASE-amd64.iso.gz
dd if=FreeBSD-11.0-RELEASE-amd64-disc1.iso of=/dev/da0s2 bs=64k
dd if=mfsbsd-mini-11.0-RELEASE-amd64.iso of=/dev/da0s3 bs=64k
gunzip pfSense-CE-2.3.3-RELEASE-amd64.iso.gz
dd if=pfSense-CE-2.3.3-RELEASE-amd64.iso of=/dev/da0s4 bs=64k
pkg install grub2
mkdir /mnt/usb
mount -t msdosfs /dev/da0s1 /mnt/usb
grub-install --boot-directory=/mnt/usb/boot /dev/da0
cat << 'EOF' >> /mnt/usb/boot/grub/grub.cfg
menuentry "FreeBSD 11.0-RELEASE" {
set root=(hd0,msdos2)
kfreebsd /boot/loader
}
menuentry "mfsBSD" {
set root=(hd0,msdos3)
kfreebsd /boot/loader
}
menuentry "pfSense" {
set root=(hd0,msdos4)
kfreebsd /boot/loader
}
EOF
umount /mnt/usb
dd
an ISO to a gpt partition.I did enter a few grub commands and managed to get the ISO image to boot
No, you didn't "get an ISO image to boot" -- you did boot from a partition on your USB stick where you'd written an ISO image using dd. It wasn't an "image" any more, but a partition, and one would expect a partition to boot, you know.Yes, I said so above