CONTENT
  • CHANGES
Szukaj
counter

#top cryptsetup


cryptsetup - setup cryptographic volumes for dm-crypt (including LUKS extension)

Powiązane:

SYNOPSIS
cryptsetup <options> <action> <action args>

DESCRIPTION



ACTIONS
create <name> <device>
creates a mapping with <name> backed by device <device>. <options> can be [--hash, --cipher, --verify-passphrase, --key-file, --key-size, --offset, --skip, --readonly]

remove <name>
removes an existing mapping <name>. No options.

status <name>
reports the status for the mapping <name>. No options.

reload <name>
modifies an active mapping <name>. Same options as for create.

resize <name>
resizes an active mapping <name>. <options> must include --size



EXAMPLES
cryptsetup create DEVMAPP /dev/DEVMAPP
fsck -Cp /dev/mapper/DEVMAPP

cryptsetup create sda2 /dev/sda2
fsck -Cp /dev/mapper/sda2

Contents of shell script /root/bin/mntdev.sh:
#!/bin/sh

SELF=`basename $0`

case "$1" in
-*es2)
DEVMAPP=sda2
;;
esac

case "$1" in

-mes2)
	# mount/bind mapper
	#DEVMAPP=$2
	if [ -z $DEVMAPP ];then
		echo "$SELF $1 mapper"
		exit
	fi
	echo "cryptsetup create $DEVMAPP /dev/$DEVMAPP"
	if cryptsetup create $DEVMAPP /dev/$DEVMAPP;then
		sleep 1
		echo "fsck -Cp /dev/mapper/$DEVMAPP"
		fsck -Cp /dev/mapper/$DEVMAPP
		sleep 1
		echo "mount /dev/mapper/$DEVMAPP"
		mount /dev/mapper/$DEVMAPP
	else
		echo "cryptsetup FAILED"
	fi
;;

-ues2)
	#DEVMAPP=$2
	if [ -z $DEVMAPP ];then
		echo "$SELT $1 mapper"
		exit
	fi
	echo "umount -l /dev/mapper/$DEVMAPP"
	umount -l /dev/mapper/$DEVMAPP
	sleep 1
	echo "cryptsetup remove $DEVMAPP"
	cryptsetup remove $DEVMAPP
;;

*)
	echo "Usage:"
	echo "  $SELF -mes2 ==>  mount enc data part"
	echo "  $SELF -ues2 ==> umount enc data part"
	cat /etc/fstab | awk  'BEGIN{row=1;}{if(index($0,"/dev/mapper")>0){print(" -mes" row " =  mount enc data part ==> mount "$1);row=row+1;}}' | sed "s,^,  $SELF,g"
	cat /etc/fstab | awk  'BEGIN{row=1;}{if(index($0,"/dev/mapper")>0){print(" -ues" row " = umount enc data part ==> mount "$1);row=row+1;}}' | sed "s,^,  $SELF,g"
;;

esac




Zmodyfikowany ostatnio: 2014/05/15 09:56:56 (9 lat temu), textsize: 2,58 kB, htmlsize: 4,71 kB

Zapraszam do komentowania, zgłaszania sugestii, propozycji, własnych przykładów, ...
Dodaj komentarzKomentarze użytkowników