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

The Geek Diary

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

How to change a system’s machine-ID in Oracle Enterprise Linux 7

by admin

Ask: A system has the same machine-id than the original one, need to differentiate it so that some applications can tell systems apart.

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”.
– User should change the “machine-id” of the cloned virtual machine for the server to be uniquely identifiable over network.
– The machine-id is written into the file /etc/machine-id.

There is a built-in tool in systemd called systemd-machine-id-setup that will allow the re-generation of the machine-id. This is the procedure on how to use it:

1. Add writing permission to the machine-id file:

# chmod 777 /etc/machine-id

2. Open /etc/machine-id with a text editor and delete all of its content.

# vi /etc/machine-id

3. Rename the file /etc/machine-id:

# mv /etc/machine-id /etc/machine-id.oldid

4. Run the command:

# systemd-machine-id-setup 

5. Restore the previous permissions of the file:

# chmod 444 /etc/machine-id

Now the system will have a different IDs.

Filed Under: Linux, OEL 7

Some more articles you might also be interested in …

  1. Echo Command with Practical Examples
  2. btrfs filesystem Command Examples in Linux
  3. Linux OS Service ‘setroubleshoot’
  4. jpegoptim for image optimization
  5. “BAD PASSWD : is too simple” – error during password change in CentOS/RHEL 7 and 8
  6. How to Create yum Repository in CentOS/RHEL
  7. flameshot: command not found
  8. mtr Command Examples in Linux
  9. ego Command Examples in Funtoo Linux
  10. Input/Output Errors During XFS Filesystem Access In CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright