"Change" password is impossible in principle. It is stored in encrypted form and nobody knows it, except for the user.
What you call “change” is done in two steps: 1) CANCEL the root password 2) SET the root password
Step 2 is performed by regular means using the passwd command when the OS is operating normally.
But step 1 can be performed only if the OS is running in a SINGLE USER mode - this is an emergency recovery mode of the system.
How to boot the OS in this mode depends on the bootloader used to boot the OS. In most cases, you need to have time to get into the boot mode selection menu and select the "Single user mode" item there.
After that, go to the directory / etc and with any text editor, edit the passwd file, making the second field in the root line empty, like this 'root ::'. Then we reboot as usual.
However, most likely, all this will be useless, since modern versions of Linux do not allow you to log in to the system as root in principle! No Evidence of this is the symbol 'x' or '*' in the root password field in the "shadow" file. This suggests that you can start processes as root, but it is impossible to login as root.
chroot
to flash drive - Naumov