Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a large mdadm-based RAID5 array that I've been using with an Ubuntu 8.04 system. I'm setting up a new 9.10 (alpha 6) system on the same hardware. mdadm does a great job automagically finding and reassembling the array, but when I go to mount it, it wants my password ("Authentication is required to mount the device"). I am using the same user name for both systems, but I'm guessing that linux is smart enough to realized that user "joeblow" from one system is not necessarily the same person as "joeblow" on another system.

So what's the correct way (vs. just going crazy with chmod commands) to get the drive mounted at boot with the same device/file permissions, etc. I had before? I just want it to behave the same way it did on my old system...

share|improve this question
up vote 2 down vote accepted

File ownerships are based on the uid and gid of the user, not the name. Check the uid and gid on the files in the array, and if they are different, you can change the ownership to the new user with this command:

chown -R joeblow:joeblow /mount_point

However, if you're going to be using both systems, I suggest you sync the uid and gid for the joeblow user on both systems using the usermod and groupmod commands.

share|improve this answer
Sounds good, but I've been reading a bit about usermod and groupmod and one thing is not clear. If I change the appropriate uids/gids on new system B to match the uids/gids of old system A, will it then break all the existing associations on system B? – Fred Hamilton Sep 20 '09 at 16:19
@Fred Yes, you'll have to do a similar chown on system B too. However, that shouldn't be too difficult. find supports -uid and -user options, so you can run a command similar to this to identify and change all such files: find / -uid old_uid -exec chown -R joeblow:joeblow {} \; For safety, I'd just run the command to list such files, and inspect the list before actually changing them. – nagul Sep 24 '09 at 22:37
Just to clarify, in the comment above \; is part of the find command. – nagul Sep 24 '09 at 22:39

If you compare files like /etc/passwd and /etc/group on the new and the old system, does the uid and gid diff?

If you make sure the joeblow is always uid 500 and gid 100 (or similar) maybe this will not be a issue?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.