Wednesday, May 26, 2010

Mounting former LUKS partition

To mount existing LUKS partitions in your disk:

#---
REAL_DEVICE="/dev/<like sda5>"
MOUNTING_POINT="<Where in the disk, like /home>"
FSTYPE="<someting like ext4>"
UUID=`cryptsetup luksUUID ${REAL_DEVICE}`
LUKS_DEVICE="luks-${UUID}"
cryptsetup luksOpen ${REAL DEVICE} ${LUKS_DEVICE}
mount /dev/mapper/${LUKS_DEVICE} ${MOUNTING_POINT}
echo "/dev/mapper/${LUKS_DEVICE} ${MOUNTING_POINT} defaults 1 3" >> /etc/fstab
#---

No comments: