I'm trying to reinstall Mac OS on a late 2009 21.5 inch iMac. The previous owner tried to install ubuntu on it but failed to get it to work properly so I'm trying to install Mac OS Sierra from a USB stick. I know the USB works because I can boot from it on my Macbook Pro. The problem is that I can't figure out how to get the iMac to boot from the stick. Whenever I try to get into startup manager all I get is an all white screen and a mouse curser. I can get into Ubuntu safe mode and grub but I'm not sure what I can do from there to make the mac boot from USB.
I'm assuming that holding down the option key when starting up does not show the boot drive selector displaying at least your internal drive. If this is the case then there is another bootloader getting in the way.
Your next step should be to reset the NVRAM. You can find instructions here.
The Mac probably has rEFIt installed, or it was uninstalled improperly. Try booting the computer off an original DVD and setting the startup disk. Or try booting with the option key and selecting your installer USB stick.