Windows, end to end: NTFS, grow, shrink, compress
NTFS is the filesystem you meet on every Windows machine, and it’s the counter-example to ext4 and XFS: it grows and shrinks online, compresses per file, and has its own scanner. The videos were recorded on Windows Server 2025 (Server Core) over OpenSSH, with the same terminal, theme and keysound as the rest; this page explains why the commands work.
The model has three views, and PowerShell names them directly:
disk Get-Disk
└── partition Get-Partition
└── volume Get-Volume
Create it
On a blank 2 GB disk (disk 1):
Get-Disk
Initialize-Disk 1 -PartitionStyle GPT
New-Partition 1 -Size 1GB -DriveLetter F
Format-Volume F -FileSystem NTFS -NewFileSystemLabel data -Force
Initialize-Disk writes the partition table and creates the MSR (16 MB);
New-Partition creates the data partition, and Format-Volume writes NTFS.
Then the usual proof:
Set-Content -Path F:\hello.txt -Value 'hello from ntfs'
Get-Content F:\hello.txt
Get-Partition 1 | Format-Table PartitionNumber,DriveLetter,Type,Size
Grow it
NTFS grows online, and the size comes from the partition, so ask Windows what the maximum is instead of guessing:
$max = (Get-PartitionSupportedSize -DriveLetter F).SizeMax
Resize-Partition -DriveLetter F -Size $max
On the 2 GB disk that takes the 1 GB volume to 1.98 GB, mounted, with the file still readable. The remaining ~20 MB is the MSR partition (16 MB) plus GPT metadata and alignment.
Shrink it
This is where NTFS differs most from the Linux filesystems. The same cmdlet, the other way:
(Get-PartitionSupportedSize -DriveLetter F).SizeMin # how far it can shrink
Resize-Partition -DriveLetter F -Size 1GB
NTFS shrinks online, while mounted. Two caveats:
- Windows moves movable files itself; the limit is the last unmovable one
(parts of the MFT, the pagefile, VSS areas).
SizeMinshows that limit, just asSizeMaxdid for growing. - It is still a good idea to have a backup before resizing a real volume.
NTFS, Btrfs and APFS shrink online; ext4 shrinks offline; XFS can’t, and ZFS
only via zpool remove.
Compress it
NTFS compresses per file or folder (new files inherit the folder’s setting), while the volume stays mounted. A volume can default to compression, but it is still applied file by file. Write ~20 MB of repeated text, then compress it:
1..90000 | ForEach-Object { 'hello ntfs ' * 20 } | Set-Content F:\text.txt
(Get-Item F:\text.txt).Length
compact /c F:\text.txt
compact /q F:\text.txt
(Get-Item F:\text.txt).Attributes
In the lab: 19,980,000 bytes stored in 2,498,560 bytes — 8.0 to 1 — and the
attributes report Archive, Compressed. The free space goes back up by roughly
the difference: compact /c rewrites the file compressed, and in a compressed
folder new files are compressed as they are written.
compact /q is the query; compact /c the compression; compact /u undoes it.
For a whole directory, compact /c /s:F:\folder. The trade-off is the same as
everywhere: CPU on read and write for space.
Check it
NTFS has an online scanner and the classic chkdsk:
Repair-Volume -DriveLetter F -Scan
chkdsk F:
Repair-Volume -DriveLetter F -OfflineScanAndFix
Repair-Volume -Scanruns online and returnsNoErrorsFoundon a healthy volume.chkdsk F:prints the phase report and the summary — the readable proof (online, read-only by default).-OfflineScanAndFixtakes the volume offline for the scan (briefly, here).
Repair-Volume is the modern cmdlet; chkdsk /f is still the tool for a volume
that will not mount.
NTFS or ReFS?
ReFS is the newer Windows filesystem, built for integrity streams and large volumes (Hyper-V, backup targets). It is not a drop-in replacement for NTFS:
- no boot volume, no per-file compression, no shrink (Server 2025 adds volume-level deduplication and compression for ReFS);
- integrity streams and block cloning are the upside;
- NTFS remains the default for the system volume and general use.
For a homelab Windows VM, NTFS is the right default; ReFS is a choice for data volumes where integrity matters more than flexibility.
What to remember
- Three views of one stack:
Get-Disk,Get-Partition,Get-Volume. Resize-Partitiongrows and shrinks online — plan for that.- Compression is per file or folder (
compact), inherited by new files; a volume can default to it, but it is applied file by file. Repair-Volume -Scanandchkdskare online;-OfflineScanAndFixorchkdsk /fare offline.- The same operations you learned on the other filesystems in the series; only the verbs change.
Part of Filesystems, end to end.