3

A computer I have uses systemd-homed for users, it has a single user and a single LUKS-encrypted home directory. That computer has an issue and won't boot anymore, but the disk is still working. However, I could not find how do I mount this home directory to another computer, with another user logged in.

So, how do I mount a LUKS-encrypted home directory created with systemd-homed in another machine, without booting to its disk, mounting the partitions instead?

2 Answers 2

3

I got a definitive answer from GaKu999 at Arch Linux forums. To mount a systemd-homed home directory in another machine without booting to that disk, run the following commands:

  1. First, use losetup to setup a loopback device to the home directory file:

$ sudo losetup -f -P <username>.home

  1. Then, use cryptsetup to open the encrypted LUKS volume. It will be mapped to /dev/loopXpY, where X is the loopback device index and Y is the partition index (e.g. /dev/loop0p1). Here, it will ask for the directory password (it is the user password for that device):

$ sudo cryptsetup open /dev/loopXpY <alias>

  1. At last, mount it from /dev/mapper/<alias>, using <alias> as specified in the previous step:

$ sudo mount /dev/mapper/<alias> /path/to/mountpoint

Now, the encrypted home directory will be accessible from /path/to/mountpoint!

0

Ideal, and certainly the fastest/easiest would be to boot the machine with a linux LiveCD/LiveUSB You will be able to mount the disc and use all the necessary verification tools

1
  • It will not boot due to a motherboard issue, but the computer is too old to be worth the repair.
    – ranieri
    Commented Aug 12, 2020 at 21:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .