From owner-freebsd-questions@freebsd.org Sun Apr 12 09:11:09 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED0BE2B7445 for ; Sun, 12 Apr 2020 09:11:09 +0000 (UTC) (envelope-from mail@osfux.nl) Received: from vm1982.osfux.nl (vm1982.osfux.nl [IPv6:2a03:5500:1724:55:79:99:187:212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 490QwD0xpNz3MN2 for ; Sun, 12 Apr 2020 09:11:07 +0000 (UTC) (envelope-from mail@osfux.nl) Received: from vm1982.osfux.nl (localhost [127.0.0.1]) by vm1982.osfux.nl (Postfix) with ESMTP id 93B0D2011C for ; Sun, 12 Apr 2020 11:10:56 +0200 (CEST) X-Spam-Status: No, score=0.0 required=5.0 tests=none shortcircuit=no X-Spam-Checker-Version: SpamAssassin 3.4.3 Received: from [192.168.9.195] (unknown [95.174.67.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by vm1982.osfux.nl (Postfix) with ESMTPSA for ; Sun, 12 Apr 2020 11:10:56 +0200 (CEST) To: freebsd-questions@freebsd.org From: Ruben Subject: iscsi + restoring zfs snapshot Message-ID: <0ead1643-0fa3-3a89-2d2b-9086a46af6f6@osfux.nl> Date: Sun, 12 Apr 2020 11:10:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 490QwD0xpNz3MN2 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.69 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[osfux.nl:s=default]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.69)[ip: (-9.55), asn: 8315(1.10), country: NL(0.03)]; DKIM_TRACE(0.00)[osfux.nl:+]; DMARC_POLICY_ALLOW(-0.50)[osfux.nl,reject]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8315, ipnet:2a03:5500::/31, country:NL]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2020 09:11:10 -0000 Hi, I have a couple of linux clients that mount an iscsi target provided by a zfs filesystem on a FreeBSD host. Yesterday I messed things up and I am trying to restore a snapshot to revert the changes. I seem to be able to do so, but since the result is somewhat unexepected I'm probably going the wrong way about it. The strange thing is that the snapshot restored from 2 weeks ago contains changes from last night :S This is the FS: zfs get all data/Docker/torrent NAME PROPERTY VALUE SOURCE data/Docker/torrent type volume - data/Docker/torrent creation Sun Dec 1 21:04 2019 - data/Docker/torrent used 56.8G - data/Docker/torrent available 93.0G - data/Docker/torrent referenced 19.7G - data/Docker/torrent compressratio 1.00x - data/Docker/torrent reservation none default data/Docker/torrent volsize 30G local data/Docker/torrent volblocksize 8K default data/Docker/torrent checksum on default data/Docker/torrent compression off default data/Docker/torrent readonly off default data/Docker/torrent createtxg 22810439 - data/Docker/torrent copies 1 default data/Docker/torrent refreservation 30.9G local data/Docker/torrent guid 15050313927458195147 - data/Docker/torrent primarycache all default data/Docker/torrent secondarycache all default data/Docker/torrent usedbysnapshots 6.12G - data/Docker/torrent usedbydataset 19.7G - data/Docker/torrent usedbychildren 0 - data/Docker/torrent usedbyrefreservation 30.9G - data/Docker/torrent logbias latency default data/Docker/torrent dedup off default data/Docker/torrent mlslabel - data/Docker/torrent sync standard default data/Docker/torrent refcompressratio 1.00x - data/Docker/torrent written 17.1K - data/Docker/torrent logicalused 12.1G - data/Docker/torrent logicalreferenced 9.25G - data/Docker/torrent volmode dev local data/Docker/torrent snapshot_limit none default data/Docker/torrent snapshot_count none default data/Docker/torrent redundant_metadata all default These are its snapshots: zfs list -t snapshot -r data/Docker/torrent NAME USED AVAIL REFER MOUNTPOINT data/Docker/torrent@2020-02-15_09.05.00--90d 677M - 6.30G - data/Docker/torrent@2020-02-22_09.05.00--90d 783M - 6.57G - data/Docker/torrent@2020-02-29_09.05.00--90d 798M - 6.65G - data/Docker/torrent@2020-03-07_09.05.00--90d 693M - 8.71G - data/Docker/torrent@2020-03-14_09.05.00--90d 684M - 11.2G - data/Docker/torrent@2020-03-21_09.05.00--90d 611M - 13.9G - data/Docker/torrent@2020-03-28_09.05.00--90d 864M - 18.1G - data/Docker/torrent@2020-04-04_09.05.00--90d 17.1K - 19.7G - [root@gneisenau:/usr/home/fux]# This is my restore attempt: zfs send data/Docker/torrent@2020-03-14_09.05.00--90d | zfs receive data/restoredfromsnapshot If I unmount the FS from the client, and export this new FS instead as: lun 3 { path /dev/zvol/data/restoredfromsnapshot size 30G } , restart ctld, mount that on the same linux client (but with the "ro" option): /dev/sdd on /mnt/restored_data type ext4 (ro,noatime,stripe=256,_netdev) it contains : root@torrent:/mnt/restored_data# ls -laht total 44K drwxr-xr-x 5 root root 4.0K Apr 12 10:23 .. drwx--x--x 14 root root 4.0K Apr 11 21:06 docker drwxrwxr-x 8 root root 4.0K Apr 11 20:57 . drwxr-xr-x 3 root root 4.0K Apr 11 20:57 deluge_config drwxr-xr-x 3 root root 4.0K Apr 11 20:57 docker_volumes drwxr-xr-x 2 root root 4.0K May 21 2019 downloads drwxr-xr-x 2 root root 4.0K May 21 2019 sickrage drwx------ 2 root root 16K May 21 2019 lost+found root@torrent:/mnt/restored_data# changes from way after 2020-03-14 , including those from last night . Huh? I'm using zfSnap for creating the snapshots, like this: /usr/local/sbin/zfSnap -s -z -a 90d -r data/Docker My first attempt to rollback yesterday's changes involved using the rollback option ( zfs rollback -r data/Docker/torrent@2020-04-04_09.05.00--90d ) but that did not work either (yesterday's changes were not reverted). Somebody got any insights as to why i'm unable to revert yesterday's changes? Any feedback appreciated! Kind regards, Ruben