I installed ubuntu 14.04 on a separate hard disk twice. First time I put the boot loader on sdb but it goes straight to Windows 8.1 on startup. So I installed the second time with boot loader on sda however the problem still exists. Please help.
Edit: Go to this question and follow the installation instructions given there. I recommend installing Ubuntu on your sdb.
After installation, connect both your hard disks first and go into your Ubuntu installed in sdb.
Open a new terminal session ( Ctrl + Alt + T ) and type the following commands :
sudo grub-install /dev/sdb
sudo grub-mkconfig -o /boot/grub/grub.cfg
Reboot the system. Windows must have appeared in the grub menu now.