Repopulate home without creating new users
by gumb from LinuxQuestions.org on (#4T813)
Can this be done?
I had /home on a separate disk/partition and the SSD died, on a nearly new machine. The root install is still intact. Since I lost a few weeks' worth of files since my last backup, I'd at least like to try and salvage the system configuration and whatever might remain in temp files and elsewhere relating to the users and their setups. That last backup is on my old machine running an older distro with a lot of outdated cruft, so I'm reluctant to copy things over wholesale from there, I'd rather do things piecemeal after recovering what I can of the new system.
I've bought a new disk and created the new /home partition on it (as this is openSUSE Leap 15.1, I've booted the rescue system and used the YaST Partitioner to do so). The new /home is empty. I want to populate all the user directories with default files and directories, but without creating new users, then login to the desktop (Plasma) under each user. I read in another thread about the xdg-user-dirs-update command, but would this only create a few empty subdirectories, not an entire home layout with all the hidden files and default configurations?
I suspect this is too niche a scenario for there to be a dedicated function. If I use the useradd command I'd presumably have to create entirely new users and cannot merely perform actions on an existing one?


I had /home on a separate disk/partition and the SSD died, on a nearly new machine. The root install is still intact. Since I lost a few weeks' worth of files since my last backup, I'd at least like to try and salvage the system configuration and whatever might remain in temp files and elsewhere relating to the users and their setups. That last backup is on my old machine running an older distro with a lot of outdated cruft, so I'm reluctant to copy things over wholesale from there, I'd rather do things piecemeal after recovering what I can of the new system.
I've bought a new disk and created the new /home partition on it (as this is openSUSE Leap 15.1, I've booted the rescue system and used the YaST Partitioner to do so). The new /home is empty. I want to populate all the user directories with default files and directories, but without creating new users, then login to the desktop (Plasma) under each user. I read in another thread about the xdg-user-dirs-update command, but would this only create a few empty subdirectories, not an entire home layout with all the hidden files and default configurations?
I suspect this is too niche a scenario for there to be a dedicated function. If I use the useradd command I'd presumably have to create entirely new users and cannot merely perform actions on an existing one?