• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 7 : How to Change the machine-id

By admin

What is machine-id

– The /etc/machine-id file contains the unique machine ID of the local system that is set during installation. The machine ID is a single newline-terminated, hexadecimal, 32-character, lowercase machine ID string. When decoded from hexadecimal, this corresponds to a 16-byte/128-bit string.
– The “machine-id” parameter is added from RHEL 7.1 to identify the machine in the network. Therefore this parameter must be unique.
– But when user clone the virtual machine that is installed RHEL 7.1, the cloned virtual machine’s “machine-id” is not changed, and some virtual machine may have the same “machine-id”.
– The user should change the “machine-id” of the cloned virtual machine for the server to be uniquely identifiable over the network.
– The machine-id is written into the file /etc/machine-id

# cat /etc/machine-id
daab00e07fed481d8ccf145b7affc0c5

Changing the machine-id

1. Clear the original “machine-id”
– The “machine-id” value is written in “/etc/machine-id”.
– We can either remove or empty the machine-id file to clear out the original value.

# rm /etc/machine-id

2. Create the new “machine-id” value
Generate a new machine-id by the “systemd-machine-id-setup” command which populates the remove file again with a new and unique machine-id value.

# systemd-machine-id-setup
Initializing machine ID from random generator.

3. Verify
Verify the new value of machine-id.

# cat /etc/machine-id
2175d9b2344a499abd87920c6f76f9a1
NOTE : This is applicable to CentOS / RHEL version 7.1 and above.

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to convert volume group metadata between LVM1 and LVM2
  2. Configuring Persistent Storage in CentOS/RHEL 5,6 for Single Path using udev rules
  3. How to Make User Account Read-Only in CentOS/RHEL 7
  4. CentOS / RHEL 5, 6 : how to disable NetworkManager
  5. Linux / UNIX : Examples of find command to find files with specific sets of permissions
  6. How to automate sftp file transfers using expect utility
  7. How to set custom device names using udev in CentOS/RHEL 7
  8. Linux OS Service ‘haldaemon’
  9. Linux OS Service ‘irqbalance’
  10. How to Recover from a Corrupted or empty /etc/mtab file in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary