On my hard-drive I have 2 partitions, on the first one I've installed Windows 2008 SP2 on the second Windows 2008 R2. Whenever I boot in R2 drive D shows up as C. How can I prevent this? (I want to boot in R2 and the first partition with SP2 to be C and the second partition with R2 to be D).
Drive letters are relative. You can control the drive letter of a non bootable partition but once that partition is marked as "primary" you have no choice in what drive letter it receives other than physically adding or removing other disks.
http://www.pcguide.com/ref/hdd/file/partLetter-c.html
In your situation you'll always be stuck with each OS seeing those partitions with different drive letters just as much as if it were two complete physical PCs.
I've actually done just that. I forget where I found a how-to to do exactly that, but you need to build an answer file that will pre-define the volumes for the installer, and on which to install the OS. You can either hand-create an xml-answer file... or use AIK to build one for you.
Essentially, you need to have a <DiskConfiguration> tag with a defined DiskID... (you'll probably want the 2nd disk... i.e. DiskID=1) with a <ModifyPartitions> tag under the appropriate disk, with a partition ID with the letter defined.
After the <DiskConfiguration>, you'll need a <ImageInstall> tag and set the <InstallTo> to use the appropriate disk ID & partition ID.
something like:
I'm not sure that's 100% correct formatting... but should be pretty close. It also assumes that the disk you're installing win2k8r2 on is the 2nd disk detected... not the 1st. You will probably need to modify it to suit your needs. (you might also need a <CreatePartition> tag... before the <ModifyPartition> tag...) This could easily overwrite the wrong disk too... so be careful with it.
Windows 7 and Windows Server 2008 R2 by default always name their system partition "C", and all other partitions/disks/CDs/etc. based on their physical layout, starting from "D"; and, once Windows in installed, you can change the drive letter of any volume, but not that of the system one.
This is by design, and most people actually welcomed it in dual-boot scenarios ("Now my system drive is always C, WOW!!!").
Technically you can change the letter around, but it's going to cause major problems with anything installed on the R2 disk that uses absolute file references (like C:\whatever.txt, instead of %systemdrive%\whatever.txt).
Boot the R2 machine, open
regedit
, navigate to HKLM\System\MountedDevices and rename \DosDevice\C: and \DosDevice\D: (switch them, do not change their values). Reboot and they letters will change (don't say I didn't warn you about this breaking all kinds of stuff).The proper alternative is to build an answer file as TheCompWiz states in his answer. This require a full reinstall of the R2 partition; be very careful to point everything at the D: partition or else you'll corrupt the C: partition.
As Massimo pointed out, most people like the default behavior and it doesn't cause any corruption.