User UID or GID Is Occupied

Symptom

The UID or GID of a user is occupied by another user.

Solution

  • If the user is HwHiAiUser, some driver files cannot be directly modified because they have the i attribute. Therefore, you are advised to uninstall the driver and firmware, change the UID and GID of the HwHiAiUser user in the same way as changing the UID and GID of the hwMindX user, and reinstall the driver and firmware.
  • If the user is hwMindX, perform the following steps:
  1. Change the UID and GID of the user from 9000 to another one.
    1. For example, if the UID and GID of the test user are 9000, change them to 1001.
      usermod -u 1001 test;
      groupmod -g 1001 test;
    2. Change the file owner.

      For example, if the test user has a file when the user's UID and GID are 9000, after the UID and GID of the test user are changed to 1001, the file owner needs to be changed from 9000 to 1001.

      find / -user 9000 -exec chown test {} \;
      find / -user 9000 -exec chown -h test {} \;
      find / -group 9000 -exec chgrp test {} \;
      find / -group 9000 -exec chgrp -h test {} \;
  2. Change the UID and GID of the hwMindX user to 9000.
    usermod -u 9000 hwMindX
    groupmod -g 9000 hwMindX
    If the original UID and GID of the hwMindX user are 1005, run the following command to change them:
    find / -user 1005 -exec chown hwMindX {} \;
    find / -user 1005 -exec chown -h hwMindX {} \;
    find / -group 1005 -exec chgrp hwMindX {} \;
    find / -group 1005 -exec chgrp -h hwMindX {} \;