[zfs-discuss] HostID not being added to a pools data, have to force import everytime, what is happening??

mcaerwyn at pioneerpress.com mcaerwyn at pioneerpress.com
Mon Sep 30 14:22:58 EDT 2013

Good Afternoon,

  I have Fedora 19 using ZFSonLinux 0.61 compiled using DKMS, so the 
_KERNEL flag is set. I have a single pool mirrored across two drives. My 
root drive is on ZFS, and I have a grub that is patched -- gentoo patches 
-- to boot from ZFS. I have rebuilt my INITRD and it does have all the ZFS 
modules needed and is trying to import the pool correctly, but the pool 
always has to be forced.

  The error I get it from zpool is: "cannot import 'poolname': pool may be 
in use from other system." This is found in zpool_main.c at line 1857 and 
is the else clause from the hostid check.

  I figure this is happening because during shutdown the pool is never 
exported, and the pool has no HOSTID to check.

  My INITRD has a hostid file with the correct numbers. When I run zdb -CC 
-e poolname and get the MOS Configuration I see the host name but not the 
hostid. In the proc system the hostid -- /proc/sys/kernel/spl/hostid -- 
matches, but the /proc/sys/kernel/spl/hw_serial is set to <none>. When I 
set the hostid in /proc/sys/kernel/spl/hostid it does set the hw_serial, 
but that does not seem to have the hostid placed in the MOS Configuration 
when I tried to export and import the pool again. The hw_serial is cleared 
to <none> when the system moves from the INITRD to the main system.

  There is no cache file, and the code to set the hostid seems to be 
zone_get_hostid from spl-generic.c and seems to depend on hw_serial being 
set. The kernel notice during boot says that spl_hostid is being correctly 
set. My guess is that the hostid_read function succeeds so the hostid_exec 
function is never called and the hw_serial never gets set. I believe that I 
have no hostid because hw_serial is always <NONE> when I export/import a 
pool, which should write the hostid back to the disks so I can change it if 
I needed to. Somehow the hostid value is not being placed into the 

  I would like to not force my pool in everytime, yes I know there are 
various tickets and work is in progress, and I do not want to export my 
pool during shutdown.

  How can I see what is in the configuration tree to see if the hostid is 
even being placed in there or am I going to have to patch the code to give 
me more feed back?
  How can I force a hostid into my MOS configuration to see if that is my 
  Why is zone_get_hostid looking at the hw_serial value to set the hostid 
instead of the spl_hostid value which hostid_read works so hard to set?
  Any suggestions for my next steps?

  Thank you to everyone who helped create this great software for all their 
hard work, and to everyone who might have suggestions/answers.

  - Michael Caerwyn

To unsubscribe from this group and stop receiving emails from it, send an email to zfs-discuss+unsubscribe at zfsonlinux.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.zfsonlinux.org/pipermail/zfs-discuss/attachments/20130930/0b4d38d5/attachment.html>

More information about the zfs-discuss mailing list