Cannot open access to console, the root account is locked. RHEL 9 image

0

I build an EC2 instance based on RHEL 9 using an M7i.4Xlarge image, but due to application licensing had to limit the available cores to 2cpu.

I then wanted to increate the cores, so I used the following procedure:

  1. create an AMI image of the original machine
  2. terminate original instance (in order to re-use the network interface to preserve the IP address)
  3. launch new instance from AMI image in step 1, but specify 4 cores instead of 2
  4. Boot new instance

I tested this procedure on a 'test' machine and it worked with no issues. However when I do this with my actual application server, the new instance will not boot. I get the error "Cannot open access to console, the root account is locked."

I've detached the boot/root disk and can attach it to a different instance and read the filesystem. /etc/fstab from the non-booting instance is configured to mount the disks by UUID and not device name (found that suggestion https://repost.aws/questions/QUbkr4v8pBQ8Sz-4AdDVDJQA/cannot-open-access-to-console-the-root-account-is-locked-al2-t2-t3. I also commented out any remote mountpoints in case that was causing problems. So the only mounts in /etc/fstab will be "/", "/boot" and "boot/efi"

Not sure how to proceed at this point, this thing won't boot AT ALL.

asked 16 days ago112 views
1 Answer
0

When the host fails to boot, are there any more messages other than "Cannot open access to console, the root account is locked." ?

And when you have (what I'll call) the problem rootdisk mounted on the rescue instance at (say) /mnt can you double-check that the UUIDs listed in /mnt/etc/fstab are definitely correct and complete?

It's easy to get cross-eyed with things like this, and have the wrong disk's UUIDs in place.

On the rescue instance lsblk to list the disks, and then sudo blkid /dev/[second_disk]* (the wildcard will make sure to capture the /boot & /boot/efi devices on the problem root disk as well).

profile picture
EXPERT
Steve_M
answered 15 days ago
profile picture
EXPERT
reviewed 15 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions