On two different drives? Not really. But, this technically doesn't mean it's impossible, just hard.
You seem to want something called a Virtual Machine for your testing version of Ubuntu. In short, this is a computer inside a computer, and the data can be stored (theoretically) anywhere. I would advise using a virtual machine image directly (as it can be imaged, backed up, deleted, and is a lot smaller than a full partition). However, if you really want your test OS to be installed on a real partition, you can.
Note: I will be using VirtualBox for this example. You can do this with almost any hypervisor, but I'm giving instructions with VirtualBox.
- Create a new VM in VirtualBox and set it up. Do not attach a hard drive to it during creation!
- Open a terminal and use
lsblk
to find the partition/disk you want to give to the VM. In my example, I will be assigning /dev/sdc
to the virtual machine.
Run the following command in a terminal:
VBoxManage internalcommands createrawvmdk -filename "~/DevSDC.vmdk" -rawdisk /dev/sdc
Move this .vmdk
file from your home directory to wherever you want it to be.
- In VirtualBox settings, attach the
.vmdk
file you made to the virtual machine.
- Start the VM and install Ubuntu as normal.
You will be able to mount the other Ubuntu install partition from your host OS without a problem, and you can use VirtualBox's Shared Folders to copy information live. There isn't really a way you can expose your real machine's drive to the VM (and you shouldn't).
Also note that there's really no expectation that you'll actually be able to boot directly into your second hard drive/partition. While you may be able to, I'd be very impressed if it actually worked without some serious bugs/flaws.
Really, though, what you're wanting to do is pretty insane. Just use a regular virtual machine and a regular disk image file instead of jumping through the hoops. It'll be more stable and you'll be a lot less likely to accidentally break something important.