From nobody Sun Nov 20 16:00:26 2022 X-Original-To: questions@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 4NFZxB3zKmz4hSfN for ; Sun, 20 Nov 2022 16:00:30 +0000 (UTC) (envelope-from olivier.freebsd@free.fr) Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [IPv6:2a01:e0c:1:1599::15]) (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 4NFZx9332Pz47B3 for ; Sun, 20 Nov 2022 16:00:29 +0000 (UTC) (envelope-from olivier.freebsd@free.fr) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=ion+ANFG; spf=pass (mx1.freebsd.org: domain of olivier.freebsd@free.fr designates 2a01:e0c:1:1599::15 as permitted sender) smtp.mailfrom=olivier.freebsd@free.fr; dmarc=pass (policy=none) header.from=free.fr Received: from ravel.localnet (unknown [109.210.33.132]) (Authenticated sender: olivier.freebsd@free.fr) by smtp6-g21.free.fr (Postfix) with ESMTPSA id 50856780304 for ; Sun, 20 Nov 2022 17:00:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1668960027; bh=5DGYTC6rByPRR0kwmHOCtwErfi/QzxVOwv6hQtGNmeA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ion+ANFG86tEnSWITM9Q3QLTjzNQUeUvx3CQs+GF1VCZYWpaqKehAG/OfY4Ar4ptk q1U8HIXlDL/LIEwPJOe/lf+r3CIoy+eI8buAc8gNFnD4ZgQgP6npWcBTJAl2CEKqOF ZqjK5Rfpimw/fyrse7jTpYXh69nX1/vet8QHaF8CO6B/k9MYV8IxPqUgsZbrQmk2xP VBbuG/Vtqq+Nz9GcoQxF2MfQ1ub3V/EOpcd3xYwGRDyU3OwQJ3tVu0OgIlGNe6YIMo bSwCs61TUINPAy9R2sgosNmQC/slzEMu2u76KssnaaHg7f7dSzsu5sAAm73wwKMiG0 HqGODrY/5c7TA== From: Olivier Certner To: questions@freebsd.org Subject: Re: What exactly is hostid used for? Date: Sun, 20 Nov 2022 17:00:26 +0100 Message-ID: <1931267.2YEvzyG8uJ@ravel> In-Reply-To: References: List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-1.88 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; NEURAL_HAM_SHORT(-0.89)[-0.886]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[free.fr,none]; CTE_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[free.fr:s=smtp-20201208]; R_SPF_ALLOW(-0.20)[+ip6:2a01:e0c:1:1599::15]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a01:e0c:1:1599::15:from]; MLMMJ_DEST(0.00)[questions@freebsd.org]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; DWL_DNSWL_NONE(0.00)[free.fr:dkim]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[free.fr:+]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[free.fr]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12322, ipnet:2a01:e00::/26, country:FR]; FREEMAIL_ENVFROM(0.00)[free.fr]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4NFZx9332Pz47B3 X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N Hi, > 1. What is it used for? To identify a given machine uniquely, for a variety of purposes. > 2. Can you safely disable it? Yes and no, see below. > 3. What relation does it have to ZFS? AFAIK, ZFS uses the hostid to identify the machine that last imported a given pool, storing this info in the pool. When you try to import such a pool, ZFS will refuse to do so automatically if you haven't set your hostid correctly, thinking you're trying to import a pool from another machine (to proceed anyway, you have to use '-f'). This is true irrespective of the value of the 'multihost' pool property (see zpoolprops(7)). It is also used by NFSv4, as pointed out by Graham. See nfsv4(4): "Also, since an NFSv4 mount uses the host uuid to identify the client uniquely to the server, you cannot safely do an NFSv4 mount when hostid_enable="NO" is set in rc.conf(5)." It can be used in configuring HAST (see hast.conf(5); never tried it myself). It is probably used by pf(4) when using pfsync(4) (to identify which host created a given rule). epair(4) assigns Ethernet MAC by default based on the hostid. if_genet(4) does the same. So yes, you can "safely" disable it, as long as you don't rely on the above functionality. I'm not guaranteeing that this list is exhaustive for the base system. Moreover, applications can access the hostid ('kern.hostid' or the longer 'kern.hostuuid') through sysctl(3) or gethosid(3), and do whatever they want with it. But frankly, why would you ever bother with disabling it? Regards. -- Olivier Certner