[pve-devel] [PATCH installer 2/2] copy /etc/hostid from installer root to target
Stoiko Ivanov
s.ivanov at proxmox.com
Tue Jul 9 15:29:53 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 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/proxinstall b/proxinstall
index 19d0896..8ac00d0 100755
--- a/proxinstall
+++ b/proxinstall
@@ -1511,6 +1511,8 @@ sub extract_data {
diversion_add($targetdir, "/usr/sbin/update-initramfs", "/bin/true");
syscmd("systemd-machine-id-setup --root=$targetdir") == 0 ||
die "unable to create a new machine-id\n";
+ syscmd("cp /etc/hostid $targetdir/etc/") == 0 ||
+ die "unable to copy hostid\n";
syscmd("touch $targetdir/proxmox_install_mode");
--
2.20.1
More information about the pve-devel
mailing list