i have installed ubuntu from a bootable pen drive. The installation is complete and is working well... how can i change my primary boot device from pen drive to hard disk?
Have a look at https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows (nevermind the page title, the procedure for installing the bootloader is the same)
In short, you need to open a terminal window and type
sudo grub-install /dev/sda
but be sure to read the whole article I linked to.