* Re: [dm-crypt] Can LUKS be used on a tmpfs?
2015-12-23 19:05 ` [dm-crypt] Can LUKS be used on a tmpfs? H McCurdy
@ 2015-12-23 19:32 ` Michael Kjörling
2015-12-23 19:36 ` Sven Eschenberg
2015-12-23 19:39 ` Milan Broz
2 siblings, 0 replies; 4+ messages in thread
From: Michael Kjörling @ 2015-12-23 19:32 UTC (permalink / raw)
To: dm-crypt
On 23 Dec 2015 19:05 +0000, from hmccurdy@yahoo.com (H McCurdy):
> Is it possible to get crypt_init() to use a tmpfs instead of a block
> device or a file?
Not sure exactly what you are looking to do, but you can't put a tmpfs
on any storage-backed device. You could however create a temporary
(likely sparse) file, store that file in a tmpfs, and create a LUKS
container within that file, with a normal file system inside the
container which you can use to store data.
Would be quite a lot of overhead, though. And you need to be root to
mount a tmpfs in the first place, unless you set it up in fstab with a
"user" directive, which would sort of defeat the point.
Isn't it easier to just set appropriate permissions on a tmpfs (or
even ramfs, which would prevent ever writing the data to disk)? You'd
get pretty much the same results, minus virtually all the overhead...
--
Michael Kjörling • https://michael.kjorling.se • michael@kjorling.se
“People who think they know everything really annoy
those of us who know we don’t.” (Bjarne Stroustrup)
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [dm-crypt] Can LUKS be used on a tmpfs?
2015-12-23 19:05 ` [dm-crypt] Can LUKS be used on a tmpfs? H McCurdy
2015-12-23 19:32 ` Michael Kjörling
@ 2015-12-23 19:36 ` Sven Eschenberg
2015-12-23 19:39 ` Milan Broz
2 siblings, 0 replies; 4+ messages in thread
From: Sven Eschenberg @ 2015-12-23 19:36 UTC (permalink / raw)
To: dm-crypt
Simply short: No.
tmpfs is, as the name suggests, a filesystem, which lives in the VFS
domain, whereas dmcrypt lives in the block layer.
So yes, ramdisks in the form of blockdevices will work. It might even
possibly work on a file within the tmpfs. (Give is a try [there's still
loopback devices..], afterall it's all volatile memory and fiddling
around does not need any extra work)
Regards
-Sven
Am 23.12.2015 um 20:05 schrieb H McCurdy:
> Hi,
>
> Is it possible to get crypt_init() to use a tmpfs instead of a block
> device or a file?
>
> I realize there are sanity issues related to such an inquiry because the
> key is in RAM and so is the "disk." Regardless, I have the question.
>
> BTW, an older ramdisk (/dev/ram0) does appear to work.
>
> Hugh
>
>
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dm-crypt] Can LUKS be used on a tmpfs?
2015-12-23 19:05 ` [dm-crypt] Can LUKS be used on a tmpfs? H McCurdy
2015-12-23 19:32 ` Michael Kjörling
2015-12-23 19:36 ` Sven Eschenberg
@ 2015-12-23 19:39 ` Milan Broz
2 siblings, 0 replies; 4+ messages in thread
From: Milan Broz @ 2015-12-23 19:39 UTC (permalink / raw)
To: H McCurdy, dm-crypt@saout.de
On 12/23/2015 08:05 PM, H McCurdy wrote:
> Hi,
>
> Is it possible to get crypt_init() to use a tmpfs instead of a block
> device or a file?
No, dm-crypt works only over block devices (/dev/ram* are block devices as well).
You can create a file on tmpfs and use that through loopback though
(but this adds another layer there).
Milan
^ permalink raw reply [flat|nested] 4+ messages in thread