]>
git.proxmox.com Git - zfsonlinux.git/blob - zfs/debian/zfsutils-linux.postinst
3 # The hostname and hostid of the last system to access a ZFS pool are stored in
4 # the ZFS pool itself. A pool is foreign if, during `zpool import`, the
5 # current hostname and hostid are different than the stored values thereof.
7 # The only way of having a stable hostid is to define it in /etc/hostid.
8 # This postinst helper will check if we already have the hostid stabilized by
9 # checking the existence of the file /etc/hostid to be 4 bytes at least.
10 # If this file don't already exists on our system or has less than 4 bytes, then
11 # a new (random) value is generated with zgenhostid (8) and stored in
14 if [ ! -f /etc
/hostid
] ||
[ "$(stat -c %s /etc/hostid)" -lt 4 ] ; then