≡ Menu

Shell script: Opens LUKS Partition and Sets Up a Mapping [ Mounting Encrypted Partition ]

Linux comes with the cryptsetup command. It is used to setup dm-crypt (transparent disk encryption subsystem in Linux kernel) managed device-mapper mappings. This shell script can be used to mount dm-crypt based partitions with passphrase:

This script is stored on our nas server. All backups are on RAID-6 disks are encrypted. The nas server is online 24×7. After rebooting the server you need to run this script to mount the dm-crypt based partition. A sample session is as follows:
$ ssh vivek@nas112.backup.lan.nixcraft.co.in
$ sudo /usr/local/sbin/mount.crypt

Sample outputs:

Verify disk space and newly mounted partition:
$ df -H
Sample outputs:

{ 1 comment… add one }
  • Dinesh December 14, 2011, 2:15 pm

    Hi folks,

    Any body having goood snmp notes with all it command. I apreciate if anybody provides asap.

Security: Are you a robot or human?

Leave a Comment