[DragonFlyBSD - Bug #3202] (New) Cannot boot from HAMMER2

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Fri Aug 30 04:46:55 PDT 2019

Issue #3202 has been reported by mneumann.

Bug #3202: Cannot boot from HAMMER2

* Author: mneumann
* Status: New
* Priority: Normal
* Assignee: 
* Category: Kernel
* Target version: master
Booting from HAMMER2 "BOOT" PFS works when created via "newfs_hammer2 -L BOOT".

But when I use "hammer2 pfs-create BOOT", I got the message "hammer2: 'BOOT' PFS not found".
I might have created and deleted the "BOOT" PFS multiple times on that file system.

My BOOT PFS inode number is "0xd9b36ce135528001", but HAMMER2_BOOT_KEY is defined as "0xd9b36ce135528000".
With the following patch I can successfully boot from HAMMER2:

--- a/lib/libstand/hammer2.c
+++ b/lib/libstand/hammer2.c
@@ -692,7 +692,7 @@ h2init(struct hammer2_fs *hfs)
        h2lookup(hfs, NULL, 0, 0, NULL, NULL);
        r = h2lookup(hfs, &hfs->sroot,
-                    HAMMER2_BOOT_KEY, HAMMER2_BOOT_KEY,
+                    HAMMER2_BOOT_KEY, HAMMER2_BOOT_KEY | 0xFFFFU,
                     &hfs->sroot, &data);
        if (r <= 0) {
                printf("hammer2: 'BOOT' PFS not found\n");

I am not sure if this is 100% the right approach.
I would rather like to check for the name explicitly as there can be hash collisions.

To successfully boot from HAMMER2, I have to "set currdev="disk0s1d" and then 
"cd /kernel" and then follow normal boot procedure (loadall, boot).

To really be useful, one would have to allow other PFSes than "BOOT" to be booted from,
so that you can boot from a snapshot for instance.

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

More information about the Bugs mailing list