As far as your question goes "Can I install Ubuntu on second hard drive D?"
the answer is simply YES.
Before jumping to actually dual-booting Ubuntu along with Windows, there are few things you should figure out otherwise it might be quite hectic to fix issues and in worst case you need to format your entire HDD
Few common thing you could look out for are:
- What is your system specs
- Whether your system uses BIOS or UEFI
- Whether you require to move data between two OS frequently
- Whether you wish to change Linux flavor in future
The reason you need to figure these questions out because all of them pose different issue when you try to dual-boot. I would now explain the above points and what you could do for them.
1. System Specs
The reason this is important is if your system is old and have poor specification then dual booting might only reduce your systems performance. Both Linux and Windows use chunks of the hard disk drive to improve performance while the computer is running. However, by installing a second (or third) operating system on the drive, you reduce the amount of space available for this.
Dual boot installation just places the other OS on free space on your hard disk, so it will use hard disk space, but since in a dual boot only one OS will run at any given time, then no memory or CPU is being used by the other OS, hence you shouldn't notice much difference in performance.
2. BIOS or UEFI
UEFI and BIOS are two different types of motherboard firmware. The reason to figure out whether your system got BIOS or UEFI is to manage to amount of partitions you could have in your system. Master Boot Record (MBR) disks use the standard BIOS partition table. GUID Partition Table (GPT) disks use Unified Extensible Firmware Interface (UEFI). One advantage of GPT disks is that you can have more than four partitions on each disk. To learn more UEFI and BIOS you could read this article
If you want to have more than 4 partitions on your system you could try to convert MBR To GPT, if its not in GPT by default. You could read this link to convert MBR to GPT, make sure to have backup of your data as you need to clean your entire HDD for this.
3. Frequent data transfer between OS
This is an important aspect to consider, although you could transfer the data between two OS either by external HDD, flash drive or by copying the files into other OS partition, there is no issue using the latter method however there is a potential chance to corrupt the NTFS when writing to it from Linux.
Therefore most of the time the Linux will only mount the Windows drive as read only. To avoid this problem you could create a common partition which can be accessed by both OS for transferring data, therefore you can easily transfer files among 2 OS just by copying the files to that partition.
DUAL BOOTING UBUNTU ALONG WINDOWS
As I saw you had issues recognizing your D drive. To ease the process you could first delete your D drive from Windows and then when you access it from Ubuntu installation it will be displayed as freespace. ( You can use this article to know how to delete a partition ).
You might see other partition apart from free space those partitions are used by Windows, it better not to concern yourself with those partitions and make new partitions from free space for your Ubuntu. Ubuntu does not use alphabets to identify a partition like Windows instead it use /dev/sdxx
( to learn more about them you could use this ).
Linux file system is different from Windows, you need to make a partition with mount point set as / to install OS to that partition, you could also make another partition your home directory by specifying /home as mount point for that partition. This helps if you wish to change the linux in future as your files will be on separate partition.
I would not argue whether it is necessary to make a swap partition for Ubuntu or not, that is for you to decide.
You could use this page to understand how to partition while installing Ubuntu
Finally, when you are done with installation you should see GRUB menu pop-up while booting asking you to choose the OS to load into.
P.S.
While dual-booting I do not recommend hibernating the OS
In the event that you mount (say, in Linux) a Windows partition while Windows is hibernated and you are unlucky enough that when you're done with Linux and attempt to reboot into Windows, Windows does resume from hibernation (instead of erroring out, throwing away hibernation data and attempting a normal boot), you will most likely suffer catastrophic data loss to all Windows partitions as all filesystem-related structures will be out-of-sync between what Windows has loaded in the memory and what's actually written on the disk.
ext4
partition. Set mountpoint to/
.