I'd like to encrypt a disk in-place, from clear to ecryptfs (not boot disk, just disk with lots of data files).
I've created the following structure:
/mnt/
clear/ # the source files
cipher/ # the ecryptfs ciphertext directory
mounted.clear/ # the mounted ecryptfs directory
I'd like to do something like:
mv /mnt/clear/* /mnt/mounted.clear/
The problem is that since this is a cross-filesystem move, mv will first copy then unlink each argument (see here). I don't have enough free space on this disk to duplicate some of the subdirectories under /mnt/clear.
I wish there was an mv --delete-during argument (or similar), but there isn't (not in GNU coreutils 8.3 anyway :). Any other easy ideas? I could write a quick script to do it, but would rather not if there's an easier solution/utility I can use.
find ... -type f, notd(to ensure there are no files); (2) why not usetar -Cto change directories? – Yaniv Aknin Nov 24 '19 at 07:09-type d, it's! -type d. (2) No reason for you, I guess. Frankly I forgot abouttar -C. – Kamil Maciorowski Nov 24 '19 at 07:24