User Tools

Site Tools


home:computing:linux:os_management:disk_management:encryption

[up]

encryption

use Gnome Disc Tool

format partition and select password protection for luks encryption. Then, create mounting script, e.g. /etc/init.d/sdb1:

#!/bin/sh
### BEGIN INIT INFO
# Provides:        sdb1
# Required-Start:    
# Required-Stop:    
# Default-Start:    2 3 4 5
# Default-Stop:        
# Short-Description:    mounts encrypted partition /dev/sdb1
### END INIT INFO
set -e
case "$1" in 
    start)
        cryptsetup open /dev/sdb1 --type luks sdb1 && mount /dev/mapper/sdb1 /private && exit 0
        ;;
    stop)
        umount /private && cryptsetup close sdb1 && exit 0
        ;;
    restart)
        # do nothing
        ;;
    status)
        cryptsetup status sdb1
        mount | grep sdb1
        exit 0
        ;;
    *)
        echo "Usage: $0 {start|stop|status|restart}"
esac
exit 1
home/computing/linux/os_management/disk_management/encryption.txt · Last modified: 16:41 02/02/2025 by acz

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki