From owner-freebsd-questions@freebsd.org Fri Apr 17 13:06:46 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 A42122B8F03 for ; Fri, 17 Apr 2020 13:06:46 +0000 (UTC) (envelope-from mail@osfux.nl) Received: from vm1982.osfux.nl (vm1982.osfux.nl [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 493bvn1qPbz3Npk for ; Fri, 17 Apr 2020 13:06:45 +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 43FBB20123 for ; Fri, 17 Apr 2020 15:06:34 +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 ; Fri, 17 Apr 2020 15:06:34 +0200 (CEST) Subject: Re: iscsi + restoring zfs snapshot To: freebsd-questions@freebsd.org References: <0ead1643-0fa3-3a89-2d2b-9086a46af6f6@osfux.nl> From: Ruben Message-ID: <0027cc2b-124f-bef3-f1aa-5c50a1c819b1@osfux.nl> Date: Fri, 17 Apr 2020 15:06:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <0ead1643-0fa3-3a89-2d2b-9086a46af6f6@osfux.nl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 493bvn1qPbz3Npk X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.81 / 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)[-0.996,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(0.18)[asn: 8315(0.88), 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:79.99.184.0/21, 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: Fri, 17 Apr 2020 13:06:46 -0000 Hi, Still having trouble understanding this... Any pointers? Regards, Ruben On 4/12/20 11:10 AM, Ruben via freebsd-questions wrote: > > 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 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org"