4

There is a box with one MBR-partitioned disk.

It has four primary partitions. On those are:

  • Windows
  • DragonFly BSD (using UFS2)
  • Linux
  • DragonFly BSD (using HAMMER)

Chainloading the DragonFly which uses UFS2 is possible.

GRUB 2 is the bootloader.

I haven't managed yet to get GRUB into loading the DragonFly which uses HAMMER.

What needs to be in the /etc/grub.d/40_custom?

2

DragonflyBSD by-defaults uses disklabel64, instead of disklabel32, during partitioning the slice (in BSD terminology, or sub-partitioning the partition, in Linux terminology). Unfortunately, disklabel64 is invisible for GRUB & GRUB2. I’ve seen some discussion and some attempts to make it visible for GRUB, but I’m not sure, if they really work. Also, HAMMER-fs is invisible for GRUB. (But the /boot in DFlyBSD is UFS, so it’s visible). I’ve seen a read-only FUSE realization of HAMMER-fs for GNU/Linux (Google: "Hammerfs for Linux"), but I haven’t tried it, because the Linux kernel should see disklabel64-ed slice, first, to see a HAMMER partition on it. So, to try HAMMER-FUSE I need to move all DragonflyBSD partitions from dl64-slice to either dl32-slice or separate not bsd-labeled MBR-partitions/EBR-ones...

So the simplest way is chain-loading:

menuentry "Dragonfly BSD x64 @ (hdX,Y)" {
   set root=(hdX,msdosY)
   chainloader +1
}
1

Just now, I have found that Grub2-module "part_dfly" can be found at [your_boot_partition]/boot/grub/i386-pc. List of the kernel modules, you are using at your PC, can be found at [your_dragonfly_partition]/boot/loader.conf. Just change my "kfreebsd_module_elf /kernel/.ko" to your`s from loader.conf.

Grub2 will load dfly-partition-sheme, than kernel and RAM-disk-image from UFS2 (/boot) partition, and than DF-BSD will load Hammer-FS (root). So, "/boot"-partition must be read/write-able both for Grub2 and DF-BSD; the only candidats for this role are UFS and UFS2.

Note, that Grub2 is case-sensetive, so you must write "kfreebsd_module " using "small" letters, but "set kFreeBSD ", must be writen using both capital and "small" letters. So you can try something like that:

menuentry "Dragonfly BSD x64 @ (hdX,Y)" {
   insmod part_msdos
   insmod part_dfly
   insmod ufs2
   set root=(hdX,msdosY)
   kfreebsd /kernel/kernel
   kfreebsd_loadenv /boot/device.hints
   kfreebsd_module /kernel/initrd.img type=md_image
   kfreebsd_module_elf /kernel/acpi.ko
   kfreebsd_module_elf /kernel/ahci.ko
   kfreebsd_module_elf /kernel/ehci.ko
   kfreebsd_module_elf /kernel/dm.ko
   kfreebsd_module_elf /kernel/md.ko
   kfreebsd_module_elf /kernel/dm_target_crypt.ko
   kfreebsd_module_elf /kernel/wlan.ko
   kfreebsd_module_elf /kernel/wlan_ccmp.ko
   kfreebsd_module_elf /kernel/wlan_tkip.ko
   kfreebsd_module_elf /kernel/ath_hal.ko
   kfreebsd_module_elf /kernel/ath_rote.ko
   kfreebsd_module_elf /kernel/if_ath.ko
   kfreebsd_module_elf /kernel/sound.ko
   kfreebsd_module_elf /kernel/snd_hda.ko
   set kFreeBSD.vfs.root.mountfrom=ufs:md0s0
   set kFreeBSD.vfs.root.realroot=crypt:hammer:\
   /dev/serno/<your_partition_serno>:dragon

}

If you are using non-encrypted hammer-partition instead of:

   set kFreeBSD.vfs.root.mountfrom=ufs:md0s0
   set kFreeBSD.vfs.root.realroot=crypt:hammer:\
   /dev/serno/<your_partiton_serno>:dragon

just use:

   set kFreeBSD.vfs.root.mountfrom=\
   hammer:/dev/serno/<your_partition_serno>:dragon

Good luck!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.