You are not logged in.
I recently started using systemd-homed primarily because it has the option of having "portable" home directories. I had a bunch of users in my /home that I was not using regularly and were consuming storage space. I decided to let systemd-homed manage these stale users that I could put on removable drives and stow them away. In the process, I got too hooked and migrated all of my non-system users to systemd-homed.
I recently got a new machine and decided to migrate my systemd-homed users onto it but I could not figure out from the man pages how to migrate my existing users to the new machine.
I am aware that simply plugging in a drive would detect the user home directory and automatically assign a random UID within the range of 60000 to 60513. This is unacceptable for my use-case as sometimes there are programs where the UID is hard-coded and I need the user to be with the same UID. ( Also, small aside - if the user has a UID > 60000, then my login manager would not detect the user and present it for login on the login screen. )
The only relevant (and non-useful) part from the man page is :
--uid=UID
[ ... ]
Note that changing this option for existing home directories generally has no effect on home directories that already have been registered locally (have a local binding), as the UID used for an account on the local system is determined when the home directory is first activated on it, and then remains in effect until the home directory is removed.
I tried copying the ~/.identity file outside the drive and ran both `homectl create --identity` and `homectl update --identity` pointing to the copy of the ~/.identity file. That did not seem to work.
Is this a niche use-case? Or am I missing something obvious here?
The aim is to be able to mount the same users on the new machine with the same UIDs as first assigned on my old machine. Specifically, I want to be able to create the user with the right UID before I connect my removable drive for the first time ( so that systemd-homed does not assign a random UID to the user) and then have systemd-homed detect the user from the removable drive and assign the right UID to the user.
---
TL;DR version : I want to be able to mount a systemd-homed user, on a removable drive, from one machine, with the same UID that it was created with, onto a new machine that does not have this user created yet.
Offline