I changed the drive, and after that, it gave me this error: “Give root password for maintenance mode or press Ctrl+D.” I tried several methods, but the issue wasn’t solved.
I am using AlmaLinux 9.
What should I do to fix this problem?
Hi
Login and read the logs to see why it was unable to boot normally.
In my case the fstab file contained a wrong / invalid drive definition.
Please give a bit more information on what you did and what you wanted to achieve with the changes you made to the working system.
Hello,
I am facing a problem. I changed the physical hard disks of my server, and when I restarted it, I got this message: “Give root password for maintenance mode or press Ctrl+D.”
I watched some videos on YouTube, but they were either for RHEL or CentOS. The procedures shown there didn’t work for me.
After that, my teacher gave me a guide like below.
I understand how frustrating it can be to run into this issue, especially after making hardware changes.
The message “Give root password for maintenance mode or press Ctrl+D” usually appears when the system detects a disk or file system issue during boot. Since you’re using AlmaLinux 9, the steps are slightly different compared to older RHEL/CentOS systems.
Here’s what you can try:
Step-by-step Solution:
Enter Maintenance Mode
When prompted, enter the root password to access single-user maintenance mode.
Check Filesystem Issues
Run the following command to check and fix disk errors (replace sdaX
with your root partition):
- fsck -y /dev/sdaX
If you’re unsure of your partition, you can run:
- lsblk
to see all available partitions.
Remount the Filesystem (if needed)
- mount -o remount,rw /
Exit Maintenance Mode
Once done, you can reboot the system:
- reboot
If the issue persists, please let me know the exact error or failing mount point. We might need to check /etc/fstab
or verify the UUIDs of the new disks.
Let me know how it goes, and I’m here to guide you further if needed.
Second I questened:
I tried and ran the command you guided us to run, and then I rebooted the system. Unfortunately, I still haven’t gotten any results.
He gave me this reply.
Sometimes, the password recovery process differs depending on the Linux distribution.
I recommend checking the following link, and please let us know if you need any further assistance.
After I told them:
I had used this method before to change the password, and I used it again now hoping it would solve the problem, but unfortunately the problem wasn’t resolved. It still gives the same message as shown in the screenshot I sent you.
the last reply from them is that:
I don’t have access to AlmaLinux to follow the steps for recovering the root password
Check the following steps, and do let me know
-
Reboot
-
You should see the GRUB menu and press e
-
Find the line that contains the keyword ‘linux’ and add the syntax below at the end, after the command
rw init=/bin/bash
-
Save the changes and quit
-
The system will boot directly into a bash shell as a root user without prompting for a password
-
Use the following command to change the password of root
passwd
- Reboot the system
But my problem is still now.
If you need, I will share a screenshot of the problem.
Hi
You need to access the logs when logged in to maintenence / emergengy mode.
Like mentionded in you post the partition file fstab might not be correct.
you can view and edit this file and validate the contents.
the fstab file should not contain entries like : /dev/sda
but entries that use a unique number.
In some cases a reinstall of the OS is also an option if the data is not that important.
What was on the old disks? I.e. how were they used?
Logically, you should have stopped/disabled the use of disk before you did remove it.
There is important data on our system. If it weren’t important, I could have reinstalled the system.
But now, if you have a solution and can show us a command to run, that would be your cooperation.
We have 12 TB hard disks, and we configured those 4 hard drives in a RAID 10 setup.
I wanted to add another hard drive, but when I removed the drives from the system and reconnected them, the operating system could no longer load, and it caused a problem.
All our data is stored there, including the database.
Unfortunately i don’t have experience with RAID.
Maybe @jlehtone has.
Why did you remove the existing drives in the first place, if the intention was to add an additional drive?
Software, hardware, or fake RAID config?
That does not exactly tell what was on the drives. Which parts of the directory tree were on the array? All (i.e. no separate system drive)?
One can take AlmaLinux installer image, boot with it, and select Troubleshoot/Rescue. That way one runs a minimal OS (from USB) and can check what it sees on the hard drives.
Answer: I wanted to add a drive, but whenever I tried to add it, even when I used fdisk -l
or lsblk
, the additional hard drive wouldn’t show up. So I thought maybe changing the physical location of the hard drives would solve the problem, but when I did that, the boot file got corrupted.
3 That does not exactly tell what was on the drives. Which parts of the directory tree were on the array? All (i.e. no separate system drive)?
One can take AlmaLinux installer image, boot with it, and select Troubleshoot/Rescue. That way one runs a minimal OS (from USB) and can check what it sees on the hard drives.
answer: How can I know where the problem is and what exactly it is after this stage?
Have you restored them to their original connections?
How can they be restored to their original connection
If you mean their location, I’ve already moved them back to their original place.