Expand C partition on server

timeshifter

Well-Known Member
Reaction score
2,171
Location
USA
The server at one of my top clients ran out of space on drive C today. I've done what I quickly can to free up space and get things moving. But I need to go deeper and / or make more space. Unfortunately the C volume is only 60GB, Windows Server 2016. Has not been a problem until today.

We have a RAID10 array of SSDs making a 1.2TB volume.

resizec.png


I'm barely using any of the space on the 1TB partition. Have 86GB free on the end.

I'm thinking I can shrink the 1TB partition, but it needs to move over. Seem to recall doing something similar in the past and it not working.

Any suggestions?
 
Personally I would move the data partition to another physical drive -- I prefer to use multiple drives where possible for improved performance, simplified backup drive imaging, and stuff like this -- It's a lot simpler to expand partitions and upgrade storage when everything is using separate drives/volumes.

But if it has to stay like this ...

Looks like the data partition is only about 7% used, so I would just back that up (in fact, I'd backup the other partitions too since they're all on the same drive), remove it, expand C: drive then recreate the data drive. If you're planning to do this while the system is running, remember to stop any applications or services that are using D drive first.
 
I'm with Moltuae.....break it up.
I make a virtual disk for the OS ...and another virtual disk (or more) for the data volumes. But I try to avoid having them be partitions on the same disk.

Keeping things individual virtual disks allows quick expansion if necessary.

For OS volumes, I've been doing 128 gigs for quite a while. Can't stand it when OS volumes fill up.
 
Didn't mention that the server is a Hyper-V VM. Here is the Disk Management of it's Hyper-V host:

resizechost.png
 
Even easier in that case ... Create a new Data VHDx. Clone the existing data partition (or just copy the data) to the the new VHDx. Change the drive letters over (inside the VM). Remove old partition and expand the data. Back everything up first of course.
 
Looks like my drive volumes in the VM have multiple checkpoints. Also have virtual drives for a couple of VMs that are no longer needed.

I think my best bet is to shut down the machine. Boot the VM from Macrium and make images of the C and D volumes of that VM. Then restore those to new, bigger virtual volumes.

That increases the size of C and cleans up all the checkpoints.

Good idea?
 
That should work.

If you have Reflect installed on the host, you can also shut down the VM, mount the VHDs and use Reflect to clone/resize the partitions that way.
 
Expanding the size of virtual disks is wicked easy in Hyper-V. Shut down the guest, and "edit" the disks in hyper-v mangler....make 'em bigger. Power up the OS..and right in disk manglement (diskmgmt.msc).....right click...resize. For additional data volumes it can happen hot..within the blink of an eye. But for the system volume...sometimes the pagefile.sys creates an issue and prevents you from claiming much...sometimes just a little. You can disable pagefile on the system drive, reboot, and then do it..and then re-enable. Those steps often a bit quicker than imaging, nuking, restoring to new larger drives.
 
Power up the OS..and right in disk manglement (diskmgmt.msc).....right click...resize. For additional data volumes it can happen hot..within the blink of an eye.
That's what I'm talking about in the original post, I think. Same problem will result I'm afraid as the boundary for the D partition will block the C partition from expanding. The volume is already big enough, there's an additional 80GB unallocated at the end.
 
Ah yeah that's right..and funny thing is I understood that in the original post. Too many shiny lights today. Contiguous partition.

I do recall some 3rd party tools that can work around that, but expensive "server versions"...much cheaper to go with the backup/create multiple smaller VHDXs/restore plan.
 
What backup do you have in place? Because if it's image based, I'd just restore the D volume into a new VHDX, delete the D volume on the VM, expand C to at least 80gb... then power down the VM and attach the new VHDX as D.

Everything should just start working again, though it might take another reboot, especially if there are SQL DBs on that D volume.

If you don't have image based backup software... shut down the VM, mount the VHDX on the host, use disk2vhd from Microsoft's systernals page to push the D partition off into a dedicated VHDX. Mount that to confirm it all looks good, demount both on the host. Boot the VM, delete the D partition, grow C to the size you want leaving excess partitioned space as blank if you need to control growth, then attach the new VHDX as a D drive. One last reboot and you're back online.

Then sell them an image based backup solution so you can join us in 2020.
 
I've had them on Datto for the last couple of years. Didn't realize I was so behind the times.

I said, if you don't have an image based backup solution. If you've got Datto then just restore that D volume... it's going to make a dedicated file for it anyway. Then you can delete the D off the other drive, and grow C. Attach the new vmdx and move on.

You'll have to rebase the D image... but that's not a big deal if you have enough space on the Datto.
 
It's crunch time!

Been putting this off as long as I can. Tonight's the night. Biggest challenge is time. This place operates 24/7. Things slow down after about 2:00 AM and pick up again around 6:00 AM. But even being down during those hours, even for 15 minutes and people get antsy. So there's a lot of pressure to work as quickly as possible.

Here's the rough draft for my gameplan:
1) Kick everyone out of the LOB app, etc.
2) Push a new backup snapshot to the Datto
3) Shut down the VM
4) Make a local copy of the VHDx file in Windows Explorer in the Hyper-V Host environment (extra backup)
5) Create two new VHDx files, one for the C drive of 128Gb and another for the D drive of 1TB.
6) Attach those new disks to the VM
7) Boot the VM from a Macrium ISO
8) Clone old C to new C, old D to new D
9) Shutdown
10) Edit VM to remove old VHDx file and keep the two new ones
11) Boot VM again and hope it all works

I feel like this will all work, but I'm a little concerned about 10 and 11. Not sure who I have to tell that the new C VHDx is the new boot drive and the new D VHDx is the data drive.
 
Sounds like it should work to me and you've got the most important part well covered (backups). In the VM settings under Firmware you can choose the boot order to make sure it's using the correct disk. Although 99% of the time it will just work anyway without having to change anything.

Less than 150GB cloning direct from SSD to SSD should be fairly rapid so hopefully downtime is short for you.
 
I'm not sure why you insist on making this difficult. Use Datto to restore D, it'll make a brand new VHDX for you. You can then mount it to the VM, ensure the data is present, then delete the old D, the expanded partition it's in, and grow C. Heck... all of that can be done without even restarting the guest!

You have the Datto! USE IT!
 
I’m open to using the Datto, I’m just less familiar with it. Have done hundreds of Macrium clones and never restored a Datto.

I’m also a little leery about expanding the C drive. It’s volume is huge, more space than I need, although on the VM it’s dynamic I think so that wouldn’t matter. But, I think it’s got a bunch of checkpoints that make up the disk.

May be better off restoring new C and D volumes from Datto, just haven’t done it that way before and wondering if the the speed would be too slow across network vs all internal on SSDs
 
It'll take longer to restore that larger volume. The C drive expansion can be whatever you want it to be! Just set the partition size and move on, the empty space won't be used. You can shrink the volume later!

Also, if you're unfamiliar about how to dump the D drive with the Datto... CALL THEM! Make THEM DO IT! That's why you Datto!

If you're worried about uptime... you said that D was tiny, so restoring it shouldn't take long. All the other work you're doing? Might break the VM, and then necessitate a full restore. Which yes will solve the problem but that eats even more time, not to mention fear / frustration.
 
I've done this hundreds of times. I just use Easeus Partition Manager.

Move data over to the right putting that 85gb in front then expand

It's cake
 
Back
Top