How To reset the root password in XenServer versions 5.0 and later
I recently had an issue where a USB drive attached to Xen Server incorrectly disconnected so the server was throwing disk check failure and requesting I enter maintenance mode to resolve. The root password was obviously required to enter maintenance mode. For some or other reason XEN Server root password had been lost or did not working so I could not enter maintenance mode to resolve the drive issue.
- Bypass disk check.
- Reset root password.
- Remove USB drive from /etc/fstab so that it is not mounted during boot.
- Restart the XenServer.
- When the server completes the BIOS procedures, type menu.c32 at the boot: prompt and press Enter.
- Highlight the default boot option, which in my case it was xe but xe-serial is also an option, and press Tab.
- You will be presented with the boot command line. Add the single parameter to the command listed. Note: The position of the parameter is important. This parameter must be placed between the first and second set of hyphens (—)
- Add the fastboot parameter to the command listed. Note: The position of the parameter is important. This parameter must be placed between the first and second set of hyphens (—)
- Press Enter.
- The XenServer boots to a root shell prompt.
- Run the passwd command to change the root password.
- Run nano /etc/fstab and remove the line relating to the missing drive.
- Restart the XenServer with reboot command.
The full article I used with screen shots to help our can be found on the Citrix Support Website.