From owner-freebsd-fs@freebsd.org Sun Sep 6 14:36:20 2015 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92BF99C5C8B for ; Sun, 6 Sep 2015 14:36:20 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from smtp.digiware.nl (unknown [IPv6:2001:4cb8:90:ffff::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2965B174 for ; Sun, 6 Sep 2015 14:36:19 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from rack1.digiware.nl (unknown [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id E65B615340A; Sun, 6 Sep 2015 16:36:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at digiware.nl Received: from smtp.digiware.nl ([127.0.0.1]) by rack1.digiware.nl (rack1.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s8yoypDs8uZy; Sun, 6 Sep 2015 16:35:39 +0200 (CEST) Received: from [192.168.10.10] (asus [192.168.10.10]) by smtp.digiware.nl (Postfix) with ESMTPA id BC8A3153408; Sun, 6 Sep 2015 16:35:39 +0200 (CEST) Subject: Re: can zfs snapshot be used to back LUN in ctl.conf ? To: Zeus Panchenko , freebsd-fs@freebsd.org References: <20150827150027.10825@smtp.new-ukraine.org> From: Willem Jan Withagen Message-ID: <55EC4F3B.7090804@digiware.nl> Date: Sun, 6 Sep 2015 16:35:39 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150827150027.10825@smtp.new-ukraine.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2015 14:36:20 -0000 On 27-8-2015 14:00, Zeus Panchenko wrote: > greetings, > > please help me to understand where to look at ... > > recently I switched from istgt to ctld and now wonder, whether can zfs > snapshot be used to back the LUN for ctld? > > istgt do allows that, while ctld fails to start and complains > > but if I copy the file from zfs snapshot to some place, then ctld starts > as expected ... As far as I know those snapshots are read-only. So other that mount and use for reading backup stuff it does not really serve a purpose? And than still you'd next a "consistent" fs on the volume to do any useful work. So that would only work for filesystems that need a recover that does not involve writing to the volume. Otherwise if you force mount something like UFS, you run the risk of crashes? So unless you promote a the volume to writable things will not work. For files as backing volume that happens if you copy it to a writeable location, or clone the volume the file is on. If you are using ZVOL, than you have to clone snapshot. So I'm not sure if ctld aborts because it tests writing the backing storage and fails if it cannot. --WjW > > > bellow the details are: > > ---[ ctld debug quotation start ]------------------------------------------- > ... > ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file011 > ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file012 > ctld: error returned from LUN creation request: ctl_be_block_open: error opening /storage/win/.zfs/snapshot/daily-2015-08-22/file013 > ctld: failed to add lun 0, target iqn.2007-09.jp.ne.peach.istgt:file013 > ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file014 > ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file015 > ... > ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file052 > ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file053 > ctld: not listening on portal-group "default", not assigned to any target > ctld: listening on 10.100.21.47, portal-group "alfa" > ctld: listening on 10.100.21.47, portal-group "beta" > ctld: failed to apply configuration; exiting > /etc/rc.d/ctld: WARNING: failed to start ctld > ---[ ctld debug quotation end ]------------------------------------------- > > ---[ ctl.conf quotation start ]------------------------------------------- > target iqn.2007-09.jp.ne.peach.istgt:file013 { > alias "file013-users" > portal-group alfa > auth-group ag-file013 > lun 0 { > path /storage/win/.zfs/snapshot/daily-2015-08-22/file013 > size 300G > } > } > ---[ ctl.conf quotation end ]------------------------------------------- > > the very file exists: >> stat /storagez/win/.zfs/snapshot/daily-2015-08-22/traders.ts.ibs > 3500296891 22 -rw-r--r-- 1 root wheel 4294967295 214748364800 "Oct 23 07:41:38 2013" "Aug 21 04:00:28 2015" "Aug 21 04:00:28 2015" "Oct 23 07:41:38 2013" 131072 419838466 0x800 /storage/win/.zfs/snapshot/daily-2015-08-22/file013 > > > another question: can ctld be configured to ignore unavailable config > parts? like unaccessible/missconfigured LUNs