Large .ecryptfs folder on new computer

I have recently built a brand new computer and decided to install Linux Mint on it and I have recently realized that I only have about 730GB of free space out of the 1TB SSD I installed.

After some investigation, I found a .ecryptfs folder in my home directory that is occupying approximately 150GB of space.

I would like to know what this directory is, why it is taking up so much space on my new computer, and how I can reduce its size.

I have not installed any major programs or files on this computer yet. It is almost brand new.

System info:

  Kernel: 5.15.0-76-generic x86_64 bits: 64 compiler: gcc v: 11.3.0 Desktop: Cinnamon 5.6.8
    tk: GTK 3.24.33 wm: muffin dm: LightDM Distro: Linux Mint 21.1 Vera base: Ubuntu 22.04 jammy
  Local Storage: total: 931.51 GiB used: 370.53 GiB (39.8%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 970 EVO Plus 1TB size: 931.51 GiB
    speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 30.9 C
  ID-1: / size: 915.32 GiB used: 185.26 GiB (20.2%) fs: ext4 dev: /dev/nvme0n1p2
  ID-2: /boot/efi size: 511 MiB used: 6.1 MiB (1.2%) fs: vfat dev: /dev/nvme0n1p1
  ID-1: swap-1 type: file size: 2 GiB used: 0 KiB (0.0%) priority: -2 file: /swapfile

ecryptfsd -V returns

ecryptfsd (ecryptfs-utils) 111
Asked By: Questwalker


.ecryptfs is the directory that stores the on-disk contents of your home directory if you choose home directory encryption with eCryptfs (as opposed to no encryption, or full disk encryption with dm-crypt). Its size is irrelevant for understanding disk usage, except on a multiuser machine if you want to compare disk usage between users.

The files that you see when you’re logged in live in a virtual filesystem and do not directly occupy any disk space. When you access them, the access goes through the ecryptfs driver, and it accesses the on-disk files in the .ecryptfs directory.

du -x ~ and du ~/.ecryptfs will report approximately the same size. (Only approximately, since there’s a small overhead for the encryption of a few bytes per file. That overhead is actually rounded to a whole number of blocks for the underlying filesystem, so it ends up being either 0 or 1 block depending on whether there’s more than a few spare bytes in the file’s last block.)

Note that du ~ or other tools that are not aware of filesystem boundaries will report both the plaintext file (the one you see) and the ciphertext file (the one that’s on the disk). But that’s meaningless: only the ciphertext file actually occupies space on the disk.

If you feel like 150GB of data is too much for your home directory, check what is using space there. If you remove a file in your home directory, that will of course remove the corresponding ciphertext file under .ecryptfs, and thus free the expected amount of disk space.

Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.