Permanentely change machine-id

Hi there, I tried to change the/etc/machine-id with sudo systemd-machine-id-setup --commit. I got a new one in the file but after reboot it was reverted back to the old one.

I need a new id due to it somehow relates to a device-name in my megasync backup dadhboard that is the name of an old unused laptop.

How can I get a new id permanentely. I used systemd-boot. From where does the above command take information so it always generates the old id?

Any hint welcome.

Thanks and have a merry christmas everyone :slight_smile:

sudo rm -f /etc/machine-id /var/lib/dbus/machine-id
sudo dbus-uuidgen --ensure=/etc/machine-id
sudo dbus-uuidgen --ensure

1 Like

Thanks 2000, I found the id as directoryname for kernel in /efi as well. Will that be updated with next rebuild-kernels?

It probably will. However, you will probably need to delete the old one manually.

I would delete that directory and it’s contents and then run sudo reinstall-kernels.

Check to make sure everything is recreated properly after that. You may also need to clean-up the old entries in /efi/loader/entries manually.

1 Like