Skip to content

Instantly share code, notes, and snippets.

@the-bokya
Last active December 10, 2025 16:36
Show Gist options
  • Select an option

  • Save the-bokya/7fdf4b4d244cfa4634302f625f967f15 to your computer and use it in GitHub Desktop.

Select an option

Save the-bokya/7fdf4b4d244cfa4634302f625f967f15 to your computer and use it in GitHub Desktop.
Private, encrypted disk volumes for general purpose usage
# set it up first using
# dd if=/dev/zero of=personal-stuff bs=1G count=1
#
# # you'll need to enter a password here
# cryptsetup luksFormat mg
#!/bin/bash
cryptsetup open /home/qwerty/personal-stuff personal-stuff
umount /mnt/personal-stuff/ &> /dev/null
rmdir /mnt/personal-stuff/ &> /dev/null
mkdir /mnt/personal-stuff/
mount /dev/mapper/personal-stuff /mnt/personal-stuff/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment