Reset root password on CentOS 7

18 sec read

Edit boot menu on-the-go

0. reboot the CentOS 7 and press ESC when GRUB menu show up on the screen and press “e”
1. find “ro” on “linux16” section and then change to “rw init=/sysroot/bin/sh”
2. press “CTRL + x” to reboot CentOS to init sh mode and start to reset root password

chroot sysroot

after booting on init sh mode, run this command:

chroot /sysroot

reset root password

passwd root

reinitial selinux

touch /.autorelabel

exit from chroot

exit

reboot CentOS 7

reboot

Free ext4 reserved blocks with tune2fs

Check disk usage df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 95G 82G 7.9G 92% / Check size of Reserved block count...
Sysadmin.ID
19 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *