LinuxCommandLibrary

ntfsresize

Resize NTFS partitions

SYNOPSIS

ntfsresize [options] device

PARAMETERS

-b|--bad-sectors
    Check for bad sectors on the partition before resizing.

-c|--check
    Perform a consistency check of the NTFS partition before resizing.

-d|--no-shrink
    Do not attempt to shrink the filesystem, only expand it.

-f|--force
    Force the operation even if potential problems are detected.

-i|--info
    Display information about the NTFS partition without resizing it.

-m|--max-size SIZE
    Specifies the maximum size to resize to. SIZE can be specified in bytes (e.g. 1000000), kilobytes (e.g. 1000k), megabytes (e.g. 1000M), or gigabytes (e.g. 1G).

-n|--no-action
    Perform a dry run without actually modifying the partition.

-o|--offset OFFSET
    Specifies the offset of the partition. Normally offset is detected automaticaly and user should'nt set it manually.

-p|--progress
    Display a progress bar during the resizing process.

-s|--size SIZE
    Specifies the desired size of the partition. SIZE can be specified in bytes (e.g. 1000000), kilobytes (e.g. 1000k), megabytes (e.g. 1000M), or gigabytes (e.g. 1G).

-v|--verbose
    Increase verbosity of the output.

device
    The device node of the NTFS partition (e.g. /dev/sda1).

DESCRIPTION

ntfsresize allows you to resize NTFS partitions without data loss. It analyzes the current size, location, and structure of the NTFS volume and then allows you to either shrink or expand the volume.

It's crucial to back up your data before using ntfsresize, as errors can lead to data loss, though the command is generally considered safe with a healthy filesystem.

The command works by manipulating the NTFS metadata, like the MFT (Master File Table), $Bitmap, and other key system files. It's vital that the underlying storage is reliable and free from hardware errors during the resizing process.

The best practice usage is to run ntfsresize from a live Linux environment to unmount the target ntfs partition.

CAVEATS

Always back up your data before using ntfsresize. Interrupting the process can lead to file system corruption. Ensure the NTFS volume is healthy and free of errors before attempting to resize. Using the '-f' flag is risky and should only be done if you understand the potential consequences.

USAGE EXAMPLES

Get information about /dev/sda1: ntfsresize /dev/sda1
Resize /dev/sda1 to 50GB: ntfsresize -s 50G /dev/sda1
Dry run of resizing /dev/sda1: ntfsresize -n /dev/sda1

HISTORY

ntfsresize was initially developed as part of the ntfsprogs package, a set of utilities for working with NTFS file systems in Linux. Its primary goal was to provide a safe and reliable way to resize NTFS partitions, a task that was previously difficult or required proprietary tools. Over time, it has been refined and improved to handle various NTFS versions and edge cases. It is a crucial tool for dual-boot environments and managing disk space on systems with Windows and Linux.

SEE ALSO

Copied to clipboard