Ok, before you say this is a duplicate, please let me explain and then point me to the duplicate answer and I will delete this post. I have searched a bit but I have found no definitive answer or way to do this. I have tried installing Ubuntu onto a USB before without touching my HDD but it installed Grub and then all the boot files on the USB. I have a duel boot Ubuntu/Windows 10 now but not because I wanted to. I originally just had Windows and wanted to install Ubuntu on a flash drive so I could transfer it to any computer like a live .iso file but it failed miserably. It put the boot files on the USB and installed Grub to my HDD and so I could not boot my computer without the USB. I have since turned my computer into a duel boot so now I can boot it fine but I still want to try to install Ubuntu onto a USB in a way that I can transfer it to another computer and it will run like a live copy but with more space (and before you tell me to just create a live one and add a second partition, I tried and it didn't work... several times.) So, is there a sure fire way to do a complete install onto a USB and install Grub only onto the USB in a way that will not touch my current boot status at all?
EDIT:
It's been over a year now and I still haven't been able to do this yet I haven't tried for a long time. When I first tried this, I had a bootable USB and went through the process of installation on the same USB and went through the process of selecting the USB for both installation and GRUB. For some reason, Grub did get installed correctly to the USB but it screwed up my master boot record and would only boot to grub on the USB. This got fixed when I decided to do a full install and it recognized my other boot files. I could have messed up somewhere in the process but I can't remember. I will try doing this again but this time around I will do it in a virtual machine. I will try the solutions you have made and get back with the working solution.
sudo grub-install /dev/sda
or whatever drive. If from live system you have to mount system partition(s) first or use Boot-Repair. https://help.ubuntu.com/community/Grub2/Installing#Fixing_a_Broken_System – oldfred Apr 18 '16 at 20:06