Did you know can easily mount a filesystem that will store any data exclusively in RAM? Sometimes, you don't want to store data on your disk, such as keyfiles, notes, documents, media content, and other data. There's no need to launch a live distro just for the sake of storing data in memory, when you can just mount a tmpfs or ramfs filesystem.
It's simple:
sudo mount -t ramfs --mkdir <mount_point>
sudo mount -t tmpfs --mkdir -o <mount_point>
For example:
sudo mount -t ramfs --mkdir myramvol /mnt/ram
Now, any data stored in /mnt/ram will be stored in memory.
If your CPU does not support memory encryption, you can still encrypt the data by creating a LUKS volume within the /mnt/ram directory.
sudo fallocate -l 1G /mnt/ram/crypto
sudo cryptsetup luksFormat --type luks2 /mnt/ram/crypto
sudo cryptsetup open /mnt/ram/crypto ramcrypto
sudo mkfs.ext4 /dev/mapper/ramcrypto
sudo mount /dev/mapper/ramcrypto /mnt/encrypted_ram
You can use a generated password, since the encrypted volume is going to get wiped when you shut down anyway. Point is, you now have an encrypted LUKS volume stored in memory and you can rest safely the data is kept only temporarily and is encrypted just in case.
Even better, create a quick shell script and bind it all to a simple command. Another idea is to overlay mount it to ~/Downloads. All downloads are now stored in memory.
