Jump to content

partition rw access for user [solved]


opvask
 Share

Recommended Posts

This may be somewhat of a simple newbie-ish problem, but I reckon you guys have an easy solution.

 

I use 3 different Linux distros (mandriva, PcLinuxOS and (K)ubuntu at the moment). For all 3 distro's I use a big storage partition. When I boot into another Linux distro I sometimes lose Write access to the drive and then I use "chown -R username:username /media/diskname" to regain write permission.

 

I use the same username for all 3 OS, but the userID's differ.

 

How can I make this partition available with RW access, for the (same) user in all 3 distro's?

Edited by opvask
Link to comment
Share on other sites

Create a new group, alter its ID to all 3 OS'es to desirable, add your user(s) to that group and then change the partition permissions regarding that group.

I do not think you can have FULL partition ownership in all 3 OS'es without changing thinks every time (maybe some startup script?) but I believe the group solution is sufficient for 99.5% of the operations you wanna do on that partition.

Link to comment
Share on other sites

I'll have a look at your suggestion. I use the same username/password for all 3 distro's (in Mandriva the UID is 500 but in Ubuntu it's 1000, I think). So it's possible to create a group with the user from all 3 distro's?

 

I'll give it a go.

Link to comment
Share on other sites

It certainly is possible. I have done it in the past to be able to use the same vmware virtual machine under 3 different OS'es (Arch, Sidux, PCLinuxOS... actually four, but the fourth does not count- it was Windows XP... :P ) without any permission issues: Created a group "vmware" with the same ID in all, and changed /media/vmware permissions (which actually was a separate partition, and it still is) to root/vmware, with group having RW permissions. Then I simply added scarecrow to the vmware group, logged out and then back in, and everything was working as expected...

Link to comment
Share on other sites

The problem is that not all distributions use the same UID's for users. The way around it is to have a common user for all systems with the same UID. Debian and the Buntus start UID's at 1000, while Mandriva does not. The nmae is not the thing, the UID is.

When I install I start with a default user I may never use and use the useradd command to add the other users with the UIDs I want.

Link to comment
Share on other sites

The other real easy way is to make sure your user has the same uid and gid. This is why you are having problems. One user in one distro has uid 500 and gid 500 for example, and the other has 1000 and 1000. Because they are different, you lose access.

 

Use the command line "usermod" command to edit your user and make sure they are the same.

 

usermod -u 1000 -g 1000 username

 

replace username with your username. Then chmod one last time and forget about doing anything else again as it will be fine. Any new distro you install, you will have to make sure the users have the same uid/gid.

Link to comment
Share on other sites

Thanks guys. I needed some info one the UID thing and I got it.

 

I already considered the chmod -R 777 thing. I wasn't sure about the number though. This could be a solution, because I am the only one using this computer.

 

At first I'll try what ianw1974 is suggesting. I think this is the exact solution I was looking for.

 

:D

Edited by opvask
Link to comment
Share on other sites

Just do:

 

cat /etc/passwd

 

in each distro to find out what the uid/gid is for each user. Then change and match accordingly, but check that the uid you want to allocate isn't used already.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...