Skip to content

Instantly share code, notes, and snippets.

@gnh1201
Last active May 27, 2024 21:26
Show Gist options
  • Save gnh1201/ef8fd8b7aa7ba1f76708d2e701ae25a5 to your computer and use it in GitHub Desktop.
Save gnh1201/ef8fd8b7aa7ba1f76708d2e701ae25a5 to your computer and use it in GitHub Desktop.
How to fix "can not open access to console the root account is locked"

How to fix "can not open access to console the root account is locked"

I recently experienced this problem, but I only had answers that did not help. Then, I was able to get a hint from the short opinion of the Linux Forum.

This problem is related to the change of the drive. If it is not properly reflected in /etc/fstab, such an error may occur.

  1. Download SystemRescueCD and make a bootdisk: https://www.system-rescue.org/

  2. FDISK and MOUNT

    # fdisk -l    # find a drive
    # mkdir /mnt/tmp
    # mount -t ext4 /dev/sda2 /mnt/tmp    # mount -t [filesystem] [drive] [mountpoint]
  3. Open the [mountpoint]/etc/fstab in text editor, and remove lines of the detacted devices

  4. Save and reboot, and remove the bootdisk.

Done.

References

@RandomAct5
Copy link

Ah man, I was just about to have a real long day. This fix is simple and I'm really happy you posted it. Thanks!!

@gnh1201
Copy link
Author

gnh1201 commented Oct 10, 2023

Thank you :)

Ah man, I was just about to have a real long day. This fix is simple and I'm really happy you posted it. Thanks!!

@abnerfreitas
Copy link

Thanks man, it really work for me

@gnh1201
Copy link
Author

gnh1201 commented Oct 30, 2023

Thank you :)

Thanks man, it really work for me

@sultan117
Copy link

Hello. I have the same problem. I think this solution is only for those users who already have kali linux installed. But I enter live mode to install Kali Linux, and then the following error appears: cannot open access to console the root account is locked. Is it possible to do anything about this?

@trafferty
Copy link

Thanks for this! Saved me a lot of work...

@gnh1201
Copy link
Author

gnh1201 commented Jan 19, 2024

@sultan117 This gist is for all Linux.

Hello. I have the same problem. I think this solution is only for those users who already have kali linux installed. But I enter live mode to install Kali Linux, and then the following error appears: cannot open access to console the root account is locked. Is it possible to do anything about this?

@gnh1201
Copy link
Author

gnh1201 commented Jan 19, 2024

@trafferty Thank you :)

Thanks for this! Saved me a lot of work...

@jmada
Copy link

jmada commented Jan 22, 2024

Thanks man!

@gnh1201
Copy link
Author

gnh1201 commented Feb 1, 2024

@jmada Thank you :)

Thanks man!

@SraMacbeth
Copy link

Thank you! It works for me on Debian 12.

@gnh1201
Copy link
Author

gnh1201 commented Feb 8, 2024

@SraMacbeth Thank you :)

Thank you! It works for me on Debian 12.

@AstroboyResearcher
Copy link

A VERY BIG THANK YOU! Sometimes the simplest things are so hard to figure out. This solved my problem and days of work, especially in the future with my big project. This probably is the cause of problems in my recent past. This solution is SO VALUABLE!.
Just a quick note for people reading 3rd line of solution above:
mount command is either Linux (ext4 reference on the left side) or Windows ([filesystem] [drive] on the right side .

This worked on LMDE6. I ran SystemRescueCD iso downloaded to Ventoy, used the terminal to execute the commands, then used the text editor to change /etc/fstab contents. I had to figure out which line(s) did not belong because it/they referenced a USB that was not present at bootup.
Instructions in the manual were sufficient to help figure which partition to mount. After saving and reboot, LMDE6 came up correctly!
Again, THANK YOU!

@gnh1201
Copy link
Author

gnh1201 commented Feb 26, 2024

@AstroboyResearcher Thank you :)

A VERY BIG THANK YOU! Sometimes the simplest things are so hard to figure out. This solved my problem and days of work, especially in the future with my big project. This probably is the cause of problems in my recent past. This solution is SO VALUABLE!. Just a quick note for people reading 3rd line of solution above: mount command is either Linux (ext4 reference on the left side) or Windows ([filesystem] [drive] on the right side .

This worked on LMDE6. I ran SystemRescueCD iso downloaded to Ventoy, used the terminal to execute the commands, then used the text editor to change /etc/fstab contents. I had to figure out which line(s) did not belong because it/they referenced a USB that was not present at bootup. Instructions in the manual were sufficient to help figure which partition to mount. After saving and reboot, LMDE6 came up correctly! Again, THANK YOU!

@NaolB02
Copy link

NaolB02 commented May 21, 2024

I was trying to install some package on my kali linux which took long and then black out the screen with a single blinking cursor. It just stayed there so I powered it off. When I tried to restart it, it would bring the same error. I check the /etc/fstab file using SystemRescue but there seems nothing wrong. Do you know anyway of solving this?

@gnh1201
Copy link
Author

gnh1201 commented May 22, 2024

@NaolB02 In similar cases, what I usually check is the block UUID. I hope the following link will be helpful for you.

https://unix.stackexchange.com/questions/658/linux-how-can-i-view-all-uuids-for-all-available-disks-on-my-system

I was trying to install some package on my kali linux which took long and then black out the screen with a single blinking cursor. It just stayed there so I powered it off. When I tried to restart it, it would bring the same error. I check the /etc/fstab file using SystemRescue but there seems nothing wrong. Do you know anyway of solving this?

@NaolB02
Copy link

NaolB02 commented May 27, 2024

Thank you for the reply.

@NaolB02 In similar cases, what I usually check is the block UUID. I hope the following link will be helpful for you.

https://unix.stackexchange.com/questions/658/linux-how-can-i-view-all-uuids-for-all-available-disks-on-my-system

I was trying to install some package on my kali linux which took long and then black out the screen with a single blinking cursor. It just stayed there so I powered it off. When I tried to restart it, it would bring the same error. I check the /etc/fstab file using SystemRescue but there seems nothing wrong. Do you know anyway of solving this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment