From owner-freebsd-current@FreeBSD.ORG Wed Jun 20 10:27:34 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9506516A400 for ; Wed, 20 Jun 2007 10:27:34 +0000 (UTC) (envelope-from borjamar@sarenet.es) Received: from proxypop2.sarenet.es (proxypop2.sarenet.es [194.30.0.95]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0D513C43E for ; Wed, 20 Jun 2007 10:27:34 +0000 (UTC) (envelope-from borjamar@sarenet.es) Received: from [127.0.0.1] (matahari.sarenet.es [192.148.167.18]) by proxypop2.sarenet.es (Postfix) with ESMTP id D25DF73179 for ; Wed, 20 Jun 2007 11:57:08 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v752.2) Content-Transfer-Encoding: 7bit Message-Id: <4E1E93FB-31D2-4F38-9979-946935BE0729@sarenet.es> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: freebsd-current@freebsd.org From: Borja Marcos Date: Wed, 20 Jun 2007 11:57:07 +0200 X-Mailer: Apple Mail (2.752.2) Subject: Re: ZFS does not load and mount at boot time X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2007 10:27:34 -0000 > I have now moved zfs.cache to /etc/zfs and load the module via > rc.conf. I > have also included the saving of zfs.cache on /cfg in "zfs stop" > and set > KEYWORD: shutdown for zfs. However, I still get > > ZFS: WARNING: pool 'tank' could not be loaded as it was last > accessed by > another system (host: eclipse.aei.uni-hannover.de hostid: 0xf7ab4bd6). > See: http://www.sun.com/msg/ZFS-8000-EY > > when booting. Any further ideas? > Yes. I've run into the same problem when installing a new machine with the June FreeBSD 7 snapshot, cvsupping yesterday, and trying to set up /usr and /var in ZFS. It seems ZFS labels the pools it creates using the hostname and the hostid. The hostid is a unique number present in ROM/flash in Sun machines, and it turns out one of the IP addresses of the machine is used by FreeBSD as hostid. I had booted into multiuser, created a pool, and created three filesystems, say zfs/usr, zfs/var and zfs/home. After copying /var, /usr and /home to the new zfs filesystems, I rebooted in single user in order to edit /etc/fstab to remove the references to them and change the ZFS mountpoints to the proper places, and I've run across the same problem. The ZFS pool was labelled with the hostname (still not set) and the hostid (still not set, as the network interfaces are initialised *AFTER* the filesystems are mounted). I've solved the problem in a quick and dirty way forcing the system to import the ZFS pool despite the fact that it believes it's been used by another host. The ugly kludge is simply to edit /etc/rc.d/zfs and add "zfs pool import -f poolname" to the zfs_start_main() section right after "zfs volinit". zfs_start_main() { zfs volinit zpool import -f pruebazfs zfs mount -a zfs share -a if [ ! -r /etc/zfs/exports ]; then touch /etc/zfs/exports fi Ugly but it works. It seems it's necessary to either rethink that ZFS behavior (which is desirable), or set the hostname as soon as possible. Regarding the hostid, it's trickier than it seems. But anyway I don't think it's a good idea to use an IP address (which of them?) as a hostid. A simple IP address change could be quite confusing for an unaware administrator. Borja. ---------------- "The thing he realised about the windows was this: because they had been converted into openable windows after they had first been designed to be impregnable, they were, in fact, much less secure than if they had been designed as openable windows in the first place." Douglas Adams, "Mostly Harmless"