From nobody Tue Nov 07 04:48:01 2023 X-Original-To: freebsd-jail@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SPbLy3JN5z50XvT for ; Tue, 7 Nov 2023 04:48:10 +0000 (UTC) (envelope-from DtxdF@disroot.org) Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4SPbLw6gsdz4Gjn for ; Tue, 7 Nov 2023 04:48:08 +0000 (UTC) (envelope-from DtxdF@disroot.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=disroot.org header.s=mail header.b=MtNzzKQt; spf=pass (mx1.freebsd.org: domain of DtxdF@disroot.org designates 178.21.23.139 as permitted sender) smtp.mailfrom=DtxdF@disroot.org; dmarc=pass (policy=reject) header.from=disroot.org Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id D8D1844D7A for ; Tue, 7 Nov 2023 05:48:05 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SPpApED07RGM for ; Tue, 7 Nov 2023 05:48:05 +0100 (CET) Date: Tue, 07 Nov 2023 04:48:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1699332485; bh=bwGBS4yBnqmzSmWk/NF63QO4zwCm/jWBF01T2ZJifDU=; h=Date:From:To:Subject:In-Reply-To:References; b=MtNzzKQtLXImbywV1bzXTSrRgh0aRdaxRLuk8Au02s1/BMJbyDDgJK3RGBJ4e+ADm lvDPoaaccrbcgmtzHxxA05NVj8Sb+W7cw/M7Bd3E/HouvaFmibx7l8zFkXGabo/frC LrY3Z8d+A30NJ71TT5yNVZNJ+KGVBlnbygINbzuOHANqC6jCUaheT5RWjhRKLcVE7R W2MtkmCOwbXRKO0X47dzlqfsBmOAai08vt27SzkqD1ilNzRilmgs8Is46P9C4qGPe4 JPnhkZrkJiJjV1qsN80hR4VRD+fili5XckSiEPJA+nT0Lwkk7JJ3uO80pA0E3QZssj VlpAzI205/liQ== From: DtxdF To: freebsd-jail@freebsd.org Subject: =?US-ASCII?Q?Re=3A_I_can_get_zfs_snapshot/rollback_in_a_jail_to_work_?= =?US-ASCII?Q?99=25_but_it_isn=27t_quite_100=25?= =?US-ASCII?Q?_working=2E_What_am_I_missing=3F?= In-Reply-To: References: Message-ID: List-Id: Discussion about FreeBSD jail(8) List-Archive: https://lists.freebsd.org/archives/freebsd-jail List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-jail@freebsd.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----QIZC0QV9PW0K46HSTWP6PXS1PWWPCU Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-1.79 / 15.00]; SUBJ_EXCESS_QP(1.20)[]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-0.99)[-0.995]; DMARC_POLICY_ALLOW(-0.50)[disroot.org,reject]; R_DKIM_ALLOW(-0.20)[disroot.org:s=mail]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-jail@freebsd.org]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:50673, ipnet:178.21.23.0/24, country:NL]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[disroot.org:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-jail@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4SPbLw6gsdz4Gjn X-Spamd-Bar: - ------QIZC0QV9PW0K46HSTWP6PXS1PWWPCU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > So as I mentioned I=E2=80=99ve able to mail the dataset=2E It gets mounte= d upon starting the jail=2E It shows up in =E2=80=9Czfs list=E2=80=9D=2E If you can see your dataset with `zfs-list(8)` it does not mean that it is= mounted=2E You should check it using `mount -t zfs` or `zfs mount`=2E > And when I do zfs snapshot on the dataset it appears to create the snaps= hot as it shows up in a =E2=80=9Czfs list -t snapshot=E2=80=9D but the snap= dir isn=E2=80=99t visible even after setting snapdir to visible, and when I= rollback using the snapshot it doesn=E2=80=99t actually rollback=2E You can create snapshots and run `zfs-rollback(8)` even when your dataset = is not mounted and it will not fail=2E --- I have seen your `rc=2Econf(5)` from your jail and it sets `zfs_enable` to= `YES`=2E As I mentioned, it doesn't work at startup and maybe it's a bug= =2E When your jail is started you can run `service zfs start` and it will w= ork=2E That rc script knows it is inside a jail so it just runs `zfs mount = -a` and `zfs umount -a` (when running `service zfs stop`)=2E I don't recommend using that rc script to mount your datasets because when= you run `service zfs stop` it will try to unmount `/` which is an error=2E= As a workaround use the approach I share with you: mount and unmount your = datasets using your `jail=2Econf(5)` (see the AppJail template example)=2E ------QIZC0QV9PW0K46HSTWP6PXS1PWWPCU Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
> So as I mentioned I=E2=80= =99ve able to mail the dataset=2E It gets mounted upon starting the jail=2E= It shows up in =E2=80=9Czfs list=E2=80=9D=2E

If you can see your da= taset with `zfs-list(8)` it does not mean that it is mounted=2E You should = check it using `mount -t zfs` or `zfs mount`=2E

> And when I do z= fs snapshot on the dataset it appears to create the snapshot as it shows up= in a =E2=80=9Czfs list -t snapshot=E2=80=9D but the snapdir isn=E2=80=99t = visible even after setting snapdir to visible, and when I rollback using th= e snapshot it doesn=E2=80=99t actually rollback=2E

You can create sn= apshots and run `zfs-rollback(8)` even when your dataset is not mounted and= it will not fail=2E
I have seen your `rc=2Econf(5)` from your jail and = it sets `zfs_enable` to `YES`=2E As I mentioned, it doesn't work at startup= and maybe it's a bug=2E When your jail is started you can run `service zfs= start` and it will work=2E That rc script knows it is inside a jail so it = just runs `zfs mount -a` and `zfs umount -a` (when running `service zfs sto= p`)=2E

I don't recommend using that rc script to mount your datasets= because when you run `service zfs stop` it will try to unmount `/` which i= s an error=2E As a workaround use the approach I share with you: mount and = unmount your datasets using your `jail=2Econf(5)` (see the AppJail template= example)=2E
------QIZC0QV9PW0K46HSTWP6PXS1PWWPCU--