ecryptfs-rewrite-file(1)
π ecryptfs-rewrite-file π
okay bestie, welcome to the ecryptfs-rewrite-file(1) page, part of the eCryptfs crew. this one's a little script with a big job: it makes a file get rewritten, which means reencrypted, down in the lower filesystem. no cap. π₯
β¨ NAME β¨
ecryptfs-rewrite-file β force a file to be rewritten (reencrypted) in the lower filesystem π
πΈ SYNOPSIS πΈ
ecryptfs-rewrite-file [file1] [file2] [file3] ...
π¦ DESCRIPTION π¦
so here's the tea π β this script takes one or more files, directories, or symlinks as its arguments, moves every single one of them to a temporary file, and then moves them right back to the original name. and that little round trip is what causes the file to be rewritten (and reencrypted) in the lower filesystem. it's giving glow-up, but for bytes. β¨
you can also pair this script with find(1) and xargs(1) to rewrite a whole entire eCryptfs mountpoint, unmount it, and sync. the iconic trio:
find . -xdev -print0 | xargs -r -0 /usr/bin/ecryptfs-rewrite-file
ecryptfs-umount-private
sync
fr fr, bestie: it is advised that this script gets executed in runlevel 1 or 3, so you can avoid simultaneous writes and race conditions with the files you're targeting. π
β οΈ BIG WARNING, NO CAP β οΈ USING THIS SCRIPT WHILE GNOME, KDE, OR OTHER APPLICATIONS ARE RUNNING MAY CAUSE DATA LOSS. ππ like, actual data loss. close your apps, be safe, protect your files.
π SEE ALSO π
π AUTHOR π
this manpage was written by Dustin Kirkland <kirkland@ubuntu.com> for Ubuntu systems (but it may be used by others, she's generous like that π«Ά). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation. periodt. π
on Debian and Ubuntu systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. π
ecryptfs-utils Β· 2009-03-20 Β· ecryptfs-rewrite-file(1)
and that's the whole page, bestie π₯° stay encrypted, stay slay, and pls pls pls don't run this with your desktop session wide open. mwah! πβ¨π§
π¦ where this page comes from
- alpine 3.24: ecryptfs-utils-doc 111-r19 Β· GPL-2.0-or-later
- arch rolling: ecryptfs-utils 111-9 Β· GPL
- debian bookworm: ecryptfs-utils 111-6 Β· GPL-2.0-or-later
- debian trixie: ecryptfs-utils 111-8 Β· GPL-2.0-or-later
- opensuse-leap 16.0: ecryptfs-utils 111-bp160.1.12 Β· GPL-2.0-only
- opensuse-leap 16.0: ecryptfs-utils 111-bp160.1.12 Β· GPL-2.0-only
- opensuse-leap 16.0: ecryptfs-utils 111-bp160.1.12 Β· GPL-2.0-only
- opensuse-leap 16.0: ecryptfs-utils 111-bp160.1.12 Β· GPL-2.0-only
- ubuntu jammy: ecryptfs-utils 111-5ubuntu1 Β· GPL-2.0-or-later
- ubuntu noble: ecryptfs-utils 111-6ubuntu3 Β· GPL-2.0-or-later
- ubuntu questing: ecryptfs-utils 111-8
- ubuntu resolute: ecryptfs-utils 111-8build2 Β· GPL-2.0-or-later
- ubuntu stonking: ecryptfs-utils 111-8build2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms