5

I have Ubuntu 16.04 and want to switch to 18.04 with a fresh install. I also have Windows 10 installed and want to shrink the Win 10 system partition for reinstallation of Ubuntu.

There appear two ways to do so:

  1. Shrink the Win 10 partition from inside Windows and then use the unallocated space for a new/enlarged Ubuntu partition
  2. Shrink the Win 10 partition with GParted during installation of Ubuntu.

Which is the safer way to do so? I should add that there is a Windows recovery partition between the Win system partition and the Ubuntu partition. Can I safely move that one with GParted?

1
  • First shrink C drive in Windnws, then add the space to the recovery drive using Easeus partition master(may require restart). Then shrink the recovery drive. Boot into Ubuntu, add the unallocated space to Ubuntu system drive using GParted. Then install new Ubuntu. May 1, 2018 at 10:47

3 Answers 3

5

The safest way is to use Windows 10 to shrink it's own partition.

Windows 10 knows more about the last used area of the disk partition. Ubuntu / gparted cannot shrink the partition reliably as Windows 10 can.

For example last weekend I wanted to clone 16.04 and do a test run upgrade to 18.04. My Windows partition was 411 GB with only 100 GB used. Windows 10 would only shrink by a maximum of 25 GB because it saw used files near the end of the partition. If any more was needed Windows 10 would have to defragment the disk.

2
  • Source on the reliability claim? ntfsresize (the program used by gparted) will relocate any data at the end of the partition to make way for the resize: linux.die.net/man/8/ntfsresize - From the man page: "No reliability problem is known." Jun 28, 2020 at 13:34
  • 1
    @SurpriseDog The link states: "The ntfsresize program safely resizes Windows XP, Windows Server 2003, Windows 2000, Windows NT4 and Longhorn NTFS filesystems without data loss." No mention of Windows 2008, 2012 or Windows 10 which most people run today. You could try it without defragging your Windows 10 and having data at the end of the partition. Then if it is successful you can post your own answer. Jun 28, 2020 at 13:37
3

Just in case anyone finds this in 2020 like I did, this is my experience.

I had Windows 10 installed on the left half of a new 1TB SSD and just a plain old ext4 filesystem (no OS) on the right half. Very new Windows 10 installation and very ample room.

I tried using the Windows Disk Management to shrink my partition, but as many other folks will agree, it said it would only shrink it by up to 2GB or so. I ran the graphical and the command-line defrag, but that number didn't change.

Then I booted from a Ubuntu 20.04 live USB and used GParted to delete my ext4 partition, shrink the C: partition, then move the Windows Recovery partition to the left to fill in the space. The last step gives a scary warning, which you can just click through. I ended up booting Windows in between each step just to be safe, and there was not a single hiccup the whole way through.

I was very pleased to see that Windows 10 seems to have matured and doesn't throw a fit when things change.
Bottom line: GParted works perfectly with Windows 10.

1
  • Agree in 2022! First, using a dual boot HD with Ubuntu 22.04 + Win 10 that I upgraded by cloning the orig small HD onto a larger HD. Then, like this answer, I worked on the new HD and opened GParted that 1) offered to auto expand/repair the cloned partitions 2) Then, working last to first (to keep the order), I moved the recovery partitions (Dell+Win+Util) plus Ubuntu, to the end of the HD 3) Finally expanded Win NTFS 4) Apply! Easy as pie!! Note: I did this using external USB adapters for the NVMe drives (on a separate laptop with Ubuntu 20.04). Oct 29, 2022 at 23:17
1

tl;dr

ntfsresize & gparted (which uses ntfsresize) should work perfectly fine for resizing ntfs filesystems but if you have access to Windows, that should work well too.

To address the answer stating that Windows is often unable to defrag + resize partitions - This is true, but usually only applies if you're trying to resize the system (C:) drive while also running Windows from it.

There are ways to mitigate this, too.

Justification

Reliability of ntfsresize

As WinEunuuchs2Unix has discussed - The conventional wisdom is that the "safest" way to resize an NTFS partition is to do so from Windows.

The justification presented in the comments of WinEunuuchs2Unix's answer states that, though the unix-based ntfsresize tool's man-page states

No reliability problem is known.

Which is a positive indication-

However, when ntfsresize describes the Windows systems it applies to, the list is outdated & makes no mention of Windows 10.

The ntfsresize program safely resizes Windows XP, Windows Server 2003, Windows 2000, Windows NT4 and Longhorn NTFS filesystems without data loss. All NTFS versions are supported, used by 32-bit and 64-bit Windows.

This may be taken to suggest that tool is not safe to use on ntfs partitions that are administered by Windows 10, however in reality this should not be a problem.

The ntfs standard has not changed since NTFS 3.1 (AKA NTFS 5.1), released alongside Windows XP in 2001.

Given that the tools within the ntfs-3g suite support rw access to ntfs filesystems, the claim that "Windows 10 knows more about the last used area of the disk partition." does not apply, particularly in my instance, where the partition I'm resizing was mounted and written to from ubuntu.

Fix Windows partition management not shrinking by the whole free space

The reason this happens, is that Windows maintains state using a few large files, which can't be moved or defragged while the system has a lock on them.

The usual suspects are hyberfil.sys, and pagefile.sys.

If some part of the files are stored near the edge of the partition, they will block resizing beyond that point.

They can be temporarily disabled, which will allow you to properly resize your windows partition (Though in the case of pagefile.sys, you will want to re-enable it ASAP).

Here's a post explaining what they do & how to move/temporarily disable them

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.