You are not logged in.

#1 2022-07-26 01:12:59

LowkeyUndergrounder
Member
Registered: 2022-07-08
Posts: 40

[SOLVED]Encrypt drive through LUKS without reformatting?

Greetings, it would have been nice to know if it is possible to actually use LUKS (or possibly any alternative) to easily encrypt already-used spaces on any disk, thanks.


Original post-name "Is it possible to encrypt drive through LUKS without reformatting?"

Last edited by LowkeyUndergrounder (2022-10-17 19:11:56)

Offline

#2 2022-07-26 02:16:52

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: [SOLVED]Encrypt drive through LUKS without reformatting?

No. LUKS (and any encryption layer) operates by creating a container for the encrypted contents (sometimes covering a full partition, sometimes serving as a nested filesystem, etc.). So, there's no way to in-place encrypt a file unless its filetype natively supports some form of encryption (this is particularly true for LUKS which is most typically used covering a full partition rather than sitting underneath a filesystem).

You'll need to create a partition that you setup for LUKS encryption, and copy files into it. You could either do this via RAM (and a tmpfs), or another disk.

All the best,

-HG

Offline

#3 2022-07-26 06:50:26

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 714

Re: [SOLVED]Encrypt drive through LUKS without reformatting?

It's possible if the file system can be shrunk. See dm-crypt/Device encryption#Encrypt an existing unencrypted file system.

Offline

#4 2022-07-26 12:58:01

LowkeyUndergrounder
Member
Registered: 2022-07-08
Posts: 40

Re: [SOLVED]Encrypt drive through LUKS without reformatting?

HalosGhost wrote:

No. LUKS (and any encryption layer) operates by creating a container for the encrypted contents (sometimes covering a full partition, sometimes serving as a nested filesystem, etc.). So, there's no way to in-place encrypt a file unless its filetype natively supports some form of encryption (this is particularly true for LUKS which is most typically used covering a full partition rather than sitting underneath a filesystem).

You'll need to create a partition that you setup for LUKS encryption, and copy files into it. You could either do this via RAM (and a tmpfs), or another disk.

All the best,

-HG


Ahh damn, gotta change the disks the files are on a few times, thanks for the answer mate!

Offline

Board footer

Powered by FluxBB