Results 1 to 7 of 7

Thread: Why removable disks mount in /media/<username>, not /media?

  1. #1
    Join Date
    Feb 2012
    Location
    Los Angeles, CA
    Beans
    138
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question Why removable disks mount in /media/<username>, not /media?

    After encountering this bug report, I learned that since 12.10, Ubuntu changed the behavior of removable media devices. Instead of mounting in the /media directory, they actually mount in the /media/<username> directory (e.g. home/john/JOHN). Why did Ubuntu opt for this change?
    Last edited by epikvision; June 9th, 2013 at 03:37 PM.
    John J. Kim (IRC: kotux)
    High School Senior / Ubuntu User # 35405
    www.launchpad.net/~kotux
    "Let your performance do the thinking." --Charlotte Bronte


  2. #2
    Join Date
    May 2009
    Location
    Courtenay, BC, Canada
    Beans
    1,661

    Re: Why removable disks mount in /media/<username>, not /media?


  3. #3
    Join Date
    Feb 2012
    Location
    Los Angeles, CA
    Beans
    138
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Why removable disks mount in /media/<username>, not /media?

    Awesome, but are there any specific reasons for and benefits from it?
    John J. Kim (IRC: kotux)
    High School Senior / Ubuntu User # 35405
    www.launchpad.net/~kotux
    "Let your performance do the thinking." --Charlotte Bronte


  4. #4
    Join Date
    Dec 2005
    Location
    Western Australia
    Beans
    11,480
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Why removable disks mount in /media/<username>, not /media?

    A quick search didn't yield an answer of the rationale, but it might be something to do with multiple users. For instance, it's possible to set up a network that has one server that runs all programs for all users. The thin clients are virtually just displays, keyboards and mice. You can even have it set up so that the users can plug in a USB flash drive on their thin client, and the programs running on the server can access the flash drives.

    In order to make this easier or more practical, mounting these into /media/<username>/ would make more sense than just dumping the USB drives for 30 users into /media. Most people leave the default disk label for their flash drive, and I can see problems if two or more users plug in USB drives with the label "Kingston" or "Datatraveller" or something like that.
    I try to treat the cause, not the symptom. I avoid the terminal in instructions, unless it's easier or necessary. My instructions will work within the Ubuntu system, instead of breaking or subverting it. Those are the three guarantees to the helpee.

  5. #5
    Join Date
    Dec 2009
    Beans
    6,776

    Re: Why removable disks mount in /media/<username>, not /media?

    Why did Ubuntu opt for this change?
    Can't blame Ubuntu on this one. This comes from RedHat.

    It certainly makes things a whole lot better for the home user. Consider the following scenario: You have an external ext4 formatted usb "drive". You want to share that with everyone on your Windows/Linux/OSX home network. You've done this before without issues.

    Old Way: You create a Samba share allowing guest access and to accommodate that you change permissions of /media/LABEL to 777. Everything works.

    New Way: You create a Samba share allowing guest access and to accommodate that you change permissions of /media/$USER/LABEL to 777. It doesn't work.

    Why? Take a look at the permissions of /media/$USER:
    Code:
    ls -dl /media/$USER
    What you will get is something like this:
    drwxr-x---+ 2 root root 4096 Jun 8 08:39 /media/morbius
    Looks like only root's going to access anything mounted under /media/$USER until you see that little "+" at the end - that's an Access Control List designation. So let's look at the ACL's for this directory:
    Code:
    getfacl -t /media/$USER
    Only root and morbius are going to be able to get access to anything beyond that folder.

    There are ways to work around this "design decision" of course but if you're new to this you will probably post a question on a forum somewhere. That will force them to understand or at least be introduced to the concepts of Linux permissions, ACL's, and Samba. The developers have taken something simple and made it more complex. It's a win-win for everyone.
    Last edited by Morbius1; June 9th, 2013 at 02:46 PM.

  6. #6
    Join Date
    Feb 2012
    Location
    Los Angeles, CA
    Beans
    138
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Why removable disks mount in /media/<username>, not /media?

    Alright. Thanks for the helpful replies!
    John J. Kim (IRC: kotux)
    High School Senior / Ubuntu User # 35405
    www.launchpad.net/~kotux
    "Let your performance do the thinking." --Charlotte Bronte


  7. #7
    Join Date
    Jun 2010
    Location
    Tokyo-Japan
    Beans
    6
    Distro
    Ubuntu

    Re: Why removable disks mount in /media/<username>, not /media?

    I have many symbolic link created with previous /media/<external hardisk label>
    Those links doesnt work anymore. Is there a way to return the way ubuntu 14.04 automounted like 12.04?



    <Edit>
    Found this :
    http://askubuntu.com/questions/45150...ing-from-12-04
    Last edited by ardian923; May 2nd, 2014 at 04:11 PM.

Tags for this Thread

Bookmarks

Posting Permissions

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