Transferring a system to a new HDD: All done, but can't login

General support questions
Post Reply
rednano
Posts: 2
Joined: 2018/10/23 08:16:40

Transferring a system to a new HDD: All done, but can't login

Post by rednano » 2018/10/23 08:22:20

Long time lurker, finally created an account to ask my questions and difficulties I find using CentOS. :)

I got a machine with an older-than-centos7 installation that had LVM and a complete mess of partitions.

So, I plugged a new disk, partitioned it as I want and rsynced the partitions as they should be now

After editing the fstab to reflect the new partition scheme and reinstalling grub, I performed a

Code: Select all

dracut -f --regenerate-all
after chroot'ing into the mounted new system.

Now, the machine seems to boot, and it recognises the users, because if I input a wrong password, t will tell me it's a wrong login attempt, but if I input the right password, it clears the screen and sends me back to login prompt.....

What could be happening?

Tell me which details you would need to help me troubleshoot this.


Thanks!

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

Re: Transferring a system to a new HDD: All done, but can't login

Post by TrevorH » 2018/10/23 09:49:16

So, I plugged a new disk, partitioned it as I want and rsynced the partitions as they should be now
Sounds like it didn't copy the correct selinux contexts over. You could try

touch /.autorelabel
reboot
interrupt the boot at the grub menu and edit the kernel command line and append enforcing=0 to the end so that it boots in permissive mode and allows the relabel to complete.
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

rednano
Posts: 2
Joined: 2018/10/23 08:16:40

Re: Transferring a system to a new HDD: All done, but can't login

Post by rednano » 2018/10/23 11:21:55

That was the exact solution! I came over shortly after posting the question, but as I'm new, it wasn't still published so I could self-reply.


Thanks though!

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

Re: Transferring a system to a new HDD: All done, but can't login

Post by TrevorH » 2018/10/23 12:05:06

I think there's an rsync parameter that tells it to copy the selinux contexts too... for next time :)
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