Emergency mode after hostname change

Issues related to configuring your network
olev
Posts: 9
Joined: 2022/06/14 13:41:49

Emergency mode after hostname change

Post by olev » 2022/06/14 13:56:15

Hi!
I tried to change hostname and got emergency mode.
I modifed /etc/hostname and /etc/hosts.
Can someone help me?
Thank you!
Last edited by olev on 2022/06/14 14:02:41, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Emergency mode after hostname change

Post by TrevorH » 2022/06/14 14:02:16

I am about 99% sure that the change you think caused this problem is not the cause. There is nothing dependent on the hostname that would cause you to drop to emergency mode.

The usual cause of this is something in /etc/fstab is not mountable and does not have the "fail" attribute specified.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

olev
Posts: 9
Joined: 2022/06/14 13:41:49

Re: Emergency mode after hostname change

Post by olev » 2022/06/14 14:06:34

Thanks for the answer!
I thought so too..
But when I return the original copies of the files /etc/hostname and /etc/hosts - boot ok.

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Emergency mode after hostname change

Post by TrevorH » 2022/06/14 14:21:39

Show us the changed files.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

olev
Posts: 9
Joined: 2022/06/14 13:41:49

Re: Emergency mode after hostname change

Post by olev » 2022/06/14 14:30:03

Hostname:
winhost.workgroup

hosts:
127.0.0.1 winhost winhost.workgroup winhost4 winhost4.workgroup4
::1 winhost winhost.workgroup winhost6 winhost6.workgroup6

olev
Posts: 9
Joined: 2022/06/14 13:41:49

Re: Emergency mode after hostname change

Post by olev » 2022/06/14 14:33:39

I tried different names in same logic - I got emergency mode in any case.

olev
Posts: 9
Joined: 2022/06/14 13:41:49

Re: Emergency mode after hostname change

Post by olev » 2022/06/14 14:42:34

Please tell me how to see the boot logs in the emergency mode, where should be the reason for switching to the emergency mode?

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Emergency mode after hostname change

Post by TrevorH » 2022/06/14 14:56:05

You need localhost on the 127.0.0.1 line. So if myou want your names to be resolved to 127.0.0.1 then you need to add them to the existing names.

Code: Select all

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

olev
Posts: 9
Joined: 2022/06/14 13:41:49

Re: Emergency mode after hostname change

Post by olev » 2022/06/14 15:10:56

Thanks for answer!
I modifed only /etc/hostname

Hostname:
linhost.localdomain

I got emergency mode after reboot...(

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Emergency mode after hostname change

Post by TrevorH » 2022/06/14 15:13:20

journalctl -xe
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply