Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just 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.

  2. #2
    Linux Newbie raghaven.kumar's Avatar
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    209
    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.

  3. #3
    Just Joined!
    Join Date
    May 2008
    Posts
    2
    Thanks. I will do that.

  4. $spacer_open
    $spacer_close
  5. #4
    Just 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?

  6. #5
    Linux Newbie raghaven.kumar's Avatar
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    209
    chgrp can have you somthing
    Its just a simple solution, for more advanced you can use acl !
    do you want somethin like that?

  7. #6
    Just 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.

  8. #7
    Linux Newbie raghaven.kumar's Avatar
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    209
    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.

  9. #8
    Just 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.

  10. #9
    Just 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)

  11. #10
    Just 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.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •