You are not logged in.

#1 2020-08-13 19:40:39

Ranieri
Member
Registered: 2015-02-05
Posts: 10

[Solved] Mount systemd-homed user directory in another machine

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.

It will not boot due to a motherboard issue, but the computer is too old to be worth the repair. 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?

(I also posted this on superuser)

Last edited by Ranieri (2020-08-15 01:54:37)

Offline

#2 2020-08-13 19:58:24

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [Solved] Mount systemd-homed user directory in another machine

You could rescue your homed identity from the luks, and that can be done by solving your issue.

Now, homed creates a loop with one partition that contains the home, so you meed to mount the loop using losetup and the -P flag to scan for partitions, also the -f flag to autofind an available /dev/loopx...

The the only partition is your home that can be unlocked with cryptsetup and the password is your old user password.

After unlocked just mount it and view your files and/or rescue your identity.

In essence:

losetup -fP yourhomefile
cryptsetup open thecryptpartitionontheloop name
mount /dev/mapper/name yourtargetfolder

It’s nice to understand the commands so take a peek at their manpages just in case if you haven’t already.

What do you want to do later?
Do you want to rescue the homed or you would rather use a normal user?

Do note that this is different to how systemd does it...so it won’t be the same...you probably will have a folder inside where you mount the unlocked device...
I still don’t get why they overcomplicated a loop home with partitions and subfolders...one crypt loop with a filesystem inside should be enough...

Last edited by GaKu999 (2020-08-13 20:53:37)


My reposSome snippets

Heisenberg might have been here.

Offline

#3 2020-08-13 20:38:32

Ranieri
Member
Registered: 2015-02-05
Posts: 10

Re: [Solved] Mount systemd-homed user directory in another machine

Hi @GaKu999, thanks for the detailed response! I will not reuse the home directory, I just need some files stored in there. I will probably deploy it as a portable USB drive with an adapter.

However, when I run losetup, it errors:

$ sudo losetup -P rsa.home
losetup: rsa.home: failed to use device: No such device
$ ls
lost+found/  rsa/  rsa.home

Offline

#4 2020-08-13 20:50:24

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [Solved] Mount systemd-homed user directory in another machine

Whops, forgot the -f flag, updated the previous post reflecting that...

Now if you are just recovering your home then it’s ok, you can recover all of it’s files ignoring .cache and .identity...

.cache because it’s probably unneeded and .identity because it’s the homed identity...

Remember if you move your home to a different place you may need to take a peek at .config and .local for files that are not relevant anymore if you decide to use different software, also your trashdir if you used a file manager with trash support...

Last edited by GaKu999 (2020-08-13 20:52:48)


My reposSome snippets

Heisenberg might have been here.

Offline

#5 2020-08-15 02:18:59

Ranieri
Member
Registered: 2015-02-05
Posts: 10

Re: [Solved] Mount systemd-homed user directory in another machine

Thanks, that has solved my problem. Marking the thread as such.

Offline

Board footer

Powered by FluxBB