# Partition maintenance tools: TRIM, defrag, BitLocker

> Run TRIM, defrag, file system scans, BitLocker actions, boot repair, and partition flag changes from Partition Manager in S.A.K. Utility on Windows.

Source: https://sakutility.com/wiki/partition-maintenance-tools
Applies to: S.A.K. Utility (SAK), a free portable Windows toolkit
Updated: 2026-11-15

To maintain a disk with S.A.K. Utility, open the **Partition Manager** tab, press **Scan Disks**, select a disk or partition, and click a tool in the **Partition Operations** list: **TRIM SSD Volume**, **Disk Defrag**, **Check File System**, **Scan File Systems**, or **Manage BitLocker**. Checks run right away and only read. TRIM, defrag, BitLocker changes, and flag changes wait in the queue until you press **Apply**.

## When to use this

- An SSD or hard drive needs routine care.
- You suspect file system errors and want a scan without any repair.
- A BitLocker volume needs unlocking, or protection suspended, before other work.
- A Windows install will not start, and you have attached its disk to a working PC, or the boot files of the Windows you are running need rebuilding.

## What you need

- A partition with a drive letter for most of these tools. **Scan File Systems** and boot repair start from a disk row.
- Administrator approval. Queued tools ask when you press **Apply**. **Check File System** and **Scan File Systems** ask when they start.

## Steps

Queued tools end the same way: press **Apply**, read the **Apply Partition Operations** window, press **Apply** in it, and approve the Windows prompt.

### Check for file system errors

- **Check File System** scans one selected Windows partition with a drive letter.
- **Scan File Systems** scans every lettered volume on the selected disk, and also lists the disk's reliability counters.

Both run at once and repair nothing. When the check ends, a window titled **Partition Manager** says what it found, one line for each volume, such as **Drive E: No errors found.** or **Drive E: Errors found (Windows reports ScanErrorsFoundNeedSpotFix). Repair recommended (this check does not modify the disk).**, where `ScanErrorsFoundNeedSpotFix` stands for Windows' own answer. A volume with errors, or one Windows gave no answer about, makes it a warning. Turn on the **Log** switch for the full report. To check a Mac or Linux partition, see [Read Mac and Linux disks on Windows](https://sakutility.com/wiki/browse-mac-and-linux-disks).

After each volume is checked, S.A.K. waits 15 seconds before it reports the result, and the log says **Letting Windows finish with the volume before reporting the result (a drive removed right after a scan can crash Windows).** Windows can crash if a disk is removed seconds after a check, so leave the drive plugged in until the result appears. After **Check File System** on a USB or other removable drive, the result ends with **Eject the drive in Windows before you unplug it.**

An NTFS drive Windows calls removable, such as most NTFS USB sticks, is checked another way. Windows' online check reads a snapshot of the volume, and Windows cannot take one of a removable drive. So S.A.K. locks the volume, takes it offline, and runs Windows' `chkdsk` in read-only mode, which changes nothing. If anything has the drive open, S.A.K. does not check it, changes nothing, and says **D: is in use, so it was not checked. Close the files and programs using it, then check it again. Nothing was changed.** Otherwise the result is one of three:

- **No problems:** the result says **Drive D: No errors found (read-only chkdsk).**, and the log shows chkdsk's own report.
- **Problems found:** **chkdsk found problems on D: Reading only, it fixed none of them (exit 3).** The number is chkdsk's exit code.
- **Not checked:** the result starts **chkdsk could not check D:**, then gives chkdsk's exit code and its last line.

![A Partition Manager message box reading Drive D: No errors found (read-only chkdsk), then Eject the drive in Windows before you unplug it](https://sakutility.com/screenshots/wiki/partition_manager_check_fs_unplug_note.webp?v=d803795fd7)

*A clean check of a USB stick, with the reminder to eject it*

A fixed drive keeps Windows' online check. If Windows cannot take the snapshot that check reads, the result says **Windows could not take the snapshot it reads D: through, so D: was not checked. Nothing was changed.**

### TRIM an SSD

1. Select a partition with a drive letter on the SSD.
2. Click **TRIM SSD Volume**. It goes straight into the queue.
3. Press **Apply**.

TRIM tells the SSD which blocks no longer hold data. It does not erase your files.

### Defragment a hard drive

1. Select a partition with a drive letter.
2. Click **Disk Defrag**. The window **Disk Defrag and Optimization** shows the media type and what it suggests.
3. Press **Queue Defrag** for a hard drive, or **Queue ReTrim** for an SSD. Only the one that fits is active, and both stay gray if the drive is neither kind.
4. Press **Apply**.

An external USB hard disk that Windows reports as **Unspecified** can be defragmented: S.A.K. reads the drive's own rotation rate, and the check happens at **Apply**, which refuses the defrag if the drive reports none. Without administrator rights the window cannot ask the drive yet, so **Media type** and **Optimization mode** say **Unknown until Apply** and **Queue Defrag** is on.

**Open Windows Optimize Drives** opens the Windows tool instead. **Copy Optimize Commands** copies the matching commands.

![The Disk Defrag and Optimization window for a partition on a USB hard disk, with Media type and Optimization mode reading Unknown until Apply, In-app optimization reading Queue HDD defrag through elevated Apply, and Queue Defrag available](https://sakutility.com/screenshots/wiki/partition_manager_defrag_dialog.webp?v=32c036b15a)

*A USB hard disk Windows cannot name: HDD defrag, checked at Apply*

### Manage BitLocker

1. Select a partition with a drive letter.
2. Click **Manage BitLocker**. Without administrator rights, Windows asks for approval first, so the window can read BitLocker. The window shows **Protection** and **Lock state**.
3. Press the button that applies to the volume. **Queue Unlock** is offered on a locked volume and asks for the **Recovery password:**. **Queue Suspend** is offered while protection is on. **Queue Resume** is offered while protection is suspended, which the window shows as **Protection suspended**.
4. Press **Apply**.

The queue buttons only appear on a BitLocker volume. **Open Windows BitLocker** and **Copy Commands** are always there.

![The Manage BitLocker window with protection and lock state, and buttons to queue unlock, suspend, or resume](https://sakutility.com/screenshots/wiki/partition_manager_bitlocker_dialog.webp?v=75ebcae011)

*BitLocker status and actions*

### Rebuild boot files

This works on the disk you select. Select the disk Windows runs from to repair the Windows you are running. Select any other disk, such as one you pulled from a PC that will not start, to repair the Windows on that disk.

1. Attach the disk if it is from another PC, and press **Scan Disks**.
2. Right-click the **disk** row and choose **Rebuild MBR / Boot Repair**.
3. Read the note, which says which Windows will be repaired. **Boot mode:** starts on **BIOS** for an MBR disk and **UEFI** otherwise. Leave it unless you know better, and press **OK**.
4. Press **Apply**.

![A small window titled Rebuild MBR / Boot Repair with a note naming the disk and a Boot mode list](https://sakutility.com/screenshots/wiki/partition_manager_boot_repair_prompt.webp?v=9f5b555e7d)

*Choose how that disk boots*

### Change partition flags

Each of these asks one question and joins the queue:

- **Hide/Unhide Partition**: **Hide** removes the drive letter and hides the partition from Windows. **Unhide** reverses the hidden setting. Assign a letter again with **Change Drive Letter**.
- **Set Active/Inactive**: sets which MBR partition a legacy BIOS boots from. MBR disks only.
- **Change Partition Type ID**: on an MBR disk, enter one byte in hex. The prompt reads **New MBR type, one byte in hex, such as 07 (NTFS, exFAT) or 83 (Linux); 83, 0x83 and 83h all mean 83:**. On a GPT disk, enter a type GUID. The prompt reads **New GPT type GUID, such as the basic data type:**, with the example `{ebd0a0a2-b9e5-4433-87c0-68b6b72699c7}` on a line of its own, which you can select and copy into the box. The wrong type can stop Windows from reading the partition.

![A small window titled Hide/Unhide Partition with an Action list](https://sakutility.com/screenshots/wiki/partition_manager_hide_prompt.webp?v=bb565ab86e)

*Hide or unhide a partition*

![A small window titled Set Active/Inactive with an Action list](https://sakutility.com/screenshots/wiki/partition_manager_active_prompt.webp?v=d161b95ecf)

*Set the active flag on an MBR partition*

![A small window titled Change Partition Type ID asking for a new GPT type GUID, with the basic data type's GUID on a line of its own above the box](https://sakutility.com/screenshots/wiki/partition_manager_type_id_prompt.webp?v=96ebcf56a7)

*On a GPT disk: a type GUID, with an example to copy*

![A wider window titled Change Partition Type ID asking for a new MBR type, one byte in hex, with examples on one line above the box](https://sakutility.com/screenshots/wiki/partition_manager_type_id_prompt_mbr.webp?v=21aba01eb7)

*On an MBR disk: one byte in hex*

### Other tools in the list

- **Properties** shows full details of the selection, including its partition number, health counters, and what S.A.K. supports on it. **Copy Details** copies them.
- **Explore Partition** opens a lettered partition in Windows File Explorer.
- **Disk Benchmark** switches to the **Benchmark and Diagnostics** tab.
- **Make Bootable Media** switches to the **Image Flasher** tab.

![The Properties window listing disk, partition, file system, and health details](https://sakutility.com/screenshots/wiki/partition_manager_properties.webp?v=046c574192)

*Properties shows everything S.A.K. knows about the selection*

## How it works

- **Check File System** and **Scan File Systems** run Windows' `Repair-Volume -Scan` on NTFS and ReFS, which reports problems and fixes nothing. FAT32 and exFAT, and NTFS on a drive Windows calls removable, get `chkdsk` without `/f`, which only reads. Before that read, S.A.K. locks a removable NTFS volume, so nothing else has it open, and takes it offline. The 15-second wait follows every one of these checks, passed or failed, and also the check at the end of **Disk Defrag** and of the operations that rebuild a partition, such as a move.
- **TRIM** runs `Optimize-Volume -ReTrim`. **Defrag** analyzes, defragments, then scans the volume, and refuses a drive unless Windows reports it as a hard drive, its model name says so, or Windows reports it as **Unspecified** and the drive itself reports a rotation rate, as a USB hard disk behind its adapter can. It always refuses SSD and NVMe.
- **BitLocker** actions use Windows' own commands. The recovery password is passed through a temporary file that is overwritten and removed afterwards.
- **Boot repair** runs Microsoft's `bcdboot`. BIOS mode also runs `bootsect`. On a disk other than the one Windows runs from, S.A.K. gives each volume with a file system a temporary drive letter to find the one holding Windows, rebuilds the boot files on that disk's EFI System Partition or active partition, sets that Windows' list of drive letters to match the disk as it is now, and takes the letters away again. The old boot store is kept beside the new one as `BCD.sak-old`.

## Good to know

> **Back up first.** Copy anything you care about to another drive before you press **Apply**. On the v0.9.3 code, Partition Manager operations, including boot repair, MBR-to-GPT conversion and OS migration, ran through the app on disposable virtual machines and virtual disks. Some operations were also tested on one SAMSUNG MZVL2512HCJQ-00BH1 512 GB NVMe SSD and one Seagate Expansion Desk 8 TB USB disk. Internal SATA drives were not tested, and results on other devices may differ. See [what was tested](https://sakutility.com/wiki/partition-manager-basics#what-was-tested).

- **Long jobs run as long as they need.** Defrag on a large, badly fragmented drive can take many hours. **Cancel** ends it.
- **To fix a PC that will not start,** attach its disk to a working Windows PC and repair it there. This PC's own boot order is left alone, so the next restart still starts this PC's Windows. On a Windows too old for `bcdboot` to have that option, a new entry goes last in the boot order instead.
- **It repairs one Windows at a time.** A disk with two Windows installs, or none S.A.K. can read, is refused, and it says which. If the volume is encrypted with BitLocker, unlock it first.
- **UEFI needs a GPT disk with an EFI System Partition, and BIOS an MBR disk.** It says so if the disk is otherwise. If an MBR disk has no active partition, S.A.K. makes its System Reserved partition active, or the Windows partition if there is none, and tells you which.
- **The disk Windows runs from gets the older kind of repair.** It rebuilds the boot files of the Windows you are using now. BIOS mode needs an active partition on that disk, and says so if there is none.
- **Boot repair picks its own drive letter.** It uses S: if that is free, or another free letter if not, and takes it away again.
- **Flag changes are refused on the disk Windows is running from**, and on system, boot, EFI, MSR, and recovery partitions. A message then says why.
- **Hide can be confusing later.** A hidden partition has no drive letter, so Explorer stops showing it. Keep a note of what you hid.
- **Suspended BitLocker is not protection.** Your data stays unprotected until you resume it. See also [Back up BitLocker keys](https://sakutility.com/wiki/back-up-bitlocker-keys).
- **These checks look at the file system, not the disk surface.** For drive health, see [Check a drive's health](https://sakutility.com/wiki/check-drive-health).

## Related guides

- [Check a drive's health](https://sakutility.com/wiki/check-drive-health)
- [Back up BitLocker keys](https://sakutility.com/wiki/back-up-bitlocker-keys)
- [Convert a dynamic disk, file system, or cluster size](https://sakutility.com/wiki/convert-dynamic-disk-and-cluster-size)
- [Partition Manager basics](https://sakutility.com/wiki/partition-manager-basics)
