I have a Win2K3 VM hosted by a KVM hypervisor. In the Linux host I have 2 Linux partitions type ID=83 (eg: /dev/sda5 and /dev/sdb5) that I've allocated to the Win2K3 VM as virtual disks. The Windows guest took care of the inner content of these virtual disks (which in fact are Linux partitions), so if you will ask your Linux host about "what kind of filesystem do they have?" then your Linux will answer "???".
For instance, I ran the following command at the console:
parted /dev/sda print
it will answer like this:
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Â Start Â Â End Â Â Â Â Size Â Â Â Type Â Â Â Â Â File system Â Â Â Â Flags
Â 1 Â Â Â Â Â 1049kB Â 34.6MB Â 33.6MB Â primary Â Â ext2 Â Â Â Â Â Â Â Â Â Â Â boot
Â 2 Â Â Â Â Â 34.6MB Â 4330MB Â 4295MB Â primary Â Â linux-swap(v1)
Â 3 Â Â Â Â Â 4330MB Â 15.1GB Â 10.7GB Â primary Â Â ext4
Â 4 Â Â Â Â Â 85.2GB Â 500GB Â Â 415GB Â Â extended
Â 5 Â Â Â Â Â 85.2GB Â 112GB Â Â 26.8GB Â logical
Â 6 Â Â Â Â Â 112GB Â Â 187GB Â Â 75.2GB Â logical Â Â ext4
If you take a look at the partition number 5 then you will see that Linux has no idea about its filesystem. This is because partition #5 does not contain a filesystem on it (as Linux think of it), it contains a full structure of a physical disk (the metadata of the disk, the MBR, the partitions/volumes, the filesystem for each partition/volume, etc). It contains a identical copy of the Win2K3 virtual hard disk as seen by the Win2K3 VM.
That's why it's difficult to shrink a Linux partition that contains a full copy of a Windows hard drive. I've explained here one method (maybe there are more) how to do that.
But what's happening when your Win2K3 virtual disk is in fact a Windows dynamic-disk?
The gparted will not help you right away because it cannot handle the Windows dynamic-disk, only the Windows basic-disk (by disk I mean Windows volume, if you like it). There are some commercial software which might make your life easier but I found also a working solution.
Windows convert dynamic to basic disk
Let's suppose your Windows dynamic-disk has 50G and was stored into your /dev/sdb5 Linux partition. You are using only 15G of it and you've decided that you can go with 20G, so you wish to release the rest of the 30G back to the Linux.
Create another Linux partition (don't bother creating a filesystem) that should be at least 15G as size (because we want to copy all those 15G of the data on it). It could be stored on a external disk, on a USB disk or even in your RAM (if you can :o).
- In Win2K3 VM create another virtual disk an specify its full path as being the newly created partition (let's suppose it is /dev/sdc9).
- Start your Win2K3 guest. Your disk will be detected and activated inside Windows.
- Quick-format it so it'll become ready for use. Let's name this volume as 'F'
- Stop all services and/or programs that are using your dynamic-disk
- Copy all the data (~15G in our example) from the dynamic disk to the newly created volume (volume 'F')
- Delete your old dynamic-disk. Create a new partition on it with size 20G. Quick-format it and make sure you set the same drive letter as it was in the first place! This is now your new Windows basic-disk.
- Copy back all the data from the volume 'F' to the newly Windows basic-disk (see previous step)
- Shutdown your Windows
- Make sure you remove from your Win2K3 VM hardware list the last virtual disk you attached (/dev/sdc9)
- Your Windows partition have now only 20G as size. To shrink the 50G Windows disk to 20G Windows disk follow the steps described here.
So it is possible to convert back a Windows dynamic-disk to basic-disk, in my example it was little bit easier because I have to do all the steps in a pseudo-virtual world, but if you have your Windows installed on a bare metal PC then the steps will still remain the same, except that you should use/have/handle physical disks and not virtual disks (a virtual disks could be stored anywhere, from a partition on a physical disk to a file stored to USB/HDD/RAM/etc).
Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.
Latest posts by Eugen Mihailescu (see all)
- Symfony Compile Error Failed opening required Proxies - January 22, 2018
- Symfony authentication redirect after each request - January 22, 2018
- Emerging Perl without Perl in Gentoo - September 26, 2017