2

How to enable compression as mount option in /etc/fstab for ntfs-3g formatted disk under Linux? The following does not seem to work?

/dev/disk/by-uuid/01557072080D093D              /media/Sun_01           ntfs-3g         defaults,compression    0       0

1 Answers1

1

According to the mount.ntfs-3g(8) manual page:

This option enables creating new transparently compressed files in directories marked for compression. A directory is marked for compression by setting the bit 11 (value 0x00000800) in its Windows attribute. In such a directory, new files are created compressed and new subdirectories are themselves marked for compression. The option and the flag have no effect on existing files.

The compression option merely enables support for compression. You will still have to mark the individual directories as compressed in order for this to have any effect.

Even without this filesystem option, existing compressed files can still be read and modified.

forest
  • 2,655
  • Does that mean I can mark the parent path enabled for compression? Say /media/test. Then every folder and file under /media/test would be compressed? How does one set that 'bit' from the linux CLI? Or can it be part of the umask in a samba share definition? – Schorschi May 23 '21 at 06:17
  • @Schorschi Yes, you can mark the parent directory and entries within it will be compressed when they are created. I don't know how to do that though, just how to enable compression via the mount option. – forest May 23 '21 at 22:05