Results 1 to 4 of 4

Thread: mount a partition to ~/<dir>

  1. #1

    mount a partition to ~/<dir>

    How do I do this? I have a partition that is used just to store music files and I would like to mount it on the mount point ~/music for each user. How do I do this in fstab? is the tilde expanded in this situation?
    Noli illegitimi carborundum

  2. #2
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!

    Re: mount a partition to ~/<dir>

    As fstab loads before any user logs in, you will need to give the full path to the mount point in the fstab entry ie, /home/username/music. If you use the ~ fstab will be completely baffled as there will be no ~/music available to it. Apart from that I can see no major reasons why this should not work, though I have never tried it personally.

    I am not sure how you would deal with multi users, apart from mounting the partition several times with their own entries in fstab, once for each user, and to be perfectly honest, I don't know if a partition can be mounted more than once at the same time by the system, eg, can it be mounted to /home/user1/music and also to /home/user2/music at the same time. No doubt others with more knowledge will be able to tell you about that.

  3. #3
    Join Date
    Sep 2007
    Location
    Ontario, Canada
    Beans
    Hidden!

    Re: mount a partition to ~/<dir>

    Quote Originally Posted by leg View Post
    How do I do this? I have a partition that is used just to store music files and I would like to mount it on the mount point ~/music for each user. How do I do this in fstab? is the tilde expanded in this situation?
    Your best bet to accomplish this would be to mount the partition somewhere else in the filesystem on say /media/music and then create symlinks in the users home directories. You could add the symlink to /etc/skel so any new user will have this in their home.

    You could also set up in the login script to "bind" mount the mount in their home directory (mount --bind /where/you/mounted/the/dir /home/username.here/Music)

    Hope this helps

  4. #4

    Re: mount a partition to ~/<dir>

    Thanks I think the sim link will be the best idea.
    Noli illegitimi carborundum

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
  •