From owner-freebsd-fs@FreeBSD.ORG Fri Sep 2 13:48:33 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBAB1106566C for ; Fri, 2 Sep 2011 13:48:32 +0000 (UTC) (envelope-from joh.hendriks@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 819A38FC13 for ; Fri, 2 Sep 2011 13:48:32 +0000 (UTC) Received: by ewy1 with SMTP id 1so1841882ewy.13 for ; Fri, 02 Sep 2011 06:48:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=W/81gqZWQREkbFXIodYcCf1CCe2v3ifpq6HPYclGRB8=; b=UMVphNl3ZB850m03NDAF/dEau034mu4PW5LW4JMurbSZSi2SAmKLJTP6vcqSM8dCET XxUzYkCYceXAYWEh4orEc07tf3MNMpBg2WK5QFneorYnKxV/FNKdwskIE3vY2//p1iqQ qCDnt7dgARVSS3Xv9tpxX7P4jqgjwX8cwYIc4= Received: by 10.213.31.75 with SMTP id x11mr170922ebc.6.1314970004457; Fri, 02 Sep 2011 06:26:44 -0700 (PDT) Received: from [192.168.50.106] (double-l.xs4all.nl [80.126.205.144]) by mx.google.com with ESMTPS id i6sm2111025eeb.11.2011.09.02.06.26.43 (version=SSLv3 cipher=OTHER); Fri, 02 Sep 2011 06:26:43 -0700 (PDT) Message-ID: <4E60D992.3030802@gmail.com> Date: Fri, 02 Sep 2011 15:26:42 +0200 From: Johan Hendriks User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1 MIME-Version: 1.0 To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: ZFS on HAST and reboot. X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 13:48:33 -0000 Hello all. I just started using ZFS on top of HAST. What i did was first glabel my disks like disk1 to disk3 Then I created my hast devices in /etc/hast.conf /etc/hast.conf looks like this. i resource disk1 { on srv1 { local /dev/label/disk1 remote 192.168.5.41 } on srv2 { local /dev/label/disk1 remote 192.168.5.40 } } resource disk2 { on srv1 { local /dev/label/disk2 remote 192.168.5.41 } on srv2 { local /dev/label/disk2 remote 192.168.5.40 } } resource disk3 { on srv1 { local /dev/label/disk3 remote 192.168.5.41 } on srv2 { local /dev/label/disk3 remote 192.168.5.40 } } This works. I can set srv 1 to primary and srv 2 to secondary and visa versa. hastctl role primary all and hastctl role secondary all. Then i created the raidz on the master srv1 zpool create storage raidz1 hast/disk1 hast/disk2 hast/disk3 all looks good. zpool status pool: storage state: ONLINE scan: scrub repaired 0 in 0h0m with 0 errors on Wed Aug 31 20:49:19 2011 config: NAME STATE READ WRITE CKSUM storage ONLINE 0 0 0 raidz1-0 ONLINE 0 0 0 hast/disk1 ONLINE 0 0 0 hast/disk2 ONLINE 0 0 0 hast/disk3 ONLINE 0 0 0 errors: No known data errors then i created the mountpoint and created zfs on it # mkdir /usr/local/virtual # zfs create storage/virtual # zfs list # zfs set mountpoint=/usr/local/virtual storage/virtual # /etc/rc.d/zfs start and whooop there is my /usr/local/virtual zfs filesystem. # mount /dev/ada0p2 on / (ufs, local, journaled soft-updates) devfs on /dev (devfs, local, multilabel) storage on /storage (zfs, local, nfsv4acls) storage/virtual on /usr/local/virtual (zfs, local, nfsv4acls) if i do a zfs export -f storage on srv1 change the hast role to secondary and then set the hast role on srv2 to primary and do zfs import -f storage, i can see the files on srv2. I am a happy camper :D So it works like advertised. Now i rebooted both machines. all is working fine. But if i reboot the server srv1 again, i can not import the pool anymore, it tells me the pool is already imported. I do load the carp-hast-switch master file with ifstated. This does set the hast role to primary. But can not import the pool. Now this can be true because i did not export it. if i do a /etc/rc.d/zfs start, than it gets mounted and the pool is again available. Is there a way i can do this automaticly. In my understanding after a reboot zfs try's to start, but fails because my hast providers are not yet ready. Or am i doing something wrong and should i not do it this way. Can i tell zfs to start after the hast providers are primary at reboot. I hope i explained it correctly. Thanks for your time. regards Johan Hendriks