TL;DR
- Try to shrink the partition in the Windows Disk Management snap-in. Proceed to the step 2, if the shrink fails.
- Find the event with ID 259 in the Windows Event Log and see it's details.
- For even more details, optionally, run the fsutil command with the appropriate parameters given on step 2.
- Given the details from the steps 2 and 3, determine what component, program or feature is locking your partition.
- Temporarily disable or uninstall it.
- Go to the step 1.
Possible culprits: Virtual Memory, System Restore and/or Windows Search Index (System Volume Information folder), Hibernation, Internet Explorer temporary files.
Detailed version:
In the low-level tasks, like working with an HDD system partition, I prefer to use native tools as much as possible, and switch to third-party tools only as a last resort, if none of native tools worked. So, directed by harrymc, I gave Windows Disk Management another try.
I first turned Virtual Memory and System Restore off, removed System Volume Information folders, and after that Disk Management utility allowed me to shrink the C: partition as much as I needed. After that I turned the features back on.
The following instructions may help you to identify what application or component is preventing your partition to shrink. First you need to find the latest event with ID 259 in the Windows Event Log (see Event Viewer / Windows Logs / Application). The event is generated when the system analyses a partition, and if you have already tried to shrink a partition via right-clicking on it in the disk management snap-in, then the event should be there. Another way to make the system analyze a partition is to run the Windows built-in defragmentation utility. The event tells you the last unmovable file or just the number of the last cluster of such a file. It also tells you the complete command to run from the command line to get more details about the last unmovable file. (Alternatively, you can probably also try to calculate the cluster number as min allowed partition size divided by cluster size, and then run the fsutil command with the appropriate parameters).
The filename will give you a hint to guess, what program or feature is locking your partition. And then you can turn it off or uninstall, and see if it helped. In my case turning off Virtual Memory and System Restore was enough. Sometimes it is also necessary to turn off hibernation, etc. And sometimes partition defragmentation may also help. Also, as stated in the WindowsITPro article, Windows Search Index files and Internet Explorer temporary files can also be "unmovable". Sometimes just disabling the System Restore and Windows Search Index will automatically remove unmovable files from the System Volume Information folder, and sometimes you may need to remove the folder manually after that.
P.S.: Thanks everyone for answers. Probably third-party tools would also work in my case, and probably they are easier to use, but as I have already told, for such kind of tasks I prefer to use native tools as much as possible. Also, personal thanks to harrymc for the important hint.
I'm not sure if the comment on your question was a comment from Random or your deleted post but from your second screen-cap you do in fact have an extended partition at the start of your drive that is housing the three Linux partitions, for a total of 3 actual primary partitions.
This is corroborated by the following, though it appears that Linux is enumerating the primary partitions first even though they are located towards the end of the disk.
Device Boot Start End Blocks Id System
/dev/sda1 6536 28220 174183530+ 7 HPFS/NTFS
/dev/sda2 28221 38913 85891522+ c W95 FAT32 (LBA)
/dev/sda3 1 6535 52492356 5 Extended
/dev/sda5 * 1 3246 26073432 83 Linux
/dev/sda6 6015 6535 4184901 82 Linux swap / Solaris
/dev/sda7 3247 6014 22233928+ 83 Linux
Specifically note that the extended partition is at the start of the disk and encloses the Linux partitions (the second and third numbers in the columns are block start and stop numbers).
Windows does not appear to handle this case very well and while it is correctly reporting the positions of the partitions it is not actually showing the extended partition.
Your partition scheme is technically legal and I doubt it will cause any problems, but it is a bit unusual to say the least.
Best Answer
You can convert your dynamic disk to Basic using this software Dynamic Disk Converter
Other Methods are listed here
Make sure Read this First