[pve-devel] [PATCH installer v2 2/2] copy /etc/hostid from installer root to target

Stoiko Ivanov s.ivanov at proxmox.com
Tue Jul 9 18:09:19 CEST 2019


/etc/hostid is used by ZFS (spl.ko) to determine which host last imported a
pool creating and importing a pool with one hostid during install and booting
with a different one (or none) leads to the system refusing to import the pool
see spl-module-parameters(5) and zpool(8).

by copying the /etc/hostid from the installer into the target system we ensure
that it stays consistent

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 proxinstall | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/proxinstall b/proxinstall
index 97af4b9..b256c6e 100755
--- a/proxinstall
+++ b/proxinstall
@@ -1514,6 +1514,9 @@ sub extract_data {
 	die "unable to create a new machine-id\n" if ! $machine_id;
 	write_config($machine_id, "$targetdir/etc/machine-id");
 
+	syscmd("cp /etc/hostid $targetdir/etc/") == 0 ||
+	    die "unable to copy hostid\n";
+
 	syscmd("touch  $targetdir/proxmox_install_mode");
 
 	my $grub_install_devices_txt = '';
-- 
2.20.1





More information about the pve-devel mailing list