[SOLVED] Permission problem in a shared partition among several Linux OSes
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Permission problem in a shared partition among several Linux OSes
I have a Ubuntu and a Scientific Linux installed on the same computer so that I can switch back and forth, and I intend to use a third partition to host the common files. For example, I mount this partition as /common_files in both systems. However, each time I change from one system to the other, I am no longer the owner of /common_files. So I have to do
Code:
sudo chown -R myname: /common_files
to change the ownership. How can I avoid doing that?
Note that the username for both Ubuntu and Scientific Linux is "myname". I just want to keep the ownership of /common_files on both systems. Thanks.
Linux does ownership by user ID, not user name. Your user IDs are different on the two machines, so when you boot one or the other, they don't recognize the UID from the other system. You need to change the UID for your username on one of the systems to match the other. If you log out, and access a terminal through Ctrl + Alt + F2-6 and log in as root, you should be able to change the UID for your username to whatever you want. You should probably do this in SL, because changing your UID in SL from 500 to 1000 is safe, changing your UID from 1000 to 500 in Ubuntu is not (1-999 in Ubuntu is reserved for system).
Code:
id username # write down the UID and GID for your user, from here on out this will be referred to as oldUID and oldGID
usermod -u newUID "username"
groupmod -g newGID "groupname"
find / -user oldUID -exec chown newUID {} \;
find / -group oldGID -exec chgrp newGID {} \;
Last edited by suicidaleggroll; 07-22-2012 at 07:26 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.