[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Two questions about LUKS in a file container



On Sat, 12 Sep 2020 12:10:48 -0400
rhkramer@gmail.com wrote:

> I'm thinking about putting my backup encrypted files in a LUKS
> filesystem within a file instead of on a dedicated partition (for a
> few reasons).

Why do you want a file system inside a file? The only reason I can
think of to do that is to emulate the file system of another computer,
e.g. a virtual machine. But in that case, I wonder why you want to feed
your backups to a VM.

> 
> I have two questions about that:
> 
>    * if I don't have that LUKS filesystem "mounted" and open and I
> write to it, I assume (or hope) that nothing will get written and I
> will get a warning or error message of some sort?

It depends.

If you are create a new file to write to, and it would be in the root
director of the partition (e.g. /mnt/foo), then Linux will cheerfully
create the file and write to it in the mount point directory, on that
file system.

If you try to open an existing file, it will fail.

Otherwise, you will get an error because the directory structure won't
be there.

Whether you get an error message or not depends on which program you
use.

> 
>    * doesn't exactly apply to this situation, but, on the other hand,
> if my "source" / original / non-backup LUKS system is in a file
> instead of on a dedicated partition, and I use commands (like rsync
> or such) to copy the unencrypted files not on the LUKS system, but I
> use options like the ones to stay on the current filesystem
> (--one-file-system), I assume (or hope) that the stuff in the
> encrypted partition will not get copied?

Huh?

Figure out which program you are going to use, and read the man page.



You appear to specialize in coming up with oddball solutions to
problems and then asking us how to implement your solution.

Instead, how about describing your problem and asking how we would
suggest you solve it? Plenty of us have already dealt with the sorts of
problems you seem to have, and solved them.

As far as getting backups onto encrypted partitions, say for off-site
storage, goes: I have a solution that works for me. Start with
http://charlescurley.com/blog/posts/2019/Nov/02/backups-on-linux/


-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/


Reply to: