I unexpectedly deleted my user account (the only administrator for the machine). I have another account which is a standard account and now I can't access my hard disk or anything with that standard account - it is asking for the root password. Is there any way I can recover access to the administrator account?
You can use recovery mode to add the standard user to the admin group (which is now called sudo in 12.04). Below is a set of simple instructions copied from my personal website.
Using Recovery Mode To Add Users To The Admin / Sudo Group
First shutdown your computer.
restart whilst holding shift on the keyboard to load grub menu.
recovery mode from the grub menu.
drop to root shell from the recovery menu.
Use the following command to remount the drive
mount -o rw,remount /
adduser username sudo replacing username with your user name ie. 'adduser phil sudo'
You should now see a message saying 'adding user' followed by 'done'.
shutdown -r now to restart the computer.
EDIT: If it is telling you that user xxx does not exist, first you can use the following command to list users and make sure that you have the correct username
The other option is add a new user, from recovery mode using the following commands :
useradd username -m -s /bin/bash passwd username adduser username sudo
username with your desired username.