Announcement

Collapse
No announcement yet.

/media owned by root? SOLVED

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    /media owned by root? SOLVED

    Hello,
    As you probably can see by my question, I'm not that fluent with my linux yet.

    I wanted to move a downloaded file but discovered all my drives in /media are owned by root.
    So I have to use sudo just to copy a file?
    I tried to use chown, and tried using krusader in root mode to change owner to 'jean', no effect, it's still listed as root.

    Is this normal? (I guess it is, but strange...)

    I've read I can change it by modifying fstab like so:
    Code:
    defaults,umask=007,uid=userename,gid=username
    But I'd like an opinion as to why this is not standard.
    It seems strange that one must use sudo to simply copy files around.

    Thanks!
    Greetings from Groningen Netherlands

    #2
    Re: /media owned by root?

    /media is reserved by Ubuntu (and variants) as a default for use as a mounting point for removable media. If you insert a CDROM or USB drive, this is where it is mounted under an appropriate sub-directory such as /media/CDROM or /media/DISK and so on. These target subdirectories will have the requisite permissions for user access (depending on HAL or UDEV rules).

    So the short answer to "Is this normal?" is yes. What isn't normal is a non-root user attempting to use a reserved directory for his own file storage. Normal user access at the file level (read,write,execute) is reserved for that users /home/<INSERTYOURUSERNAMEHERE> and that's it. This is one major reason why we linux users don't need virus software and windows users do. In the windows world, file access is granted to everyone (including virus authors) and that's why this seems strange to you.

    Not to worry! We can work this out!

    First of all, am I to assume you've created a partition for file storage and mounted it as /media? I ask this because you referenced fstab which leads me to believe this is the case. If so, I suggest simply creating a different non-reserved mount point and mounting this partition there. This will automagically give you access to all your downloaded files.

    If you are the only user of this system or wish to be the only user accessing this partition, the easiest thing to do is create a subdirectory under your home directory and mount it there. Otherwise, you might use a directory like /files, give it it's own group ownership like "shared", and add the users you want to be able to use this partition to the "shared" group.

    Please Read Me

    Comment


      #3
      Re: /media owned by root?

      Originally posted by oshunluvr
      Not to worry! We can work this out!
      pheww! [wipes sweat from forehead]

      I understand. Thank you. Because ubuntu mounted those usb drives in /media, I assumed that was the place for me to mount them in fstab. All I need is another mount point in /home/jean and I am peachy...

      Otherwise, you might use a directory like /files, give it it's own group ownership like "shared", and add the users you want to be able to use this partition to the "shared" group.
      I try to stay away from groups and ownership where I can, I'm only just picking up linux again after a long delay. But it's not needed in my case, mountpoints on /home/me are fine by me!

      Thanks and have a good day.
      Greetings from Groningen Netherlands

      Comment

      Working...
      X