Results 1 to 10 of 13
Hello,
I am a Linux newbie. I installed Ubuntu (version 8.04) recently and I'm trying to set it up properly. When I installed Linux, I partitioned the hard drive following ...
- 05-05-2008 #1Just Joined!
- Join Date
- May 2008
- Posts
- 2
Question about where to put shared files in a Linux system
Hello,
I am a Linux newbie. I installed Ubuntu (version 8.04) recently and I'm trying to set it up properly. When I installed Linux, I partitioned the hard drive following a recommendation that said to create a separate partition for the "home" directory, so I did it that way. So I created a 40 GB partition for the root directory and a 100 GB partition for the "home" directory. Anyway, now I want to use an application that will require about 20 GB of data files, and those files should be accessible to every user on the computer. So I don't know where to put those data files. I'm afraid that if I put them somewhere in the root directory, there won't be much space left (there's only 30 GB left now). Is "home" supposed to be used only for files that are private to every user? Like:
/home/user1
/home/user2
...
or could I create a /home/shared/...
I don't know if by creating a "shared" directory in "home" I'm violating some sort of Linux best practices.
Or maybe what I need to do is change the partition sizes (can I do that?) so that root is bigger and home is smaller.
Thanks in advance for any suggestions.
- 05-05-2008 #2
no need to resize partition
you can just create a folder on /home
and change permissions for it using
chmod -R 777 <folder-name>

PS: you need to be root or use sudo to do this.
- 05-05-2008 #3Just Joined!
- Join Date
- May 2008
- Posts
- 2
Thanks. I will do that.
- 05-13-2008 #4Just Joined!
- Join Date
- May 2008
- Posts
- 5
Hi, this is my first post to this forum!
I'm actually a quite experienced linux user, but I was interested in this topic because I wanted to create a /home/shared directory to put my family pictures and other things that aren't related to my user account.
The answer above isn't actually a complete solution. Setting permissions to 777 on the directory makes it possible for any user to create files, but it doesn't guarantee that all users have permissions to access new files and directory.
I want to have a shared directory for a group of users that guarantees:
- Files created by any user is readable, writable and deletable by any user
- Directories created by any user have the same property
- Only root can deny other users access to any file
I tried to use the setgid flag to force all file and directories to belong to the group, but it didn't work quite as I wanted:
- Default permissions for the active user caused new files to be not writable by the group. I want to force new files to be writable by the group, regardless of user settings.
- If a directory tree is moved/copied from the user's home dir, the GID isn't changed, making it possible for the user to add files that aren't owned by the group.
- It's still possible for the user to change the group of his files.
Is it possible to force all files in the directory to belong to a certain group and have all the permissions flags for the group set?
- 05-14-2008 #5
chgrp can have you somthing
Its just a simple solution, for more advanced you can use acl !
do you want somethin like that?
- 05-14-2008 #6Just Joined!
- Join Date
- May 2008
- Posts
- 5
No! I don't want more advanced options. I want a more simple system. I want all files to be available to all users, including new files and directories.
- 05-16-2008 #7
fine then set special bit to the folder
for eg.,
chmod 6775 /home/shared
will give all access for the owner and group while denying the write access for the other users.
- 05-21-2008 #8Just Joined!
- Join Date
- May 2008
- Posts
- 5
@raghaven.kumar:
If you had read my original post, I have tried the "setgid flag", which is the same as you suggest.
It doesn't force new files to be accessable to all users in the group.
The biggest problem is that if the user's default setting for new files/directories is to make them not writable for the group, then other users in the group won't be able to change/remove files added by this user.
- 02-12-2009 #9Just Joined!
- Join Date
- Feb 2009
- Posts
- 2
Hi, this is my first post here so I dont know if its ok to post to an old thread.
Im new to linux and I want a shared directory, to share music, photos, etc with the other users of the same pc.
Has anyone found a way to do what Ropez asked? (all users able to create and delete even if owned by other user)
- 02-12-2009 #10Just Joined!
- Join Date
- May 2008
- Posts
- 5
I haven't found a better solution than what's already been suggested in this thread.
However, it might be possible to get around this by creating a separate mount point for the "shared" folder. I don't know if it's possible with mount options to force sharing, but at least it should be possible by using e.g. a FAT32 filesystem.


Reply With Quote