Manually mount or unmount encrypted home directory on openSuSE 42.1

June 2016

Problem description:

Home directory is not auto mounted at login due to corrupted file system or simple need to transfer or access data by root or by different user.

Background Information:

In my case, I needed to access and transfer data from previous openSuSE installation.

openSuSE version: 42.1

Solution used:

Note:

  1. Replace USER with the appropriate user name
  2. Become root for mounting and unmounting by: su or: sudo bash
  3. The home directory will be mounted to /mnt unless changed
openssl aes-256-cbc -d -in /home/USER.key | cryptsetup luksOpen /home/USER.img homeData
# here you could run: fsck /dev/mapper/homeData
mount /dev/mapper/homeData /mnt

umount /mnt
cryptsetup luksClose /dev/mapper/homeData

Links: