Section: systemd-machine-id-setup (1)
systemd-machine-id-setup - Initialize the machine ID in /etc/machine-id
may be used by system installer tools to initialize the machine ID stored in
at install time, with a provisioned or randomly generated ID. See
for more information about this file.
If the tool is invoked without the
is initialized with a valid, new machined ID if it is missing or empty. The new machine ID will be acquired in the following fashion:
If a valid D-Bus machine ID is already configured for the system, the D-Bus machine ID is copied and used to initialize the machine ID in
If run inside a KVM virtual machine and a UUID is configured (via the
option), this UUID is used to initialize the machine ID. The caller must ensure that the UUID passed is sufficiently unique and is different for every booted instance of the VM.
Similarly, if run inside a Linux container environment and a UUID is configured for the container, this is used to initialize the machine ID. For details, see the documentation of the
Otherwise, a new ID is randomly generated.
switch may be used to commit a transient machined ID to disk, making it persistent. For details, see below.
to initialize the machine ID on mounted (but not booted) system images.
The following options are understood:
Takes a directory path as argument. All paths operated will be prefixed with the given alternate
path, including the path for
Commit a transient machine ID to disk. This command may be used to convert a transient machine ID into a persistent one. A transient machine ID file is one that was bind mounted from a memory file system (usually
during the early phase of the boot process. This may happen because
is initially read-only and was missing a valid machine ID file at that point.
This command will execute no operation if
is not mounted from a memory file system, or if
is read-only. The command will write the current transient machine ID to disk and unmount the
mount point in a race-free manner to ensure that this file is always valid and accessible for other processes.
This command is primarily used by the
early boot service.
Print the machine ID generated or committed after the operation is complete.
Print a short help text and exit.
Print a short version string and exit.
On success, 0 is returned, a non-zero failure code otherwise.