public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Stoiko Ivanov <s.ivanov@proxmox.com>
Subject: Re: [pve-devel] [PATCH installer 1/2] zfs: set canmount=off on /var/lib
Date: Tue, 21 Nov 2023 12:45:38 +0100 (CET)	[thread overview]
Message-ID: <245534943.479.1700567138619@webmail.proxmox.com> (raw)
In-Reply-To: <20231121110959.550051-2-s.ivanov@proxmox.com>


> Stoiko Ivanov <s.ivanov@proxmox.com> hat am 21.11.2023 12:09 CET geschrieben:
> 
>  
> as explained in zfsprops(4) setting canmount to off is similar to
> setting mountpoint to none - except that you can still use the dataset
> for storing properties to be inherited to children (and we want
> /var/lib/vz to have a mountpoint set)
> 
> Follows recommendations from upstreams ZFS on / guide:
> https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bookworm%20Root%20on%20ZFS.html
> 
> Fixes: dd19d40ceac179ba18652f1d6c3e4c23f246af00
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
>  Proxmox/Install.pm | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm
> index 1a4ee93..fd9bf84 100644
> --- a/Proxmox/Install.pm
> +++ b/Proxmox/Install.pm
> @@ -189,6 +189,10 @@ sub zfs_create_rpool {
>  	syscmd("zfs create $pool_name/data")  == 0 || die "unable to create zfs $pool_name/data volume\n";
>  	syscmd("zfs create -p $pool_name/ROOT/$root_volume_name/var/lib/vz")  == 0 ||
>  	    die "unable to create zfs $pool_name/ROOT/$root_volume_name/var/lib/vz volume\n";
> +	syscmd("zfs set canmount=off $pool_name/ROOT/$root_volume_name/var/lib")  == 0 ||
> +	    die "unable to set canmount property on $pool_name/ROOT/$root_volume_name/var/lib\n";
> +	syscmd("zfs set canmount=off $pool_name/ROOT/$root_volume_name/var")  == 0 ||
> +	    die "unable to set canmount property on $pool_name/ROOT/$root_volume_name/var\n";

what's the advantage of this as opposed to

zfs create -o mountpoint=/var/lib/vz $pool_name/var-lib-vz

(or some other name for the dataset)

>      }
>  
>      # default to `relatime` on, fast enough for the installer and production
> -- 
> 2.39.2
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




  reply	other threads:[~2023-11-21 11:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 11:09 [pve-devel] [PATCH installer 0/2] fix 2 small issues with recent installer patches Stoiko Ivanov
2023-11-21 11:09 ` [pve-devel] [PATCH installer 1/2] zfs: set canmount=off on /var/lib Stoiko Ivanov
2023-11-21 11:45   ` Fabian Grünbichler [this message]
2023-11-21 11:09 ` [pve-devel] [PATCH installer 2/2] serial installer: add serial config for grub to target system Stoiko Ivanov
2023-11-21 12:20   ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=245534943.479.1700567138619@webmail.proxmox.com \
    --to=f.gruenbichler@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=s.ivanov@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal