On 02/02/2019 17.30, Marc Chamberlin wrote:
A recent thread about uuids prompts me to ask a question that I have been meaning to ask for a number of years now and never got around to it. (I have always just gritted my teeth and fixed this issue manually) When I upgrade my systems from one version of OpenSuSE to the next, I often remount partitions from an older system onto the new system (/home and /srv in particular) And this leads to problems with uuids and guids as the new system will often reassign the values associated with each of the standard uuids/guids to different values. Also I sometimes create new uuids and guids which the new system does not know anything about. My question is this, is there any way to export/import the uuids and guids assigned in one version of OpenSuSE to another newer version? I know this would also entail having to reprocess the entire file system to change all the assigned values of uuids and guids as appropriate. Sure would make life easier if this could be done in an automated fashion.... How to others managed this issue? If there is an existing tool for doing this, Google is not finding it for me....
I manage it by upgrading, not installing fresh. Otherwise, the distribution would have to reuse the same numbers on every installation, not create them randomly. This way it is a pain. The only way is to edit the /etc/passwd and group file to have the numbers that you wish, and to change the entire filesystem to the numbers you assign, manually. I had a one line concoction that did it, find all files recursively with old_uid and change them to new_uid. Sometimes needing to do to an intermediate uid first. I don't know where it is now... Ah, found it: find . -uid 500 -print0 | tee registro | xargs -0 chown 1000 Now, if you use ACLs, you may also have to change them, some other way. There is a feature during install that reads /etc/passwd and group of the target disk and recreates the same users with the same passwords on the new system. I know it works for your /home users, but I do not know if it works for the rest. And AFAIK it doesn't work on an arbitrary destination partition, ie, telling it to read them from some other place. It would be a nice feature. -- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)