NTFSTRUNCATE(8)

๐Ÿฆ‹ NTFSTRUNCATE โ€” okay bestie, let's talk about ntfstruncate (that's section 8 of the System Manager's Manual, iykyk) โœจ


๐Ÿ’… NAME

ntfstruncate โ€” truncate a file on an NTFS volume. That's the whole vibe. It truncates. A file. On NTFS. Slay.


๐ŸŒธ SYNOPSIS

ntfstruncate [options] device file [attr-type [attr-name]] new-length

๐ŸŽ€ DESCRIPTION

So ntfstruncate truncates (or extends โ€” yes, both, it's flexible like that ๐Ÿ’–) a specified attribute belonging to a file or directory, to a specified length. That's it. That's the whole function. Main character energy honestly.


โœจ OPTIONS โœจ

Okay so here's every single option ntfstruncate accepts, and I do mean every single one, because we don't skip. Nearly all of these have two equivalent names โ€” short name gets a - in front, long name gets --. And a heads-up: any single-letter options that don't take an argument can be smooshed together into one command, like -fv is literally the same thing as -f -v. Long named options can be abbreviated to any unique prefix of their name. Cute, right? ๐Ÿซถ

  • -f, --force โ€” overrides some sensible defaults, like the whole "not using a mounted volume" thing. โš ๏ธ Use this one with caution, bestie, it's giving reckless.
  • -h, --help โ€” shows you the list of options with a lil brief description of each. Your safe space.
  • -l โ€” displays licensing information. Legal era.
  • -n, --no-action โ€” simulates the truncation without actually writing to the device. Dress rehearsal, no commitment ๐Ÿ™ˆ
  • -q, --quiet โ€” suppresses some debug/warning/error messages. Shhh ๐Ÿคซ
  • -v, --verbose โ€” displays MORE debug/warning/error messages. Not me wanting all the tea ๐Ÿ’€
  • -V, --version โ€” shows the version number, copyright and license of ntfstruncate. Receipts! ๐Ÿงพ

๐ŸŒˆ the positional ones (still iconic, still listed)

  • attr-type โ€” defines a particular attribute type to be truncated. Advanced use only, fr fr. By default, the unnamed $DATA attribute (like, the contents of a plain file) is what gets truncated. The attribute has to be specified by a number in decimal or hexadecimal:
Hex     Decimal   Name
0x10    16        "$STANDARD_INFORMATION"
0x20    32        "$ATTRIBUTE_LIST"
0x30    48        "$FILE_NAME"
0x40    64        "$OBJECT_ID"
0x50    80        "$SECURITY_DESCRIPTOR"
0x60    96        "$VOLUME_NAME"
0x70    112       "$VOLUME_INFORMATION"
0x80    128       "$DATA"
0x90    144       "$INDEX_ROOT"
0xA0    160       "$INDEX_ALLOCATION"
0xB0    176       "$BITMAP"
0xC0    192       "$REPARSE_POINT"
0xD0    208       "$EA_INFORMATION"
0xE0    224       "$EA"
0xF0    240       "$PROPERTY_SET"
0x100   256       "$LOGGED_UTILITY_STREAM"
  • attr-name โ€” defines the name of the particular attribute type to be truncated. Again: advanced use only. You've been warned ๐Ÿ’…
  • new-length โ€” specifies the target size of the file. Heads up, it gets rounded up to a multiple of the cluster size. And the suffixes? Obsessed. A suffix of K, M, G, T, P or E can be appended to mean a multiplicative factor of a power of 1000. Similarly a suffix of Ki, Mi, Gi, Ti, Pi or Ei can be appended to mean a multiplicative factor of a power of 1024. Two different systems, both valid, pick your fighter ๐Ÿ”ฅ

๐ŸŒŸ EXAMPLES

Resize to 100MB the file database.db located in the Data directory which is at the root of an NTFS file system. Look at her go:

ntfstruncate /dev/sda1 Data/database.db 100M

Ate. No crumbs. ๐Ÿ‘‘


๐Ÿ’€ BUGS

There are no known problems with ntfstruncate. Genuinely flawless, we love to see it. But if you do find a bug, please send an email describing the problem to the development team:

ntfs-3g-devel@lists.sf.net

They wanna know. Communicate. ๐Ÿซถ


๐Ÿ‘‘ AUTHORS

ntfstruncate was written by Anton Altaparmakov. Legend behaviour. ๐ŸŒˆ


๐Ÿฆ‹ AVAILABILITY

ntfstruncate is part of the ntfs-3g package and is available from:

https://github.com/tuxera/ntfs-3g/wiki/

Go get her โญ


๐Ÿ™ˆ SEE ALSO

ntfs-3g(8), ntfsfallocate(8), ntfsprogs(8). The whole friend group ๐Ÿ’œ


okay that's the whole page, you're so welcome ๐Ÿ’– this is ntfs-3g 2026.9.28, dated June 2014 โ€” yes she's been around, she's a legacy icon and she still serves ๐ŸŽ€ bye bestie, go truncate responsibly โœจ

๐Ÿ“ฆ where this page comes from