I have a dual boot Windows XP/Linux system. The Windows is so painfully slow I can barely stand it (I think the computer is from 2007).
Tried to boot up in Linux, but it seems the root password is not what I was expecting it to be. After several attempts, I realised I must have changed it to something new, and then (after not using the Linux partition for some time), forgot what it was. I could log in as a regular user, just not as root.
So I burned a bootable Linux CD (which was an adventure in and of itself), and booted from it.
The idea now was to mount the Linux partition on "/mnt", and then run the command "chroot /mnt passwd".
For those not familiar, "passwd" is the command in Linux (and other Unices) to change the password. When logged in as the root user (which I was, when booted from the CD), it would change the password of the root user. So I could change it to something which I new.
But, if one just executes the command "passwd", it changes the password stored in the /etc/shadow file (in encrypted form), which, when booted from the CD, is a file in the virtual file system created when the CD system starts up. What I want is for the password in the /etc/shadow file on the hard disk to be changed. So the "chroot /mnt <command>" tells the system to change the root of the file system to /mnt (where the hard disk is mounted) when executing the password command; that way, the /etc/shadow file changed would be the one on the hard disk, not the one in the virtual file system the CD system creates when booting.
But when I try the "chroot /mnt passwd', I got "kernel too old". The system on the hard disk is much newer than the system on the CD. So I think what happened is, it tried to run the "passwd" command on the hard disk, from the new system. That program then did some check, and determined it was running on a system with an old kernel (since the kernel would be from the CD system). It then bails, since it uses some features which the old kernel doesn't have available. At least, that's what I think happened.
I was able to solve the problem in a rather simple way - just execute the "passwd" command. That changed the entry in the /etc/passwd in the virtual file system in memory, the one created by the CD-based Linux system. I then just ran a text editor, and copied the line for the "root" user in this file to the /etc/passwd file on the hard disk. That actually worked, and I can now access my Linux system again.