Skip to content

Instantly share code, notes, and snippets.

View wenhuizhang's full-sized avatar
🎯
Focusing

Wenhui Zhang wenhuizhang

🎯
Focusing
View GitHub Profile
@wenhuizhang
wenhuizhang / encrypt.sh
Created September 3, 2023 01:03 — forked from krzys-h/encrypt.sh
Encrypt existing partitions with LUKS2 on Ubuntu 20.04
#!/bin/bash
# Encrypt an existing partition with LUKS2 on Ubuntu 20.04 LTS
# DISCLAIMER: USE AT YOUR OWN RISK AND MAKE BACKUPS
# Made for my personal use and has almost NO error checking!!
# Based on instructions from:
# https://wiki.archlinux.org/index.php/dm-crypt/Device_encryption#Encrypt_an_existing_unencrypted_filesystem
DISK="$1"