UID and different distros
I am posting this here because it is not really distro specific and I think it is somewhat basic although the answer may not be :o I am in the process of "trying" a new distro - CentOS 5.6 - on my Ubuntu 10.04 PC.
The PC when running Ubuntu has two hard drives installed. The OS is on /dev/sda1, /home is on /dev/sda2 and most of my data files are on /dev/sda3 which is mounted as /data. Swap is on /dev/sda4. The second hard drive has one partition /dev/sdb1 mounted as /quitelarge (it is a 1 TB drive! so it was large when I purchased it). I have a nightly batch program which archives important data files from /data to /quitelarge/mirror. To "try" CentOS I physically removed the /dev/hda drive and substituted another drive. I have CentOS installed on the new /dev/sda which is partitioned the same way as I described above for the Ubuntu disk. I have the nVidia driver installed and mostly tamed. I have installed a few packages which I like to use such as Gnome-commander, VLC, VMWare Player etc. So now I decided to pull some of my files from last night's backup to the new /data partition. I am having some issues reading and/or writing from/to /quitelarge. I think this is a clue Quote:
So the question is... how can I access /quitelarge from both Ubuntu and CentOS? I do not want to make bulk changes to ownership and permissions in CentOS lest I face the same issue when I go back to Ubuntu. For the moment I will copy selected files as root from /quitelarge to /data, change the permissions on them and not worry about ever using those files in Ubuntu again. Still, there should be a better way I would hope. TIA, Ken |
You can modify one of your user's uid. See "man usermod".
|
Quote:
This is the sort of thing that I would do by directly editing /etc/passwrd and /etc/group. |
OK so if I change "ken" in CentOS to UID 1000 then that account would own the files on /quitelarge if I understand. I will give that a try. At the moment I am back in a knock down drag out fight with nVidia. But I can play my mp3s and videos on CentOS :D:D:D once I get X running. Long live VLC! Thanks, Ken
|
You could just put both in the same group (as secondary group if you want). No need to mess with uid.
Consider them as actually being different people .. ;) |
Thanks chrism01, that sounds like a great plan. I added a user "moe" with UID 1000. I added my account "ken" to group moe:1000. I can now access files on /quitelarge. However, the directory and its subdirectories were created in Ubuntu with the owner set to Ubuntu ken:1000. So this only got me part way.
Next I deleted user moe and edited /etc/passwd and /etc/groups to make ken UID 1000 and group 1000. This of course hosed permissions to /home/ken and I could not startx after login. I deleted user ken and re-created user ken with UID 1000. Again login was hosed. Turns out the files under /tmp/gconf-ken were not deleted when the account and its home were deleted. I deleted /etc/gonf-ken and now can login with ken:1000 and all is well. (I did not have anything of value in /home/ken so I was not concerned about zapping it). I am going to restore the OS from a snapshot and try using usermod to make the changes. I have experimented with the command after reading the man page and have seen that it changes only UID but leaves the user in the original group. This may well fix the issues I came across with my other attempts. Bottom line - when I install CentOS for real I will create a dummy user as the default 500 and manually create ken:1000 later. Thanks for all the great advice! Ken |
p.s.
I restored the OS partition, logged in as root and used usermod to change ken's UID Quote:
Thanks again, Ken |
All times are GMT -5. The time now is 05:30 AM. |