And yes: for a few days i have problems with one of systems on my PC -LMDE. Recently i got repaired there one thing as shown here : ("Mint" - a bunch of errors in boot). Now i have yet bigger problem - system ask me password for non-existing user (root) error code is here:
Give root password for maintenance (or press Control-D to continue):
When i press these button it shows me:
Reloading system manager configuration
Starting default target
You are in emergency mode. After logging in, type “journal -xb” to view system logs, “systemctl reboot” to reboot, “systemctl default” or “exit” to boot into default mode.
Give root password for maintenance (or press Control-D to continue)
When i chrooted into this OS (with live-boot) i saw that there are problems with sudo and pkexec, so i cant use root even in chroot (and modify system files, etc...) is there any way to boot PC normally or i need to always use “initramfs error” and boot only to busybox cli (i can do that because i accidentally uninstalled grub and now i have cli when booting up pc)?
Ps: I didnt setted up root (su) account (no password, user, etc) and i was really messing up with sudo so now i think that this also doesnt exist.
———————————————-
Edit: i’ve done it with passwd as @cas said. Now i have bigger problem.
My second problem is that all my partition is r/o. Even with modified /etc/fstab to open all partitions as writable. My system didn’t exited cli to the now - system doesn’t load without writable permission and my current (logged-in) user looks like root (have # before command and whoami shows me as root) but it isn’t. When i try mount command they said that i need to have root permission ( how i cant have them when currently i am root?!). Is there something i forgot, all my PC is corrupt or im a real n00b?
sudo -i
to get a root shell in the live-cd if you're not already logged in as root, before chrooting into your filesystem. You can then usepasswd
to set a password for root. And fix whatever's broken on your system. fixing it probably involves bind-mounting /proc, /sys, and /dev under the chroot target (e.g. if mounted as /mnt,for i in proc dev sys ; do mount -o bind /$i /mnt/$i ; done
) before chrooting, and then runningupdate-grub
and/orupdate-initramfs
while in the chroot. – cas Apr 27 '21 at 16:20/mnt
. Adjust to suit your chroot's mount point (which looks to be /media/mint/chmod 640 /etc/shadow
while in the chroot. Otherwise try runningpasswd root
instead of justpasswd
- some PAM configs can give that error when trying to change a password for a user which doesn't have one yet. – cas Apr 27 '21 at 18:43remount
asremout
. and that-t
option is just wrong - it's not needed AND you've misused it. You need to be careful and methodical, stay calm, plan each step in advance, and then double-check everything you type before you hit enter. You're messing with the system's boot process, any mistake could be disastrous (and is probably how you got into this mess in the first place). Trymount -o rw,remount /
(from within the chroot. or, from outside it, use the mount-point - e.g.mount -o rw,remount /mnt
). – cas Apr 28 '21 at 08:27