• 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. Common NFS mount options in Linux
  2. How To Disable Or Extend System Logging Rate-limit on CentOS/RHEL 7
  3. how to add a custom script to the systemd in CentOS/RHEL 7
  4. Linux OS Service ‘named’
  5. Extend the Size of /boot Partition on XFS Filesystem (CentOS/RHEL 7)
  6. Beginners Guide to User and Group Administration in Linux
  7. CentOS / RHEL 5 : How to rebuild Initial Ramdisk Image
  8. CentOS/RHEL 6 Kernel Panic – “Out of memory” kernel parameter panic_on_oom is enabled
  9. CentOS / RHEL : How to assemble a software RAID in Rescue mode
  10. Understanding /etc/security/limits.conf file

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary