Thursday, July 10, 2008

Changing UIDs

On my work laptop running SLED10SP2, my local user has a UID of 1000. My eDirectory (LUM enabled) user has a uid of 603. If these UIDs are not in sync, this can cause some weird things to happen (which I'll address in future blog posts).

I changed my UID with YaST to 603 and rebooted my system. When I logged back in I couldn't access any of my data or use programs, as the files became orphaned.

I ran the following command to search for orphaned files and dump them to a text file.

$ find / \( -fstype ext3 \) -nouser -print > orphaned.txt

Once that was finished, I wrote a script to take the orphaned files and chown them (awb4422 is my username).


for file in $(cat orphaned.txt)
do
chown awb4422 $file

done

Everything works fine now :)

No comments: