Bug #3202
closedCannot boot from HAMMER2
100%
Description
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)
return(1);>sroot,
h2lookup(hfs, NULL, 0, 0, NULL, NULL);
r = h2lookup(hfs, &hfs
- 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.