From owner-freebsd-fs@freebsd.org Sun Sep 6 15:55:00 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 1AFCB9CB181 for ; Sun, 6 Sep 2015 15:55:00 +0000 (UTC) (envelope-from joh.hendriks@gmail.com) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D5D1876 for ; Sun, 6 Sep 2015 15:54:59 +0000 (UTC) (envelope-from joh.hendriks@gmail.com) Received: by wicfx3 with SMTP id fx3so65247776wic.1 for ; Sun, 06 Sep 2015 08:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=KVWmtOwlKKVdb/DSWD76KTnTAm0LnjmiK2JoOWDpkhY=; b=Fg1Bf785qWH6HVvKtMMGYSAlfDZ//e9RHzgvmxn9/mjR8ISnYW2EiRUeWbnQvGPS9I HVNMcLfS4BQlGIDqZZ3vFeYaZuCdFoqTXfQ1QZ3qvBx92nulNDzMXBr5RUljl3slaH7h mR/1Mp8xTszyFpln0p8dR2ih3hVUBTIgAUVRUHPfCL92jbmZlc01TGUaf2FmCN4pnuTn e9DzBCL1WjHij/8Zat1KtfMmSyiiHZEA7ImL/iP+OAyWsCf6pt27OnbNfhmEpN60nqcz Vq+aYPoBwYlkWZCd9tAzumQqLYB/Ag/WLa5bAXd0qzrW+O8Q9C1mFg4CaXSNlTUqU6g/ /oKQ== X-Received: by 10.194.78.164 with SMTP id c4mr26198544wjx.65.1441554898031; Sun, 06 Sep 2015 08:54:58 -0700 (PDT) Received: from Johans-MacBook-Air.local (92-70-102-130.glasvezel.netexpo.nl. [92.70.102.130]) by smtp.googlemail.com with ESMTPSA id p5sm15717678wiy.17.2015.09.06.08.54.57 for (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Sep 2015 08:54:57 -0700 (PDT) Subject: Re: can zfs snapshot be used to back LUN in ctl.conf ? To: freebsd-fs@freebsd.org References: <20150827150027.10825@smtp.new-ukraine.org> <55EC4F3B.7090804@digiware.nl> From: Johan Hendriks Message-ID: <55EC61D1.6010206@gmail.com> Date: Sun, 6 Sep 2015 17:54:57 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55EC4F3B.7090804@digiware.nl> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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 15:55:00 -0000 Op 06/09/15 om 16:35 schreef Willem Jan Withagen: > 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 I just noticed something beeing mentioned on freshbsd.org. mav @ HEAD - r287499 - 2015 -09 -06 09 :54 :56 Move setting of media parameters inside open routines. This is preparation for possibility to open/close media several times per LUN life cycle. While there, rename variables to reduce confusion. As additional bonus this allows to open read-only media, such as ZFS snapshots. So I think in HEAD it should be possible from now on after revision 287499 gr Johan >> >> 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 > _______________________________________________ > freebsd-fs@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"