ZGENHOSTID(8)
β¨ zgenhostid β it's giving "make me a host ID" π
okay bestie so this is zgenhostid, a section 8 system manager's manual page π«Ά she lives in the system administration corner of the man-page universe and she is very good at her one (1) job.
π SYNOPSIS π
zgenhostid [-f] [-o filename] [hostid]
πΈ DESCRIPTION πΈ
So here's the tea β β zgenhostid makes you an /etc/hostid file and tucks the host ID right up inside it. Iconic behavior, honestly.
Now, if you hand her a hostid, she'll validate that value and store it, periodt. But if you don't? She just randomly generates one for you, no questions asked, main character energy only π .
β¨ OPTIONS β¨
-hβ shows you a lil summary of the command-line options. a little menu, a little snack, yk? π-fβ lets the output get overwritten. yes bestie, she's giving you permission to clobber π-ofilename β write to filename instead of the default/etc/hostid. your file, your rules π¦- hostid β this is the value that gets placed into
/etc/hostid. she needs it to be a number with a value between 1 and 2^32-1. and if it's 0? random ID time, we love a surprise π- lowkey important: this value must be unique among your systems. no twinning allowed π
- it has to be an 8-digit-long hexadecimal number, optionally prefixed by
"0x".
π§ FILES π§
/etc/hostid
π EXAMPLES π
Generate a random hostid and store it β¨
# zgenhostid
Record the libc-generated hostid in /etc/hostid π
# zgenhostid "$(hostid)"
Record a custom hostid (0xdeadbeef) in /etc/hostid π₯
# zgenhostid deadbeef
Record a custom hostid (0x01234567) in /tmp/hostid and overwrite the file if it exists π
# zgenhostid -f -o /tmp/hostid 0x01234567
π SEE ALSO π
genhostid(1), hostid(1), sethostid(3), spl(4)
π HISTORY π
zgenhostid emulates the genhostid(1) utility, and she's provided for use on systems which don't include that utility or which don't provide the sethostid(3) function. she's the understudy that absolutely ate the role, no cap π
β¨
okay that's the whole page bestie, go forth and generate responsibly π«Ά
π this was brought to you by OpenZFS, dated July 11, 2022, and the manual page is ZGENHOSTID(8) β mwah, take care of her π
π¦ where this page comes from
- alpine 3.23: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- alpine 3.24: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- nixos 26.05: zfs-user 2.4.4
- nixpkgs unstable: zfs-user 2.4.4
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5 Β· CDDL-1.0
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5.1 Β· CDDL-1.0
- ubuntu stonking: zfsutils-linux 2.4.4-1ubuntu4 Β· CDDL-1.0
- π the page's license: CDDL-1.0
- Copyright (c) 2017 by Lawrence Livermore National Security, LLC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms