google / google/fscrypt

Getting "encryption not enabled" on an ext4 filesystem

Open
#436 5 comments 1 reaction 0 assignees View on GitHub
needs reporter feedback
Dominant language
Go
Stars
1k
Forks
111
Avg merge
2d 19h
Merged PRs (30d)
3

Description

I keep getting this error when trying to encrypt a directory:
```
"fscrypt encrypt /var/opencloud/test_fscrypt/
[ERROR] fscrypt encrypt: encryption not enabled on filesystem /var/opencloud (/dev/sdc1).
To enable encryption support on this filesystem, run:
sudo tune2fs -O encrypt "/dev/sdc1"
Also ensure that your kernel has CONFIG_FS_ENCRYPTION=y. See the documentation for more details."
```

The kernel configuration contains the encryption enablement:
```
grep FS_ENCRYPTION /boot/config-$(uname -r)
CONFIG_FS_ENCRYPTION=y
CONFIG_FS_ENCRYPTION_ALGS=m
```
Also the 'encrypt' feature flag appears:
```
sudo tune2fs -l /dev/sdc1 | grep 'Filesystem features'
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg encrypt sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
```
I've tried unmounting and remounting the filesystem, rebooting, running 'tune2fs -O encrypt /dev/device', but nothing seems to work.
I mention that the machine is running on Linux 9.7, kernel version is 5.14.0-570.37.1.el9_6.x86_64.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.